[Lldb-commits] [PATCH] D27305: Replace __ANDROID_NDK__ with simply ANDROID

2016-12-01 Thread Dan Albert via Phabricator via lldb-commits
danalbert added inline comments.



Comment at: cmake/platforms/Android.cmake:36
 # flags and definitions
 remove_definitions( -DANDROID -D__ANDROID__ )
+add_definitions( -DANDROID -DLLDB_DISABLE_LIBEDIT )

You're removing it a line before just to add it back?

`__ANDROID__` is probably the one you want. That one is defined by Clang (and 
GCC if that matters) for any Android target, so no need to worry about dealing 
with it in cmake (or any other build system).

This isn't a concern right now, but if LLDB ever needed to become part of the 
Android platform build, `ANDROID` doesn't actually mean `ANDROID`; it gets set 
for host modules too :(


https://reviews.llvm.org/D27305



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D68968: [android/process info] Introduce bundle id

2019-10-17 Thread Dan Albert via Phabricator via lldb-commits
danalbert added a subscriber: enh.
danalbert added a comment.

In D68968#1710520 , @labath wrote:

> Independently, I am wondering if there's a better way to link the process id 
> to a bundle. Using argv[0] might be ok if we're using it just for display 
> purposes, but if we're going to be doing other stuff based on that 
> identifier, it would be better to get it from a more reliable source. 
> Unfortunately, I was not able to find a more "reasonable source", but maybe 
> @danalbert has an idea.


@enh might




Comment at: lldb/source/Host/linux/Host.cpp:220-222
+  if (process_info.GetNameAsStringRef().empty() &&
+  !process_info.GetArg0().empty()) {
+process_info.SetBundleID(process_info.GetArg0());

labath wrote:
> wallace wrote:
> > labath wrote:
> > > How sure are we that the app processes are the only ones which have the 
> > > exe link unreadable? Will that be true on all phones or just the recent 
> > > ones with all the selinux stuff?
> > > 
> > > I was hoping that there is some more reliable way of fetching this 
> > > information, but there doesn't seem to be anything except [[ 
> > > https://developer.android.com/reference/android/app/ActivityManager.RunningAppProcessInfo.html
> > >  | ActivityManager.RunningAppProcessInfo ]], which I don't know if it can 
> > > be accessed from lldb, either host- or device-side.
> > > 
> > > @danalbert, any ideas here?
> > Another option I've just discovered is to invoke `pm list packages` to get 
> > the list of all apks and if an Arg0 is in that list, then it's a package.
> > That seems good enough
> That should prevent us accidentally setting an incorrect bundle id, but it 
> does not prevent a process from deliberately changing its argv[0] to the name 
> of some other installed package. That seems suboptimal, particularly if we're 
> later going to use start using the bundle id for other than just display 
> purposes (e.g. for issuing "am kill" commands). So, I am still wondering if 
> we shouldn't go back to using argv[0] for the purpose of "process list", and 
> leave the "bundle id" field for cases where we can get this information from 
> a more reliable source (e.g. reading it from the apk, or fetching it from the 
> android package manager, etc). What do you think?
@enh 


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D68968/new/

https://reviews.llvm.org/D68968



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits