This is the mail archive of the archer-commits@sourceware.org mailing list for the Archer project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[SCM] archer-jankratochvil-pie: Merge branch 'piebase-symbolless-solib-core' into archer-jankratochvil-pie


The branch, archer-jankratochvil-pie has been updated
       via  bfe96c7db3d9b15ad6a3c763b8ca36adf1bf3384 (commit)
       via  b8d6cfdc2869e0caceb7beb284d51a8b64f14eef (commit)
       via  ed3a76cb3cb9c60571fec12a3fa12eb8a1502463 (commit)
       via  c9d381976213770fa67eabd80666b33c74252b0e (commit)
       via  68d1a5ef5b7bab2d761bcaea124005c6df37ce65 (commit)
       via  89edf2333cdae4bccd5a008f2153357c6c80efaf (commit)
       via  0ff15370163b3d998caab0a96d9d971ca129c5ff (commit)
       via  b35a8a5532d4595c134fc9d550859be49aaf8cec (commit)
       via  59d2190f1c3bc0772f0cfed1171a582871bb9bb1 (commit)
       via  6b7c669ae03b8dbf9946f0bbad684553eb33c8f7 (commit)
       via  6b7b67212af17e4e48e697fd28fbf770aae3b346 (commit)
       via  279d4ff7b44d7cbb808534450cbb81605d8d9c6f (commit)
       via  b062c3e1230e8efacaf2c12d5ae03987ec7de986 (commit)
       via  8f0b40b226ce74090b6e2a12c3fa474cb8856264 (commit)
       via  e0e88de46ebeb512ada23895412be30bb997401a (commit)
       via  d84687fbee164c7afc0304bec21e38ff957e0fdf (commit)
       via  c97557a47aa0f689aae8d4680d6130f24c18d1b2 (commit)
       via  b9f4a7505acd77cd216516a732bad8e943e80aaf (commit)
       via  e09732c1ecd489ec192016ce15cf0a9e3c23a1ce (commit)
       via  79048292c9101dae5ca8aeee7ddc29ccf15009c8 (commit)
       via  3bd4d1634d4abdf1edd2b169b95362cd397a025a (commit)
       via  25d7b2e7120d471697ff239d62c380759bc0f330 (commit)
       via  ebffef99a3cf1decb95ffaec6fc780f90700608f (commit)
       via  e628bb5221fac434e18c2ec5e6d7f28581fa5799 (commit)
      from  28fb21a4fbed8700f4505cf14196310840e0022e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email.

- Log -----------------------------------------------------------------
commit bfe96c7db3d9b15ad6a3c763b8ca36adf1bf3384
Merge: ed3a76cb3cb9c60571fec12a3fa12eb8a1502463 b8d6cfdc2869e0caceb7beb284d51a8b64f14eef
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:11:16 2009 +0100

    Merge branch 'piebase-symbolless-solib-core' into archer-jankratochvil-pie

commit b8d6cfdc2869e0caceb7beb284d51a8b64f14eef
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:11:01 2009 +0100

    fixup

commit ed3a76cb3cb9c60571fec12a3fa12eb8a1502463
Merge: 68d1a5ef5b7bab2d761bcaea124005c6df37ce65 c9d381976213770fa67eabd80666b33c74252b0e
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:10:18 2009 +0100

    Merge branch 'piebase-symbolless-solib-core' into archer-jankratochvil-pie

commit c9d381976213770fa67eabd80666b33c74252b0e
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:07:00 2009 +0100

    Support sharedlibraries for PIE from core-file.
    
    gdb/
    	* solib-svr4.c (scan_dyntag): Remove variable dyn_addr.  New variable
    	target_section.  Find SECT in current_target_sections, gdb_assert it.
    	(elf_lookup_lib_symbol): Pass the binary file if given symfile_objfile.
    	New variable abfd.
    	* symtab.c (lookup_objfile_from_block): Return the binary file instead
    	of separate debug info file.
    
    gdb/testsuite/
    	* gdb.base/break-interp.exp (test_core): New proc.
    	(test_ld): Call it.

