Valgrind was crashing systematically on Android 4.1.
This crash is caused by AT_IGNORE-ing AT_BASE.
This AT_IGNORE was needed to have breakpoints in shared libs
be handled properly (not very clear what is the problem
in the interaction between Valgrind GDBSERVER, AT_BASE and GDB).
Waiting to better understand all this, as a temporary bypass,
this patch ensures we do not ignore the AT_BASE on android.
The possible consequence is that breakpoints might be inserted
by the Valgrind gdbserver at wrong addresses in shared lib.
(any feedback on that is welcome).
Valgrind was build and then "proved" to work on Android emulator 4.0
and emulator 4.1, by using memcheck on one executable.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12758
303127 Power test suite fixes for frsqrte, vrefp, and vrsqrtefp instructions.
303250 "Assertion `instrs_in->arr_used <= 10000' failed" on
OpenSSL with --track-origins=yes
-
+303624 segmentation fault on Android 4.1 (e.g. on android emulator or Galaxy Nexus OMAP)
Release 3.7.0 (5 November 2011)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Android 4.0.3 running on a (rooted, AOSP build) Nexus S.
Android 4.0.3 running on Motorola Xoom.
Android 4.0.3 running on android emulator.
+ Android 4.1 running on android emulator.
Android 2.3.4 on Nexus S worked at some time in the past.
-It is known not to work on Android 4.1 running on android emulator.
+
+On android, GDBserver might insert breaks at wrong addresses.
+Feedback on this welcome.
Other configurations and toolchains might work, but haven't been tested.
Feedback is welcome.
# Android sdk 20
# Android platform tools 12
-# Android 4.1 (API 16) does not work.
-
# then define a virtual device:
Tools -> Manage AVDs...
# I define an AVD Name with 64 Mb SD Card, (4.0.3, api 15)
/* When gdbserver sends the auxv to gdb, the AT_BASE has
to be ignored, as otherwise gdb adds this offset
to loaded shared libs, causing wrong address
- relocation e.g. when inserting breaks. */
+ relocation e.g. when inserting breaks.
+ However, ignoring AT_BASE makes V crash on Android 4.1.
+ So, keep the AT_BASE on android for now.
+ ??? Need to dig in depth about AT_BASE/GDB interaction */
+# if !defined(VGPV_arm_linux_android)
auxv->a_type = AT_IGNORE;
+# endif
auxv->u.a_val = info->interp_base;
break;