This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
gdb/2426: Temporary breakpoint for "finish" command not cleaned up in MI mode
- From: tom dot fowler at hotmail dot co dot uk
- To: gdb-gnats at sources dot redhat dot com
- Date: 6 Mar 2008 17:45:16 -0000
- Subject: gdb/2426: Temporary breakpoint for "finish" command not cleaned up in MI mode
- Reply-to: tom dot fowler at hotmail dot co dot uk
>Number: 2426
>Category: gdb
>Synopsis: Temporary breakpoint for "finish" command not cleaned up in MI mode
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: unassigned
>State: open
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Thu Mar 06 17:48:01 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: tom.fowler@hotmail.co.uk
>Release: 6.7.1
>Organization:
>Environment:
Linux host, arm-elf remote target
>Description:
The "finish" command appears to work by setting a temporary breakpoint which is deleted immediately after it is triggered. Using my version of GDB in normal console mode this works as expected, but using the same executable in "--interpreter=mi" mode, the "finish" command leaves its breakpoint around to fire spuriously later on. Having looked into this a little, it seems to be a regression, in that the problem does not occur for an earlier version of GDB (v 6.0.x).
>How-To-Repeat:
In MI mode, debug a simple test case like:
----------
int x=0;
void f2(void) {
x=3;
}
void f1(void) {
x=1;
f2();
x=2;
}
int main() {
for(;;)
f1();
}
----------
Run into f2(), e.g.:
> advance f2
Use "finish" to run until out of f2()
> finish
Now continue
> cont
In the error case execution will stop in f1 again (after the call to f2), next time the loop in main is executed.
>Fix:
Not clear to me. Comparing the source of mi-main.c for v6.0.x (working) against v6.7.1 (broken), the call to mi_execute_cli_command() has been replaced by a similar call to mi_cmd_interpreter_exec(), but unfortunately somehow the required call to do_cleanups() has been lost.
>Release-Note:
>Audit-Trail:
>Unformatted: