|
From: <sv...@va...> - 2011-07-12 11:51:14
|
Author: sewardj
Date: 2011-07-12 12:46:24 +0100 (Tue, 12 Jul 2011)
New Revision: 11885
Log:
Build system fixes so as to temporarily disable the GDBserver on
Android. Making that work will require a bit of extra effort due to
minor glibc-vs-bionic differences.
Modified:
trunk/configure.in
trunk/coregrind/Makefile.am
trunk/coregrind/m_options.c
trunk/coregrind/vgdb.c
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2011-07-12 10:59:27 UTC (rev 11884)
+++ trunk/configure.in 2011-07-12 11:46:24 UTC (rev 11885)
@@ -604,6 +604,7 @@
tmpdir="/tmp")
AC_DEFINE_UNQUOTED(VG_TMPDIR, "$tmpdir", [Temporary files directory])
+
#----------------------------------------------------------------------------
# Libc and suppressions
#----------------------------------------------------------------------------
@@ -818,9 +819,14 @@
#
# VGCONF_PLATFORMS_INCLUDE_ARM_LINUX && VGCONF_PLATVARIANT_IS_ANDROID
#
-# Oh well, something to figure out properly later on.
+# Hmm. Can't think of a nice clean solution to this.
+AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_VANILLA,
+ test x$VGCONF_PLATVARIANT = xvanilla)
+AM_CONDITIONAL(VGCONF_PLATVARIANT_IS_ANDROID,
+ test x$VGCONF_PLATVARIANT = xandroid)
+
#----------------------------------------------------------------------------
# Checking for various library functions and other definitions
#----------------------------------------------------------------------------
Modified: trunk/coregrind/Makefile.am
===================================================================
--- trunk/coregrind/Makefile.am 2011-07-12 10:59:27 UTC (rev 11884)
+++ trunk/coregrind/Makefile.am 2011-07-12 11:46:24 UTC (rev 11885)
@@ -56,7 +56,10 @@
vgdb_CPPFLAGS = $(AM_CPPFLAGS_PRI)
vgdb_CFLAGS = $(AM_CFLAGS_PRI)
vgdb_CCASFLAGS = $(AM_CCASFLAGS_PRI)
-vgdb_LDFLAGS = $(AM_CFLAGS_PRI) -lpthread
+vgdb_LDFLAGS = $(AM_CFLAGS_PRI)
+if !VGCONF_PLATVARIANT_IS_ANDROID
+vgdb_LDFLAGS += -lpthread
+endif
if VGCONF_PLATFORMS_INCLUDE_X86_DARWIN
vgdb_LDFLAGS += -Wl,-read_only_relocs -Wl,suppress
endif
Modified: trunk/coregrind/m_options.c
===================================================================
--- trunk/coregrind/m_options.c 2011-07-12 10:59:27 UTC (rev 11884)
+++ trunk/coregrind/m_options.c 2011-07-12 11:46:24 UTC (rev 11885)
@@ -46,11 +46,17 @@
VexControl VG_(clo_vex_control);
Bool VG_(clo_error_limit) = True;
Int VG_(clo_error_exitcode) = 0;
-VgVgdb VG_(clo_vgdb) = Vg_VgdbYes;
+
+#if defined(VGPV_arm_linux_android)
+VgVgdb VG_(clo_vgdb) = Vg_VgdbNo; // currently disabled on Android
+#else
+VgVgdb VG_(clo_vgdb) = Vg_VgdbYes;
+#endif
Int VG_(clo_vgdb_poll) = 5000;
Int VG_(clo_vgdb_error) = 999999999;
Char* VG_(clo_vgdb_prefix) = VG_CLO_VGDB_PREFIX_DEFAULT;
Bool VG_(clo_vgdb_shadow_registers) = False;
+
Bool VG_(clo_db_attach) = False;
Char* VG_(clo_db_command) = GDB_PATH " -nw %f %p";
Int VG_(clo_gen_suppressions) = 0;
Modified: trunk/coregrind/vgdb.c
===================================================================
--- trunk/coregrind/vgdb.c 2011-07-12 10:59:27 UTC (rev 11884)
+++ trunk/coregrind/vgdb.c 2011-07-12 11:46:24 UTC (rev 11885)
@@ -25,12 +25,22 @@
The GNU General Public License is contained in the file COPYING.
*/
-#include "pub_core_basics.h"
-#include "pub_core_vki.h"
-#include "pub_core_libcsetjmp.h"
-#include "pub_core_threadstate.h"
-#include "pub_core_gdbserver.h"
+/* Too difficult to make this work on Android right now. Let's
+ skip for the time being at least. */
+#if defined(VGPV_arm_linux_android)
+
+#include <stdio.h>
+int main (int argc, char** argv)
+{
+ fprintf(stderr,
+ "%s: is not currently available on Android, sorry.\n",
+ argv[0]);
+ return 0;
+}
+
+#else /* all other (Linux?) platforms */
+
#include <limits.h>
#include <unistd.h>
#include <string.h>
@@ -50,11 +60,17 @@
#include "assert.h"
#include <sys/user.h>
-# if defined(VGO_linux)
-#include <sys/prctl.h>
-#include <linux/ptrace.h>
-# endif
+#if defined(VGO_linux)
+# include <sys/prctl.h>
+# include <linux/ptrace.h>
+#endif
+#include "pub_core_basics.h"
+#include "pub_core_vki.h"
+#include "pub_core_libcsetjmp.h"
+#include "pub_core_threadstate.h"
+#include "pub_core_gdbserver.h"
+
/* vgdb has two usages:
1. relay application between gdb and the gdbserver embedded in valgrind.
2. standalone to send monitor commands to a running valgrind-ified process
@@ -2348,3 +2364,5 @@
free (commands[i]);
return 0;
}
+
+#endif /* !defined(VGPV_arm_linux_android) */
|
|
From: Philippe W. <phi...@sk...> - 2011-07-12 21:43:16
|
> Build system fixes so as to temporarily disable the GDBserver on > Android. Making that work will require a bit of extra effort due to > minor glibc-vs-bionic differences. Note that if the problematic part is the "ptrace" part, it should be enough to undefine PTRACEINVOKER (like for the darwin) #if defined(VGO_darwin) #undef PTRACEINVOKER #endif > +#else /* all other (Linux?) platforms */ The else part is for both the Linux and for the Darwin platforms (but the ptrace part is #undef-ed on Darwin). Philippe |