commit 68d1a5ef5b7bab2d761bcaea124005c6df37ce65
Merge: b35a8a5532d4595c134fc9d550859be49aaf8cec 89edf2333cdae4bccd5a008f2153357c6c80efaf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:06:03 2009 +0100

    Merge branch 'valgrind' into archer-jankratochvil-pie

commit 89edf2333cdae4bccd5a008f2153357c6c80efaf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:05:51 2009 +0100

    fixup

commit 0ff15370163b3d998caab0a96d9d971ca129c5ff
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:04:58 2009 +0100

    biarch fix

commit b35a8a5532d4595c134fc9d550859be49aaf8cec
Merge: 279d4ff7b44d7cbb808534450cbb81605d8d9c6f 59d2190f1c3bc0772f0cfed1171a582871bb9bb1
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 01:00:21 2009 +0100

    Merge branch 'piebase-symbolless-solib-core' into archer-jankratochvil-pie

commit 59d2190f1c3bc0772f0cfed1171a582871bb9bb1
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:59:52 2009 +0100

    fixup

commit 6b7c669ae03b8dbf9946f0bbad684553eb33c8f7
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:57:09 2009 +0100

    Test also shared libraries.
    
    gdb/testsuite/
    	* gdb.base/break-interp-main.c, gdb.base/break-interp-lib.c: New.
    	* gdb.base/break-interp.exp: Exit on skip_shlib_tests.  Change $srcfile.
    	New variables $binfile_lib and $srcfile_lib.  Call get_compiler_info
    	and gdb_compile_shlib.  Use new -Wl compiler options.
    	(dl bt, main bt): New tests.

commit 6b7b67212af17e4e48e697fd28fbf770aae3b346
Merge: e0e88de46ebeb512ada23895412be30bb997401a b062c3e1230e8efacaf2c12d5ae03987ec7de986
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:55:40 2009 +0100

    Merge branch 'piebase' into piebase-symbolless

commit 279d4ff7b44d7cbb808534450cbb81605d8d9c6f
Merge: 8f0b40b226ce74090b6e2a12c3fa474cb8856264 b062c3e1230e8efacaf2c12d5ae03987ec7de986
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:54:13 2009 +0100

    Merge branch 'piebase' into archer-jankratochvil-pie

commit b062c3e1230e8efacaf2c12d5ae03987ec7de986
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:53:59 2009 +0100

    fixups

commit 8f0b40b226ce74090b6e2a12c3fa474cb8856264
Merge: c97557a47aa0f689aae8d4680d6130f24c18d1b2 d84687fbee164c7afc0304bec21e38ff957e0fdf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:48:36 2009 +0100

    Merge branch 'piebase' into archer-jankratochvil-pie

commit e0e88de46ebeb512ada23895412be30bb997401a
Merge: ebffef99a3cf1decb95ffaec6fc780f90700608f d84687fbee164c7afc0304bec21e38ff957e0fdf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:48:29 2009 +0100

    Merge branch 'piebase' into piebase-symbolless

commit d84687fbee164c7afc0304bec21e38ff957e0fdf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:48:07 2009 +0100

    drop obsolete comment.

commit c97557a47aa0f689aae8d4680d6130f24c18d1b2
Merge: e09732c1ecd489ec192016ce15cf0a9e3c23a1ce b9f4a7505acd77cd216516a732bad8e943e80aaf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:47:11 2009 +0100

    Merge branch 'core_find' into archer-jankratochvil-pie

commit b9f4a7505acd77cd216516a732bad8e943e80aaf
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:43:36 2009 +0100

    Provide common core_find proc.
    
    gdb/testsuite/
    	* gdb.base/corefile.exp: Move the core finding block out and call it as
    	core_find, new variable $corefile, replace corefile by $corefile and
    	[file tail $corefile] for usage vs. test names resp.
    	* lib/gdb.exp (core_find): Move it as a new function here.  New
    	parameter binfile and deletefiles.  New variable $destcore.  Pre-delete
    	$destcore.  Return "" on error.

commit e09732c1ecd489ec192016ce15cf0a9e3c23a1ce
Merge: 28fb21a4fbed8700f4505cf14196310840e0022e 79048292c9101dae5ca8aeee7ddc29ccf15009c8
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:40:58 2009 +0100

    Merge branch 'from_tty' into archer-jankratochvil-pie
    
    Conflicts:
    	gdb/infcmd.c

