Bug 28663 - Gdb.env contains the wrong file name for `app_process` when failing to pull `app_process`
Summary: Gdb.env contains the wrong file name for `app_process` when failing to pull `...
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 5.1
Hardware: Macintosh Mac OS
: Normal normal
Target Milestone: 6.1 (C7)
Assignee: dean.ellis
Depends on:
Reported: 2015-04-01 15:29 UTC by Peter Collins
Modified: 2015-11-19 18:13 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Peter Collins 2015-04-01 15:29:02 UTC
In Android 5.0 and greater, app_process is now a symlink to app_process32 (on 32-bit devices, presumably this would be app_process64 on 64-bit). In the gdb target output we can see that pulling /system/bin/app_process fails, which is then followed by an attempt to pull /system/bin/app_process32. Unfortunately in this case `app_process` file path is the one written to gdb.env which results in a failure when executing gdb.

_Gdb target output:

More context:

OSX Yosemite
XA master/ 1e7c3b859961
Comment 1 Peter Collins 2015-04-01 16:15:08 UTC
It looks like my initial description isn't entirely correct after further investigation on a couple different Android 5.0+ devices. I am able to `adb pull /system/bin/app_process` on everything but this samsung device.
Comment 2 dean.ellis 2015-06-10 08:54:32 UTC

does the samsung device pull the app_process32 ok? 

I'm thinking of adding a check to see if app_process32 exists before writing that to the gdb.env file and if it doesn't then check for app_process. And then if neither exist log an error.

not sure that would be the correct order though, check 32 first or the other way around.
Comment 3 Peter Collins 2015-06-10 09:48:54 UTC
Yes in this case the device did pull the app_process32 file without issue. I was also then able to manually edit my gdb.env file to replace the 'app_process' string with 'app_process32' and continue debugging.

In the log I posted it shows the attempt to pull app_process is occurring _before_ app_process32, however I'm not sure if this consistent. 

Executing: .../adb   pull /system/bin/app_process   /Users/petercollins/Downloads/Test/Test//gdb-symbols failed to copy '/system/bin/app_process' to '/Users/petercollins/Downloads/Test/Test//gdb-symbols/app_process': Permission denied

Executing: ../adb   pull /system/bin/app_process32 /Users/petercollins/Downloads/Test/Test//gdb-symbols
		595 KB/s (13588 bytes in 0.022s)
Comment 4 dean.ellis 2015-11-03 12:10:27 UTC
Fixed in monodroid/master/e6a53420