This is the mail archive of the gdb-testers@sourceware.cygnus.com mailing list for the GDB project. See the GDB home page for more information.


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

gdb-4.16.97: Severe regression due to breakpoint_re_set_one change


This change:

Mon Mar 23 13:52:28 1998  Ulrich Drepper  (drepper@cygnus.com)

	* breakpoint.c (breakpoint_re_set_one): Treat bp_shlib_events
	like bp_breakpoints.

causes a severe regression on Solaris platforms.
Under Solaris (and I suspect other SVR4 based platforms), the bp_shlib_event
breakpoint has a NULL addr_string, so the bp_shlib_event breakpoint gets
deleted by the first call to breakpoint_re_set_one.
As a consequence, you can no longer stop on solib events, the automatic
symbol adding for dlopened libs fails, and thread debugging (which relies
on automatic symbol adding) is completely hosed.
Below are the typescripts for two thread debugging sessions, using the
gdb/testsuite/gdb.threads/pthreads executable.

I have no idea what this patch tries to fix, but it should definitely get
reverted (or fixed otherwise) for the gdb-4.17 release.

pes@resunserv_693$ gdb-4.16.97 pthreads
GNU gdb 4.16.97
Copyright 1997 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.5.1"...
(gdb) b main
Breakpoint 1 at 0x10df4: file /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c, line 116.
(gdb) r
Starting program: /afs/regent.e-technik.tu-muenchen.de/home/pes/pes/gdbnd/sun/gdb/testsuite/gdb.threads/pthreads 
[New LWP    2        ]

Breakpoint 1, main (argc=0x1, argv=0xeffffa5c)
    at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
116	  int t = 0;
(gdb) i threads
  2 LWP    2          0xef679b38 in __signotifywait ()
* 1 LWP    1          main (argc=0x1, argv=0xeffffa5c)
    at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
(gdb) i shared
>From        To          Syms Read   Shared Object Library
0xef740000  0xef7533c7  Yes         /usr/lib/libpthread.so.1
0xef700000  0xef7257ac  Yes         /usr/lib/libm.so.1
0xef640000  0xef6d6a88  Yes         /usr/lib/libc.so.1
0xef780000  0xef780470  Yes         /usr/lib/libdl.so.1
0xef5c0000  0xef5eaeb8  No          /usr/lib/libthread.so.1
(gdb) maint i b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00010df4 in main
                                       at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
	breakpoint already hit 1 time


Using gdb-4.16.86, or undoing the change, I get:


pes@resunserv_705$ gdb-4.16.97new pthreads
GNU gdb 4.16.97
Copyright 1997 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "sparc-sun-solaris2.5.1"...
(gdb) b main
Breakpoint 1 at 0x10df4: file /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c, line 116.
(gdb) r
Starting program: /afs/regent.e-technik.tu-muenchen.de/home/pes/pes/gdbnd/sun/gdb/testsuite/gdb.threads/pthreads 
[New LWP    2        ]

Breakpoint 1, main (argc=0x1, argv=0xeffffa5c)
    at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
116	  int t = 0;
(gdb) i threads
  5 Thread 3          0xef5c6548 in _swtch ()
  4 Thread 2 (LWP 2)  0xef679b38 in __signotifywait ()
* 3 Thread 1 (LWP 1)  main (argc=0x1, argv=0xeffffa5c)
    at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
  2 LWP    2          0xef679b38 in __signotifywait ()
  1 LWP    1          main (argc=0x1, argv=0xeffffa5c)
    at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
(gdb) i shared
>From        To          Syms Read   Shared Object Library
0xef740000  0xef7533c7  Yes         /usr/lib/libpthread.so.1
0xef700000  0xef7257ac  Yes         /usr/lib/libm.so.1
0xef640000  0xef6d6a88  Yes         /usr/lib/libc.so.1
0xef780000  0xef780470  Yes         /usr/lib/libdl.so.1
0xef5c0000  0xef5eaeb8  Yes         /usr/lib/libthread.so.1
(gdb) maint i b
Num Type           Disp Enb Address    What
1   breakpoint     keep y   0x00010df4 in main
                                       at /usr/usrre/pes/gdbnd/devo/gdb/testsuite/gdb.threads/pthreads.c:116
	breakpoint already hit 1 time
-1  shlib events   keep y   0xef7cb938 
	breakpoint already hit 6 times

-- 
Peter Schauer			pes@regent.e-technik.tu-muenchen.de