[patch] fix for PR2424

Aleksandar Ristovski
2008-03-05T17:36:16Z

[-- Attachment #1: Type: text/plain, Size: 518 bytes --]

Hello,

With the attached patch for testsuite and the patch itself, the PR should be fixed.

Thanks,

Aleksandar Ristovski
QNX Software Systems

Testsuite:
2008-03-05 Aleksandar Ristovski <aristovski@qnx.com>

* gdb.mi/mi-support.exp: Add "reason" to the matching pattern. This
is to support fix for PR2424.

infrun.c:
2008-03-05 Aleksandar Ristovski <aristovski@qnx.com>

* infrun.c (normal_stop) Move breakpoint_auto_delete further down
to allow printing to 'see' real reason of stop. This fixes PR 2424.

[-- Attachment #2: mi-support.exp.diff --]
[-- Type: text/plain, Size: 645 bytes --]

Index: gdb/testsuite/lib/mi-support.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/lib/mi-support.exp,v
retrieving revision 1.51
diff -r1.51 mi-support.exp
893c893
< -re ".*000\\*stopped,thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {
---
> -re ".*000\\*stopped,reason=.*thread-id=\"$decimal\",frame=\{addr=\"$hex\",func=\"$func\",args=\(\\\[.*\\\]\|\{.*\}\),file=\".*\",fullname=\"${fullname_syntax}.*\",line=\"\[0-9\]*\"\}\r\n$mi_gdb_prompt$" {

[-- Attachment #3: infrun.c.diff --]
[-- Type: text/plain, Size: 1007 bytes --]

Index: gdb/infrun.c
===================================================================
RCS file: /cvs/src/src/gdb/infrun.c,v
retrieving revision 1.266
diff -u -p -r1.266 infrun.c
--- gdb/infrun.c 29 Jan 2008 22:47:19 -0000 1.266
+++ gdb/infrun.c 5 Mar 2008 16:08:02 -0000
@@ -3151,11 +3151,6 @@ Further execution is probably impossible
}
}

- /* Delete the breakpoint we stopped at, if it wants to be deleted.
- Delete any breakpoint that is to be deleted at the next stop. */
-
- breakpoint_auto_delete (stop_bpstat);
-
/* If an auto-display called a function and that got a signal,
delete that auto-display to avoid an infinite recursion. */

@@ -3292,6 +3287,9 @@ Further execution is probably impossible
}

done:
+ /* Delete the breakpoint we stopped at, if it wants to be deleted.
+ Delete any breakpoint that is to be deleted at the next stop. */
+ breakpoint_auto_delete (stop_bpstat);
annotate_stopped ();
observer_notify_normal_stop (stop_bpstat);
}