This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
gdb/622: clear current breakpoint in command-list problem
- From: brobecker at gnat dot com
- To: gdb-gnats at sources dot redhat dot com
- Date: 31 Jul 2002 19:14:27 -0000
- Subject: gdb/622: clear current breakpoint in command-list problem
- Reply-to: brobecker at gnat dot com
>Number: 622
>Category: gdb
>Synopsis: clear current breakpoint in command-list problem
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Jul 31 12:18:01 PDT 2002
>Closed-Date:
>Last-Modified:
>Originator: Joel Brobecker
>Release: unknown-1.0
>Organization:
>Environment:
Platform independent. Reproduced on x86-linux, and sparc-solaris.
GDB 2002-07-27-cvs.
>Description:
Using the program in the gdb.base/commands.exp testcase, the following
session shows that clearing the current breakpoint inside its commands
list causes a memory-corruption problem:
(gdb) b factorial
Breakpoint 1 at 0x8048582: file ./gdb.base/run.c, line 77.
(gdb) commands
Type commands for when breakpoint 1 is hit, one per line.
End with a line saying just "end".
>silent
>printf "factorial command-list executed\n"
>clear factorial
>cont
>end
(gdb) run 1
Starting program: [...]/gdb.base/commands 1
factorial command-list executed
warning: Invalid control type in command structure. <<<--- (1)
(gdb)
(1) shows that the command-list becomes corrupted, and as a consequence,
the execution is not resumed. Instead, the expected output from the run
command is:
Starting program: [...]/gdb.base/run 1
factorial command-list executed
1
Program exited normally.
(gdb)
>How-To-Repeat:
>Fix:
The fix consists in making a duplicate of the commands-list
and execute this copy. I will send a patch to gdb-patches
shortly.
>Release-Note:
>Audit-Trail:
>Unformatted: