This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


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

Re: ELF shared library breakpoints



> The bug-gdb archive contains at least two bug reports about
> breakpoints in shared libraries (one for Linux and one for Solaris).
> The reported problem is that if you set a breakpoint in a program when
> you're running it, and then rerun the program, it complains about not
> being able to set the breakpoint in the shared library because the
> memory is inaccessable.  Well, the same problem occurs on the Hurd.
> 
> It looks as if the following patch solves the problem.  It is
> basically the thing as the Irix 5 (irix5-nat.c) and OSF (osfsolib.c)
> ports do.
> 
> Mark
> 
> 
> 1999-05-20  Mark Kettenis  <kettenis@gnu.org>
> 
> 	* solib.c (clear_solib): Call `disable_breakpoints_in_shlibs'.
> 
> 
> Index: gdb/gdb/solib.c
> ===================================================================
> RCS file: /var/cvsroot/gdb/gdb/solib.c,v
> retrieving revision 1.1.1.2
> diff -u -r1.1.1.2 solib.c
> --- solib.c	1999/04/26 18:45:16	1.1.1.2
> +++ solib.c	1999/05/19 22:01:47
> @@ -1311,6 +1311,8 @@
>    struct so_list *next;
>    char *bfd_filename;
>  
> +  disable_breakpoints_in_shlibs (1);
> +
>    while (so_list_head)
>      {
>        if (so_list_head -> sections)


Hmm.  There's some disagreement on this issue:

1999-04-06  Stan Shebs  <shebs@andros.cygnus.com>

	* solib.c (clear_solib): Don't call disable_breakpoints_in_shlibs,
	this breaks rerunning on sun4 native.

Index: solib.c
===================================================================
RCS file: /cvs/cvsfiles/devo/gdb/solib.c,v
retrieving revision 1.123
retrieving revision 1.124
diff -c -c -b -F'^(' -r1.123 -r1.124
*** solib.c	1999/02/25 14:33:04	1.123
--- solib.c	1999/04/07 01:19:52	1.124
***************
*** 1305,1322 ****
  
  /* Called by free_all_symtabs */
  
- /* Note that clear_solib requires an open bfd, since all
-    shared library breakpoints are disabled when restarting
-    the inferior, and we cannot determine if an address
-    is in a shared library without an open BFD (locate_base
-    will eventually cause an access to the BFD). */
  void 
  clear_solib()
  {
    struct so_list *next;
    char *bfd_filename;
-   
-   disable_breakpoints_in_shlibs (1);
  
    while (so_list_head)
      {
--- 1305,1315 ----


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