Commits

Yit Phang Khoo committed 25f34a1

Replace gdb-relative-data-directory with builddir-data-directory that also install data-directory into the build directory at the location computed by relocate_gdb_directory when gdb is run from the build directory.

Comments (0)

Files changed (3)

builddir-data-directory

+# HG changeset patch
+# Parent 1e03fe59debae5df70f3ffbaea8ec0a1ea22dbcc
+Also install data-directory into the build directory at the location computed by relocate_gdb_directory when gdb is run from the build directory.
+
+diff --git a/gdb/ChangeLog b/gdb/ChangeLog
+--- a/gdb/ChangeLog
++++ b/gdb/ChangeLog
+@@ -1,3 +1,9 @@
++2012-09-24  Khoo Yit Phang  <khooyp@cs.umd.edu>
++
++	* data-directory/Makefile.in (all): Also install data-directory
++	into the build directory at the location computed by
++	relocate_gdb_directory when gdb is run from the build directory.
++
+ 2012-09-24  Siddhesh Poyarekar  <siddhesh@redhat.com>
+ 
+ 	* m2-typeprint.c (m2_enum): Expand LASTVAL to LONGEST.
+diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
+--- a/gdb/data-directory/Makefile.in
++++ b/gdb/data-directory/Makefile.in
+@@ -95,8 +95,14 @@
+ 	"RUNTEST=$(RUNTEST)" \
+ 	"RUNTESTFLAGS=$(RUNTESTFLAGS)"
+ 
++# Also install data-directory into the build directory at the location
++# computed by relocate_gdb_directory when gdb is run from the build directory.
+ .PHONY: all
+ all: stamp-syscalls stamp-python
++	@$(MAKE) $(FLAGS_TO_PASS) \
++	  "SYSCALLS_INSTALL_DIR=$(top_builddir)/../$(SYSCALLS_INSTALL_DIR:$(prefix)/%=%)" \
++	  "PYTHON_INSTALL_DIR=$(top_builddir)/../$(PYTHON_INSTALL_DIR:$(prefix)/%=%)" \
++	  install-only
+ 
+ # For portability's sake, we need to handle systems that don't have
+ # symbolic links.

gdb-relative-data-directory

-# HG changeset patch
-# Parent f491aae11e27ebe14c2412b050f1936dd1479764
-Try to initialize data-directory by first searching for "data-directory" in the same directory as the gdb binary.
-
-diff --git a/gdb/ChangeLog b/gdb/ChangeLog
---- a/gdb/ChangeLog
-+++ b/gdb/ChangeLog
-@@ -1,3 +1,12 @@
-+2012-09-21  Khoo Yit Phang  <khooyp@cs.umd.edu>
-+
-+	Try to initialize data-directory by first searching for
-+	"data-directory" in the same directory as the gdb binary.
-+	* main.c (relocate_gdb_data_directory): New function similar to
-+	relocate_gdb_directory, but specifically for data-directory.
-+	(captured_main): Call relocate_gdb_data_directory to initialize
-+	gdb_datadir.
-+
- 2012-09-21  Khoo Yit Phang  <khooyp@cs.umd.edu>
- 
- 	Refactor relocate_path to also check if the relocated
-diff --git a/gdb/main.c b/gdb/main.c
---- a/gdb/main.c
-+++ b/gdb/main.c
-@@ -152,6 +152,49 @@
-   return dir;
- }
- 
-+/* Like relocate_gdb_path, but specifically for data-directory. */
-+
-+static char *
-+relocate_gdb_data_directory (void)
-+{
-+  char *dir;
-+
-+  /* First try to find "data-directory" in the same directory as gdb.
-+
-+    Use relocate_path only to resolve the parent directory of
-+    gdb_program_name (i.e., based on PATH if necessary); relocate_path
-+    (gdb_program_name, BINDIR "/data-directory") cannot be used to resolve
-+    data-directory as it returns a path relative to the _grandparent
-+    directory_ of gdb_program_name (munging the parent directory).  */
-+
-+  dir = relocate_path (gdb_program_name, BINDIR, 1, 1);
-+  if (dir)
-+    dir = reconcat (dir, dir, SLASH_STRING, "data-directory", NULL);
-+
-+  /* Then try to find GDB_DATADIR relocated relative to gdb. */
-+  if (!dir)
-+    dir = relocate_path (gdb_program_name, GDB_DATADIR, 1,
-+			 GDB_DATADIR_RELOCATABLE);
-+
-+  /* Otherwise use GDB_DATADIR as is. */
-+  if (!dir)
-+    dir = xstrdup (GDB_DATADIR);
-+
-+  /* Canonicalize the directory.  */
-+  if (*dir)
-+    {
-+      char *canon_sysroot = lrealpath (dir);
-+
-+      if (canon_sysroot)
-+	{
-+	  xfree (dir);
-+	  dir = canon_sysroot;
-+	}
-+    }
-+
-+  return dir;
-+}
-+
- /* Compute the locations of init files that GDB should source and
-    return them in SYSTEM_GDBINIT, HOME_GDBINIT, LOCAL_GDBINIT.  If
-    there is no system gdbinit (resp. home gdbinit and local gdbinit)
-@@ -370,8 +413,7 @@
-   debug_file_directory = relocate_gdb_directory (DEBUGDIR,
- 						 DEBUGDIR_RELOCATABLE);
- 
--  gdb_datadir = relocate_gdb_directory (GDB_DATADIR,
--					GDB_DATADIR_RELOCATABLE);
-+  gdb_datadir = relocate_gdb_data_directory ();
- 
- #ifdef WITH_PYTHON_PATH
-   {
 disable-bigcore-test
+builddir-data-directory
 refactor-relocate-path
-gdb-relative-data-directory
 warn-gdb-python-compat
 remote-debug-skip-frame