commit 79048292c9101dae5ca8aeee7ddc29ccf15009c8
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:40:02 2009 +0100

    fixup

commit 3bd4d1634d4abdf1edd2b169b95362cd397a025a
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Fri Nov 6 00:29:37 2009 +0100

    Propagate FROM_TTY to solib_create_inferior_hook.
    
    	* infcmd.c (post_create_inferior): Move solib_add after
    	solib_create_inferior_hook.  Pass from_tty to
    	solib_create_inferior_hook.  Call solib_add and SOLIB_ADD with
    	0 from_tty and comment why.
    	* infrun.c (follow_exec): Pass from_tty solib_create_inferior_hook as 0.
    	* linux-nat.c (linux_child_follow_fork): Likewise.
    	* nto-procfs.c (procfs_post_attach, procfs_create_inferior): Likewise.
    	* solib-darwin.c (darwin_solib_create_inferior_hook): New parameter
    	from_tty.
    	* solib-frv.c (frv_solib_create_inferior_hook): Likewise.
    	* solib-irix.c (irix_solib_create_inferior_hook): Likewise.
    	* solib-null.c (null_solib_create_inferior_hook): Likewise.
    	* solib-osf.c (osf_solib_create_inferior_hook): Likewise.
    	* solib-pa64.c (pa64_solib_create_inferior_hook): Likewise.
    	* solib-som.c (som_solib_create_inferior_hook): Likewise.
    	* solib-spu.c (spu_solib_create_inferior_hook): New parameter from_tty.
    	Pass it to svr4_so_ops.solib_create_inferior_hook.
    	* solib-sunos.c (sunos_solib_create_inferior_hook): New parameter
    	from_tty.
    	* solib-svr4.c (enable_break): New parameter from_tty.  Pass it to
    	solib_add.
    	(svr4_solib_create_inferior_hook): New parameter from_tty.  Pass it to
    	enable_break.
    	* solib-target.c (solib_target_solib_create_inferior_hook): New
    	parameter from_tty.
    	* solib.c (solib_create_inferior_hook): New parameter from_tty.  Pass
    	it to ops->solib_create_inferior_hook.
    	(reload_shared_libraries): Pass from_tty to solib_create_inferior_hook.
    	Move solib_add after solib_create_inferior_hook.  New comment there.
    	* solib.h (solib_create_inferior_hook): New parameter from_tty.
    	* solist.h (struct target_so_ops <solib_create_inferior_hook>):
    	Likewise.

commit 25d7b2e7120d471697ff239d62c380759bc0f330
Merge: 0779059b54bced724bd44caa0899cc6761ae1a9b 3b110f3cfd726fa3b2053b27c247d3eac8dd2258
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Nov 5 19:03:20 2009 +0100

    Merge commit 'origin/master' into valgrind

commit ebffef99a3cf1decb95ffaec6fc780f90700608f
Merge: 4527d90806c8aacfb7a0b4c762e95a18bd02f384 3b110f3cfd726fa3b2053b27c247d3eac8dd2258
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Nov 5 19:03:13 2009 +0100

    Merge commit 'origin/master' into piebase-symbolless

commit e628bb5221fac434e18c2ec5e6d7f28581fa5799
Merge: 5746ecc6119192d19a488b6faea803ab8c62271b 3b110f3cfd726fa3b2053b27c247d3eac8dd2258
Author: Jan Kratochvil <jkratoch@host1.dyn.jankratochvil.net>
Date:   Thu Nov 5 19:03:12 2009 +0100

    Merge commit 'origin/master' into piebase

-----------------------------------------------------------------------

