Make the default sysroot be "target:"
authorGary Benson <gbenson@redhat.com>
Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)
committerGary Benson <gbenson@redhat.com>
Thu, 2 Apr 2015 12:38:29 +0000 (13:38 +0100)
This commit makes GDB default to a sysroot of "target:".
One testcase needed updating as a result of this change.

gdb/ChangeLog:

* main.c (captured_main): Set gdb_sysroot to "target:"
if not otherwise set.

gdb/testsuite/ChangeLog:

* gdb.base/break-probes.exp: Cope with "target:" sysroot.

gdb/ChangeLog
gdb/main.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/break-probes.exp

index 27c68284bdb0908af25d49e7fb07875063c03773..dd27cd8b1500bbc13c16268801850d6c33413e2c 100644 (file)
@@ -1,3 +1,8 @@
+2015-04-02  Gary Benson <gbenson@redhat.com>
+
+       * main.c (captured_main): Set gdb_sysroot to "target:"
+       if not otherwise set.
+
 2015-04-02  Gary Benson <gbenson@redhat.com>
 
        * exec.c (exec_file_attach): Support "target:" filenames.
index 72b8714eb0056ff7f71abd7bc155c3fc9c5a64c6..8f276b44735c8962e372a5fa9a39f986641b9e95 100644 (file)
@@ -548,6 +548,12 @@ captured_main (void *data)
   gdb_sysroot = relocate_gdb_directory (TARGET_SYSTEM_ROOT,
                                        TARGET_SYSTEM_ROOT_RELOCATABLE);
 
+  if (gdb_sysroot == NULL || *gdb_sysroot == '\0')
+    {
+      xfree (gdb_sysroot);
+      gdb_sysroot = xstrdup (TARGET_SYSROOT_PREFIX);
+    }
+
   debug_file_directory = relocate_gdb_directory (DEBUGDIR,
                                                 DEBUGDIR_RELOCATABLE);
 
index 0b6bbcaf25f773c11ba95f65595db07aafe9a0ff..491743f5194dcad52dc1a5ffc94705e518b8ada9 100644 (file)
@@ -1,3 +1,7 @@
+2015-04-02  Gary Benson <gbenson@redhat.com>
+
+       * gdb.base/break-probes.exp: Cope with "target:" sysroot.
+
 2015-04-01  Sasha Smundak  <asmundak@google.com>
 
        * gdb.python/py-unwind-maint.c: New file.
index 1591c336e3ce7c12b309f22fbfedff5cab9411ee..00ca458387c917ff5397c642c5be9437df45f0ac 100644 (file)
@@ -66,6 +66,10 @@ if { $using_probes } {
        }
     }
 
+    # GDB strips "target:" from the start of filenames
+    # when operating on the local filesystem
+    regsub "^target:" "$sysroot" "(target:)?" sysroot
+
     # Run til it loads our library
     set test "run til our library loads"
     set not_loaded_library 1