This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/56: "clear" command removes internal breakpoints
- To: gdb-gnats at sources dot redhat dot com
- Subject: gdb/56: "clear" command removes internal breakpoints
- From: phred at cs dot berkeley dot edu
- Date: 28 May 2001 06:15:18 -0000
- Reply-To: phred at cs dot berkeley dot edu
>Number: 56
>Category: gdb
>Synopsis: "clear" command removes internal breakpoints
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Sun May 27 23:18:00 PDT 2001
>Closed-Date:
>Last-Modified:
>Originator: Fred Reiss
>Release: gdb 5.0
>Organization:
>Environment:
Stock Red Hat Linux 7.1
>Description:
The "clear" command will merrily delete gdb's special
internal breakpoints.
In particular, if the user sets a normal breakpoint at a
place where gdb also happens to have an internal breakpoint
and types "clear" when gdb hits the normal breakpoint, then
the internal breakpoint goes away, too.
>How-To-Repeat:
[wuzzy:~] 12) gcc -g hello.c
[wuzzy:~] 13) gdb a.out
GNU gdb 5.0rh-5 Red Hat Linux 7.1
Copyright 2001 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 "i386-redhat-linux"...
(gdb) br main
Breakpoint 1 at 0x8048466: file hello.c, line 4.
(gdb) ru
Starting program: /home/phred/a.out
Breakpoint 1, main (argc=1, argv=0xbffff91c) at hello.c:4
4 printf( "Hello, world!\n" );
(gdb) maintenance info breakpoints
Num Type Disp Enb Address What
1 breakpoint keep y 0x08048466 in main at hello.c:4
breakpoint already hit 1 time
-2 shlib events keep y 0x4000e4f0 <_dl_debug_state>
breakpoint already hit 3 times
-7 longjmp keep n 0x400116d0 <longjmp>
-8 longjmp keep n 0x40053444 <__libc_siglongjmp>
-9 longjmp keep n 0x40053444 <__libc_siglongjmp>
-10 longjmp resume keep n 0x00000000
(gdb) clear *0x4000e4f0
Deleted breakpoint -2
(gdb) clear *0x400116d0
Deleted breakpoint -7
(gdb) clear *0x40053444
Deleted breakpoints -9 -8
(gdb)
>Fix:
The clear_command() function should check whether a
breakpoint is an internal breakpoint before deleting it.
Someone might want to add a "maintenance clear" command that
can remove internal breakpoints.
>Release-Note:
>Audit-Trail:
>Unformatted: