From: Daniel Jacobowitz Date: Tue, 9 Oct 2007 17:59:01 +0000 (+0000) Subject: * solib-svr4.c (enable_break): Add the dynamic linker also if X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ec9a4f8d14053325856abcd5eb8c1b967bc1b1d;p=binutils-gdb.git * solib-svr4.c (enable_break): Add the dynamic linker also if auxv succeeds. * gdb.server/server-run.exp: Test for dynamic linker symbols. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 9374a313b62..c15b0be4142 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,8 @@ +2007-10-09 Daniel Jacobowitz + + * solib-svr4.c (enable_break): Add the dynamic linker also if + auxv succeeds. + 2007-10-09 Carlos Eduardo Seo * MAINTAINERS (Write After Approval): Add self. diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c index 702e6f685bb..c6dfe2eb128 100644 --- a/gdb/solib-svr4.c +++ b/gdb/solib-svr4.c @@ -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; diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 2906055991c..27d06311006 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,4 +1,8 @@ -2007/10/09 Pierre Muller +2007-10-09 Daniel Jacobowitz + + * gdb.server/server-run.exp: Test for dynamic linker symbols. + +2007-10-09 Pierre Muller * lib/gdb.exp (gdb_run_cmd): Move comment outside of gdb_expect call, to avoid interruption. diff --git a/gdb/testsuite/gdb.server/server-run.exp b/gdb/testsuite/gdb.server/server-run.exp index 8a5749d7ab0..f2a612573f8 100644 --- a/gdb/testsuite/gdb.server/server-run.exp +++ b/gdb/testsuite/gdb.server/server-run.exp @@ -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"