* solib-svr4.c (enable_break): Add the dynamic linker also if
authorDaniel Jacobowitz <drow@false.org>
Tue, 9 Oct 2007 17:59:01 +0000 (17:59 +0000)
committerDaniel Jacobowitz <drow@false.org>
Tue, 9 Oct 2007 17:59:01 +0000 (17:59 +0000)
auxv succeeds.

* gdb.server/server-run.exp: Test for dynamic linker symbols.

gdb/ChangeLog
gdb/solib-svr4.c
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.server/server-run.exp

index 9374a313b623ec2fb26f8b54f581b467809835ee..c15b0be41421f6d5cbbc5223af81a3d0ad1d2455 100644 (file)
@@ -1,3 +1,8 @@
+2007-10-09  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * solib-svr4.c (enable_break): Add the dynamic linker also if
+       auxv succeeds.
+
 2007-10-09  Carlos Eduardo Seo  <cseo@linux.vnet.ibm.com>
 
        * MAINTAINERS (Write After Approval): Add self.
index 702e6f685bb53bcdf5e5cd6c8b0b979ef2ede299..c6dfe2eb128ba9a8912543fdda109707b592a9d2 100644 (file)
@@ -986,6 +986,7 @@ enable_break (void)
       char *buf;
       CORE_ADDR load_addr = 0;
       int load_addr_found = 0;
+      int loader_found_in_list = 0;
       struct so_list *so;
       bfd *tmp_bfd = NULL;
       struct target_ops *tmp_bfd_target;
@@ -1038,6 +1039,7 @@ enable_break (void)
          if (strcmp (buf, so->so_original_name) == 0)
            {
              load_addr_found = 1;
+             loader_found_in_list = 1;
              load_addr = LM_ADDR_CHECK (so, tmp_bfd);
              break;
            }
@@ -1058,9 +1060,11 @@ enable_break (void)
          fallback method because it has actually been working well in
          most cases.  */
       if (!load_addr_found)
+       load_addr = (read_pc ()
+                    - exec_entry_point (tmp_bfd, tmp_bfd_target));
+
+      if (!loader_found_in_list)
        {
-         load_addr = (read_pc ()
-                      - exec_entry_point (tmp_bfd, tmp_bfd_target));
          debug_loader_name = xstrdup (buf);
          debug_loader_offset_p = 1;
          debug_loader_offset = load_addr;
index 2906055991c31bdc1adfed7c63668d2f8d9496ca..27d063110064bb1e61fd3a571313054d67285874 100644 (file)
@@ -1,4 +1,8 @@
-2007/10/09  Pierre Muller  <muller@ics.u-strasbg.fr>
+2007-10-09  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb.server/server-run.exp: Test for dynamic linker symbols.
+
+2007-10-09  Pierre Muller  <muller@ics.u-strasbg.fr>
 
        * lib/gdb.exp (gdb_run_cmd): Move comment outside
        of gdb_expect call, to avoid interruption.
index 8a5749d7ab0a4ff67596b5aecfb5c7f70b3382e6..f2a612573f8ab9c5a90c753b5845ece1fb8bb78a 100644 (file)
@@ -38,5 +38,12 @@ gdb_load $binfile
 gdbserver_run ""
 gdb_reinitialize_dir $srcdir/$subdir
 
+# We are now stopped at the program's entry point.  On targets which use
+# SVR4 dynamic linking, we should have automatically loaded symbols for
+# the dynamic linker.
+if { [istarget *-*-linux*] } {
+    gdb_test "info shared" "From.*To.*" "loaded dynamic linker"
+}
+
 gdb_breakpoint main
 gdb_test "continue" "Breakpoint.* main .*" "continue to main"