Summary of changes:
 gdb/infcmd.c                                  |   21 +++---
 gdb/infrun.c                                  |    2 +-
 gdb/linux-nat.c                               |    4 +-
 gdb/nto-procfs.c                              |    4 +-
 gdb/solib-darwin.c                            |    2 +-
 gdb/solib-frv.c                               |    2 +-
 gdb/solib-irix.c                              |    4 +-
 gdb/solib-null.c                              |    2 +-
 gdb/solib-osf.c                               |    2 +-
 gdb/solib-pa64.c                              |    2 +-
 gdb/solib-som.c                               |    2 +-
 gdb/solib-spu.c                               |    4 +-
 gdb/solib-sunos.c                             |    2 +-
 gdb/solib-svr4.c                              |   40 ++++++++---
 gdb/solib-target.c                            |    2 +-
 gdb/solib.c                                   |   19 ++++--
 gdb/solib.h                                   |    2 +-
 gdb/solist.h                                  |    2 +-
 gdb/symtab.c                                  |    7 ++-
 gdb/testsuite/gdb.base/break-interp-lib.c     |   24 +++++++
 gdb/testsuite/gdb.base/break-interp-main.c    |   26 +++++++
 gdb/testsuite/gdb.base/break-interp.exp       |   76 +++++++++++++++++----
 gdb/testsuite/gdb.base/corefile.exp           |   89 +++++--------------------
 gdb/testsuite/gdb.base/valgrind-db-attach.exp |    5 ++
 gdb/testsuite/lib/gdb.exp                     |   67 +++++++++++++++++++
 25 files changed, 280 insertions(+), 132 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/break-interp-lib.c
 create mode 100644 gdb/testsuite/gdb.base/break-interp-main.c

First 500 lines of diff:
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 48e0c0c..817806a 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -402,24 +402,25 @@ post_create_inferior (struct target_ops *target, int from_tty)
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
       SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
 #else
-      solib_create_inferior_hook ();
+      solib_create_inferior_hook (from_tty);
 #endif
     }
 
-  /* If the solist is global across processes, there's no need to refetch it
-     here.  Ensure the solib target has been already initialized by
-     solib_create_inferior_hook.  */
+  /* If the solist is global across processes, there's no need to
+     refetch it here.  */
   if (exec_bfd && !gdbarch_has_global_solist (target_gdbarch))
     {
       /* Sometimes the platform-specific hook loads initial shared
-	 libraries, and sometimes it doesn't.  Try to do so first, so
-	 that we can add them with the correct value for FROM_TTY.
-	 If we made all the inferior hook methods consistent,
-	 this call could be removed.  */
+	 libraries, and sometimes it doesn't.  If it doesn't FROM_TTY will be
+	 incorrectly 0 but such solib targets should be fixed anyway.  If we
+	 made all the inferior hook methods consistent, this call could be
+	 removed.  Call it only after the solib target has been initialized by
+	 solib_create_inferior_hook.  */
+
 #ifdef SOLIB_ADD
-      SOLIB_ADD (NULL, from_tty, target, auto_solib_add);
+      SOLIB_ADD (NULL, 0, target, auto_solib_add);
 #else
-      solib_add (NULL, from_tty, target, auto_solib_add);
+      solib_add (NULL, 0, target, auto_solib_add);
 #endif
     }
 
diff --git a/gdb/infrun.c b/gdb/infrun.c
index 842ff6b..36bebd3 100644
--- a/gdb/infrun.c
+++ b/gdb/infrun.c
@@ -764,7 +764,7 @@ follow_exec (ptid_t pid, char *execd_pathname)
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
   SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
 #else
-  solib_create_inferior_hook ();
+  solib_create_inferior_hook (0);
 #endif
 
   jit_inferior_created_hook ();
diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
index b24585f..ba84894 100644
--- a/gdb/linux-nat.c
+++ b/gdb/linux-nat.c
@@ -769,7 +769,7 @@ holding the child stopped.  Try \"set detach-on-fork\" or \
 		 breakpoint.  If a "cloned-VM" event was propagated
 		 better throughout the core, this wouldn't be
 		 required.  */
-	      solib_create_inferior_hook ();
+	      solib_create_inferior_hook (0);
 	    }
 
 	  /* Let the thread_db layer learn about this new process.  */
@@ -951,7 +951,7 @@ Attaching after process %d fork to child process %d.\n"),
 	     shared libraries, and install the solib event breakpoint.
 	     If a "cloned-VM" event was propagated better throughout
 	     the core, this wouldn't be required.  */
-	  solib_create_inferior_hook ();
+	  solib_create_inferior_hook (0);
 	}
 
       /* Let the thread_db layer learn about this new process.  */
