gdb/
authorSanjoy Das <sanjoyd@sourceware.org>
Sun, 20 Nov 2011 08:53:25 +0000 (08:53 +0000)
committerSanjoy Das <sanjoyd@sourceware.org>
Sun, 20 Nov 2011 08:53:25 +0000 (08:53 +0000)
* config.in: Add new #defines: JIT_READER_DIR and
JIT_READER_DIR_RELOCATABLE.
* configure.ac: New GDB directory entry for jit-reader-dir.
* configure: Re-generated by autoconf.
* jit.c: New static variable: const char *jit_reader_dir.
(_initialize_jit): Relocate jit_reader_dir.

gdb/ChangeLog
gdb/config.in
gdb/configure
gdb/configure.ac
gdb/jit.c

index f09f3ca220838bdddd67043220b70d4d300af8cc..bd217c04bf4ec7314baca4e817e6138d9b22ed4e 100644 (file)
@@ -1,3 +1,12 @@
+2011-11-20  Sanjoy Das  <sdas@igalia.com>
+
+       * config.in: Add new #defines: JIT_READER_DIR and
+       JIT_READER_DIR_RELOCATABLE.
+       * configure.ac: New GDB directory entry for jit-reader-dir.
+       * configure: Re-generated by autoconf.
+       * jit.c: New static variable: const char *jit_reader_dir.
+       (_initialize_jit): Relocate jit_reader_dir.
+
 2011-11-20  Sanjoy Das  <sdas@igalia.com>
 
        * Makefile.in: Add jit-reader.h as a header.  Have it installed in
index c1d7c6865f2981122d97ff52d569f4add51e8b8e..27a4e2ce93c8d21e345e6d30bfe0d7bcce02f088 100644 (file)
 
 /* Define as `fork' if `vfork' does not work. */
 #undef vfork
+
+/* The directory from which JIT readers should be loaded.  */
+#undef JIT_READER_DIR
+
+/* Define if JIT_READER_DIR should be relocated when GDB is moved.  */
+#undef JIT_READER_DIR_RELOCATABLE
index a206ee050a72a713a1fc3ab628c61390cfc0ddeb..78cd9e90f0d7b94c1551f14f04428fb10ed74098 100755 (executable)
@@ -666,6 +666,7 @@ python_prog_path
 LTLIBEXPAT
 LIBEXPAT
 HAVE_LIBEXPAT
+JIT_READER_DIR
 TARGET_PTR
 READLINE_TEXI_INCFLAG
 READLINE_CFLAGS
@@ -966,6 +967,7 @@ with_zlib
 with_libiconv_prefix
 with_iconv_bin
 with_system_readline
+with_jit_reader_dir
 with_expat
 with_gnu_ld
 enable_rpath
@@ -1666,6 +1668,8 @@ Optional Packages:
                           search for libiconv in DIR/include and DIR/lib
   --with-iconv-bin=PATH   specify where to find the iconv program
   --with-system-readline  use installed readline library
+  --with-jit-reader-dir=PATH
+                          directory to load the JIT readers from
   --with-expat            include expat support (auto/yes/no)
   --with-gnu-ld           assume the C compiler uses GNU ld default=no
   --with-libexpat-prefix[=DIR]  search for libexpat in DIR/include and DIR/lib
@@ -10008,6 +10012,53 @@ ac_config_files="$ac_config_files jit-reader.h:jit-reader.in"
 
 
 
+
+# Check whether --with-jit-reader-dir was given.
+if test "${with_jit_reader_dir+set}" = set; then :
+  withval=$with_jit_reader_dir;
+    JIT_READER_DIR=$withval
+else
+  JIT_READER_DIR=${libdir}/gdb
+fi
+
+
+  test "x$prefix" = xNONE && prefix="$ac_default_prefix"
+  test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+  ac_define_dir=`eval echo $JIT_READER_DIR`
+  ac_define_dir=`eval echo $ac_define_dir`
+
+cat >>confdefs.h <<_ACEOF
+#define JIT_READER_DIR "$ac_define_dir"
+_ACEOF
+
+
+
+
+  if test "x$exec_prefix" = xNONE || test "x$exec_prefix" = 'x${prefix}'; then
+     if test "x$prefix" = xNONE; then
+       test_prefix=/usr/local
+     else
+       test_prefix=$prefix
+     fi
+  else
+     test_prefix=$exec_prefix
+  fi
+  value=0
+  case ${ac_define_dir} in
+     "${test_prefix}"|"${test_prefix}/"*|\
+       '${exec_prefix}'|'${exec_prefix}/'*)
+     value=1
+     ;;
+  esac
+
+cat >>confdefs.h <<_ACEOF
+#define JIT_READER_DIR_RELOCATABLE $value
+_ACEOF
+
+
+
+
+
 # Check whether --with-expat was given.
 if test "${with_expat+set}" = set; then :
   withval=$with_expat;
index ac8707af54b5a8dd622dbcc7f8953bc99e341583..4ecb5c94e2b292f708658ace4833322d1c829401 100644 (file)
@@ -627,6 +627,10 @@ fi
 AC_SUBST(TARGET_PTR)
 AC_CONFIG_FILES([jit-reader.h:jit-reader.in])
 
+GDB_AC_WITH_DIR([JIT_READER_DIR], [jit-reader-dir],
+                [directory to load the JIT readers from],
+                [${libdir}/gdb])
+
 AC_ARG_WITH(expat,
   AS_HELP_STRING([--with-expat], [include expat support (auto/yes/no)]),
   [], [with_expat=auto])
index 85e40ac8be36ee49bf1c6ab1dbc42ff02bfefffb..af33a91dbf25ea3e6481e8d792b51c96760f73d1 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -33,6 +33,8 @@
 #include "target.h"
 #include "gdb_stat.h"
 
+static const char *jit_reader_dir = NULL;
+
 static const struct objfile_data *jit_objfile_data;
 
 static const char *const jit_break_name = "__jit_debug_register_code";
@@ -558,6 +560,8 @@ extern void _initialize_jit (void);
 void
 _initialize_jit (void)
 {
+  jit_reader_dir = relocate_gdb_directory (JIT_READER_DIR,
+                                           JIT_READER_DIR_RELOCATABLE);
   add_setshow_zinteger_cmd ("jit", class_maintenance, &jit_debug,
                            _("Set JIT debugging."),
                            _("Show JIT debugging."),