diff --git a/gdb/nto-procfs.c b/gdb/nto-procfs.c
index 256b0f9..f844687 100644
--- a/gdb/nto-procfs.c
+++ b/gdb/nto-procfs.c
@@ -653,7 +653,7 @@ static void
 procfs_post_attach (pid_t pid)
 {
   if (exec_bfd)
-    solib_create_inferior_hook ();
+    solib_create_inferior_hook (0);
 }
 
 static ptid_t
@@ -1214,7 +1214,7 @@ procfs_create_inferior (struct target_ops *ops, char *exec_file,
 
   if (exec_bfd != NULL
       || (symfile_objfile != NULL && symfile_objfile->obfd != NULL))
-    solib_create_inferior_hook ();
+    solib_create_inferior_hook (0);
 }
 
 static void
diff --git a/gdb/solib-darwin.c b/gdb/solib-darwin.c
index d444b37..3d64838 100644
--- a/gdb/solib-darwin.c
+++ b/gdb/solib-darwin.c
@@ -295,7 +295,7 @@ darwin_special_symbol_handling (void)
 /* Shared library startup support.  See documentation in solib-svr4.c  */
 
 static void
-darwin_solib_create_inferior_hook (void)
+darwin_solib_create_inferior_hook (int from_tty)
 {
   struct minimal_symbol *msymbol;
   char **bkpt_namep;
diff --git a/gdb/solib-frv.c b/gdb/solib-frv.c
index 1a22735..cf955a5 100644
--- a/gdb/solib-frv.c
+++ b/gdb/solib-frv.c
@@ -984,7 +984,7 @@ frv_relocate_main_executable (void)
  */
 
 static void
-frv_solib_create_inferior_hook (void)
+frv_solib_create_inferior_hook (int from_tty)
 {
   /* Relocate main executable.  */
   frv_relocate_main_executable ();
diff --git a/gdb/solib-irix.c b/gdb/solib-irix.c
index 219e7d9..c0884d2 100644
--- a/gdb/solib-irix.c
+++ b/gdb/solib-irix.c
@@ -392,7 +392,7 @@ enable_break (void)
 
    SYNOPSIS
 
-   void solib_create_inferior_hook ()
+   void solib_create_inferior_hook (int from_tty)
 
    DESCRIPTION
 
@@ -437,7 +437,7 @@ enable_break (void)
  */
 
 static void
-irix_solib_create_inferior_hook (void)
+irix_solib_create_inferior_hook (int from_tty)
 {
   struct inferior *inf;
   struct thread_info *tp;
diff --git a/gdb/solib-null.c b/gdb/solib-null.c
index b39ccdb..87f7848 100644
--- a/gdb/solib-null.c
+++ b/gdb/solib-null.c
@@ -32,7 +32,7 @@ null_special_symbol_handling (void)
 }
 
 static void
-null_solib_create_inferior_hook (void)
+null_solib_create_inferior_hook (int from_tty)
 {
 }
 
diff --git a/gdb/solib-osf.c b/gdb/solib-osf.c
index c295335..0acc7fb 100644
--- a/gdb/solib-osf.c
+++ b/gdb/solib-osf.c
@@ -306,7 +306,7 @@ osf_clear_solib (void)
    Also, what if child has exit()ed?  Must exit loop somehow.  */
 
 static void
-osf_solib_create_inferior_hook (void)
+osf_solib_create_inferior_hook (int from_tty)
 {
   struct inferior *inf;
   struct thread_info *tp;
diff --git a/gdb/solib-pa64.c b/gdb/solib-pa64.c
index 637fc1a..16d4010 100644
--- a/gdb/solib-pa64.c
+++ b/gdb/solib-pa64.c
@@ -329,7 +329,7 @@ bfd_lookup_symbol (bfd *abfd, char *symname)
    with shared libraries mapped shareable.  */
 
 static void
-pa64_solib_create_inferior_hook (void)
+pa64_solib_create_inferior_hook (int from_tty)
 {
   struct minimal_symbol *msymbol;
   unsigned int dld_flags, status;
diff --git a/gdb/solib-som.c b/gdb/solib-som.c
index 16f00a3..37ac8cd 100644
--- a/gdb/solib-som.c
+++ b/gdb/solib-som.c
@@ -182,7 +182,7 @@ struct {
    means running until the "_start" is called.  */
 
 static void
-som_solib_create_inferior_hook (void)
+som_solib_create_inferior_hook (int from_tty)
 {
   enum bfd_endian byte_order = gdbarch_byte_order (target_gdbarch);
   struct minimal_symbol *msymbol;
diff --git a/gdb/solib-spu.c b/gdb/solib-spu.c
index 723f278..02b10b3 100644
--- a/gdb/solib-spu.c
+++ b/gdb/solib-spu.c
@@ -367,7 +367,7 @@ spu_enable_break (struct objfile *objfile)
 
 /* Create inferior hook.  */
 static void
-spu_solib_create_inferior_hook (void)
+spu_solib_create_inferior_hook (int from_tty)
 {
   /* Remove all previously installed solib breakpoints.  Both the SVR4
      code and us will re-install all required breakpoints.  */
@@ -398,7 +398,7 @@ spu_solib_create_inferior_hook (void)
     }
 
   /* Call SVR4 hook -- this will re-insert the SVR4 solib breakpoints.  */
-  svr4_so_ops.solib_create_inferior_hook ();
+  svr4_so_ops.solib_create_inferior_hook (from_tty);
 
   /* If the inferior is statically linked against libspe, we need to install
      our own solib breakpoint right now.  Otherwise, it will be installed by
diff --git a/gdb/solib-sunos.c b/gdb/solib-sunos.c
index 9b2a470..b2a147d 100644
--- a/gdb/solib-sunos.c
+++ b/gdb/solib-sunos.c
@@ -740,7 +740,7 @@ sunos_special_symbol_handling (void)
  */
 
 static void
-sunos_solib_create_inferior_hook (void)
+sunos_solib_create_inferior_hook (int from_tty)
 {
   struct thread_info *tp;
   struct inferior *inf;
diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
index 76eb863..9bdc210 100644
--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -569,11 +569,12 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
 {
   int arch_size, step, sect_size;
   long dyn_tag;
-  CORE_ADDR dyn_ptr, dyn_addr;
+  CORE_ADDR dyn_ptr;
   gdb_byte *bufend, *bufstart, *buf;
   Elf32_External_Dyn *x_dynp_32;
   Elf64_External_Dyn *x_dynp_64;
   struct bfd_section *sect;
+  struct target_section *target_section;
 
   if (abfd == NULL)
     return 0;
@@ -589,7 +590,13 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
   sect = bfd_get_section_by_name (abfd, ".dynamic");
   if (sect == NULL)
     return 0;
-  dyn_addr = bfd_section_vma (abfd, sect);
+
+  for (target_section = current_target_sections->sections;
+       target_section < current_target_sections->sections_end;
+       target_section++)
+    if (sect == target_section->the_bfd_section)
+      break;
+  gdb_assert (target_section < current_target_sections->sections_end);
 
   /* Read in .dynamic from the BFD.  We will get the actual value
      from memory later.  */
@@ -631,7 +638,7 @@ scan_dyntag (int dyntag, bfd *abfd, CORE_ADDR *ptr)
 	     CORE_ADDR ptr_addr;
 
 	     ptr_type = builtin_type (target_gdbarch)->builtin_data_ptr;
-	     ptr_addr = dyn_addr + (buf - bufstart) + arch_size / 8;
+	     ptr_addr = target_section->addr + (buf - bufstart) + arch_size / 8;
 	     if (target_read_memory (ptr_addr, ptr_buf, arch_size / 8) == 0)
 	       dyn_ptr = extract_typed_address (ptr_buf, ptr_type);
 	     *ptr = dyn_ptr;
@@ -1222,7 +1229,7 @@ exec_entry_point (struct bfd *abfd, struct target_ops *targ)
  */
 
 static int
-enable_break (struct svr4_info *info)
+enable_break (struct svr4_info *info, int from_tty)
 {
   struct minimal_symbol *msymbol;
   char **bkpt_namep;
@@ -1242,7 +1249,7 @@ enable_break (struct svr4_info *info)
      mean r_brk has already been relocated.  Assume the dynamic linker
      is the object containing r_brk.  */
 
-  solib_add (NULL, 0, &current_target, auto_solib_add);
+  solib_add (NULL, from_tty, &current_target, auto_solib_add);
   sym_addr = 0;
   if (info->debug_base && solib_svr4_r_map (info) != 0)
     sym_addr = solib_svr4_r_brk (info);
@@ -1369,7 +1376,7 @@ enable_break (struct svr4_info *info)
 	  info->debug_loader_name = xstrdup (interp_name);
 	  info->debug_loader_offset_p = 1;
 	  info->debug_loader_offset = load_addr;
-	  solib_add (NULL, 0, &current_target, auto_solib_add);
+	  solib_add (NULL, from_tty, &current_target, auto_solib_add);
 	}
 
       /* Record the relocated start and end address of the dynamic linker
@@ -1620,7 +1627,7 @@ svr4_relocate_main_executable (void)
 
    SYNOPSIS
 
-   void svr4_solib_create_inferior_hook ()
+   void svr4_solib_create_inferior_hook (int from_tty)
 
    DESCRIPTION
 
@@ -1665,7 +1672,7 @@ svr4_relocate_main_executable (void)
  */
 
 static void
-svr4_solib_create_inferior_hook (void)
+svr4_solib_create_inferior_hook (int from_tty)
 {
   struct inferior *inf;
   struct thread_info *tp;
@@ -1680,7 +1687,7 @@ svr4_solib_create_inferior_hook (void)
   if (!svr4_have_link_map_offsets ())
     return;
 
-  if (!enable_break (info))
+  if (!enable_break (info, from_tty))
     return;
 
 #if defined(_SCO_DS)
@@ -1904,8 +1911,19 @@ elf_lookup_lib_symbol (const struct objfile *objfile,
 		       const char *linkage_name,
 		       const domain_enum domain)
 {
-  if (objfile->obfd == NULL
-     || scan_dyntag (DT_SYMBOLIC, objfile->obfd, NULL) != 1)
+  bfd *abfd;
+
+  if (objfile == symfile_objfile)
+    abfd = exec_bfd;
+  else
+    {
+      /* OBJFILE should have been passed as the non-debug one.  */
+      gdb_assert (objfile->separate_debug_objfile_backlink == NULL);
+
+      abfd = objfile->obfd;
+    }
+
+  if (abfd == NULL || scan_dyntag (DT_SYMBOLIC, abfd, NULL) != 1)
     return NULL;
 
   return lookup_global_symbol_from_objfile
diff --git a/gdb/solib-target.c b/gdb/solib-target.c
index 07415e4..d160a70 100644
--- a/gdb/solib-target.c
+++ b/gdb/solib-target.c
@@ -306,7 +306,7 @@ solib_target_special_symbol_handling (void)
 }
 
 static void
-solib_target_solib_create_inferior_hook (void)
+solib_target_solib_create_inferior_hook (int from_tty)
 {
   /* Nothing needed.  */
 }
diff --git a/gdb/solib.c b/gdb/solib.c
index 6ad22fe..8b0ed5d 100644
--- a/gdb/solib.c
+++ b/gdb/solib.c
@@ -998,7 +998,7 @@ clear_solib (void)
 
    SYNOPSIS
 
-   void solib_create_inferior_hook ()
+   void solib_create_inferior_hook (int from_tty)
 
    DESCRIPTION
 
@@ -1008,10 +1008,10 @@ clear_solib (void)
    SOLIB_CREATE_INFERIOR_HOOK.  */
 
 void
-solib_create_inferior_hook (void)
+solib_create_inferior_hook (int from_tty)
 {
   struct target_so_ops *ops = solib_ops (target_gdbarch);
-  ops->solib_create_inferior_hook();
+  ops->solib_create_inferior_hook (from_tty);
 }
 
 /* GLOBAL FUNCTION
@@ -1087,7 +1087,6 @@ reload_shared_libraries (char *ignored, int from_tty,
 			 struct cmd_list_element *e)
 {
   no_shared_libraries (NULL, from_tty);
-  solib_add (NULL, from_tty, NULL, auto_solib_add);
   /* Creating inferior hooks here has two purposes. First, if we reload 
      shared libraries then the address of solib breakpoint we've computed
      previously might be no longer valid.  For example, if we forgot to set
@@ -1102,9 +1101,19 @@ reload_shared_libraries (char *ignored, int from_tty,
 #ifdef SOLIB_CREATE_INFERIOR_HOOK
       SOLIB_CREATE_INFERIOR_HOOK (PIDGET (inferior_ptid));
 #else
-      solib_create_inferior_hook ();
+      solib_create_inferior_hook (from_tty);
 #endif
     }
+
+  /* Sometimes the platform-specific hook loads initial shared
+     libraries, and sometimes it doesn't.  If it doesn't FROM_TTY will be
+     incorrectly 0 but such solib targets should be fixed anyway.  If we
+     made all the inferior hook methods consistent, this call could be
+     removed.  Call it only after the solib target has been initialized by
+     solib_create_inferior_hook.  */
+
+  solib_add (NULL, 0, NULL, auto_solib_add);
+
   /* We have unloaded and then reloaded debug info for all shared libraries.
      However, frames may still reference them, for example a frame's 
      unwinder might still point of DWARF FDE structures that are now freed.
diff --git a/gdb/solib.h b/gdb/solib.h
index fee8d1c..c79e319 100644
--- a/gdb/solib.h
+++ b/gdb/solib.h
@@ -42,7 +42,7 @@ extern int solib_read_symbols (struct so_list *, int);
    addresses to which they are linked, and sufficient information to
    read in their symbols at a later time.  */
 
-extern void solib_create_inferior_hook (void);
+extern void solib_create_inferior_hook (int from_tty);
 
 /* If ADDR lies in a shared library, return its name.  */
 
diff --git a/gdb/solist.h b/gdb/solist.h
index 4c164e6..970953b 100644
--- a/gdb/solist.h
+++ b/gdb/solist.h
@@ -90,7 +90,7 @@ struct target_so_ops
     void (*clear_solib) (void);
 
     /* Target dependent code to run after child process fork.  */
-    void (*solib_create_inferior_hook) (void);
+    void (*solib_create_inferior_hook) (int from_tty);
 
     /* Do additional symbol handling, lookup, etc. after symbols
        for a shared object have been loaded.  */
diff --git a/gdb/symtab.c b/gdb/symtab.c
index 03586c3..201e1fb 100644
--- a/gdb/symtab.c
+++ b/gdb/symtab.c
@@ -1408,7 +1408,12 @@ lookup_objfile_from_block (const struct block *block)
   /* Go through SYMTABS.  */
   ALL_SYMTABS (obj, s)
     if (block == BLOCKVECTOR_BLOCK (BLOCKVECTOR (s), GLOBAL_BLOCK))
-      return obj;
+      {
+	if (obj->separate_debug_objfile_backlink)
+	  obj = obj->separate_debug_objfile_backlink;
+
+	return obj;
+      }
 
   return NULL;
 }
diff --git a/gdb/testsuite/gdb.base/break-interp-lib.c b/gdb/testsuite/gdb.base/break-interp-lib.c
new file mode 100644
index 0000000..c103da3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/break-interp-lib.c
@@ -0,0 +1,24 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+   Copyright 2009 Free Software Foundation, Inc.
+
+   This program is free software; you can redistribute it and/or modify
+   it under the terms of the GNU General Public License as published by
+   the Free Software Foundation; either version 3 of the License, or
+   (at your option) any later version.
+
+   This program is distributed in the hope that it will be useful,
+   but WITHOUT ANY WARRANTY; without even the implied warranty of
+   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+   GNU General Public License for more details.
+
+   You should have received a copy of the GNU General Public License
+   along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
+
+#include <signal.h>
+
+void
+libfunc (void)
+{
+  raise (SIGSEGV);
+}
diff --git a/gdb/testsuite/gdb.base/break-interp-main.c b/gdb/testsuite/gdb.base/break-interp-main.c
new file mode 100644
index 0000000..57b81f6
--- /dev/null
+++ b/gdb/testsuite/gdb.base/break-interp-main.c
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+


hooks/post-receive
--
Repository for Project Archer.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]