1 http://sourceware.org/ml/gdb-patches/2012-03/msg00357.html
2 Subject: [patch 1/2] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #5
6 posted as a new thread.
9 cancel: [patch] Fix gdb.cp/gdb2495.exp regression with gcc-4.7 #4 [Re: [revert] Regression on PowerPC]
10 http://sourceware.org/ml/gdb-patches/2012-03/msg00322.html
11 just ON_STACK had some regressions.
13 The expectations in that mail were wrong (at least that cleanup/fix is not
14 required for gdb.cp/gdb2495.exp).
16 The problem is that the inferior call return pad breakpoint instruction is
17 never removed even after inferior call finishes. It is even still visible in
18 "maintenance info breakpoints". This does not matter much for AT_ENTRY_POINT
19 but for ON_STACK it just corrupts stack.
22 {x86_64,x86_64-m32,i686}-fedora(15-rawhide)/rhel(5-6)-linux-gnu and for
23 gdbsever non-extended mode.
31 2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
33 Remove momentary breakpoints for completed inferior calls.
34 * dummy-frame.c: Include gdbthread.h.
35 (pop_dummy_frame_bpt): New function.
36 (pop_dummy_frame): Initialie DUMMY earlier. Call pop_dummy_frame_bpt.
39 2012-03-09 Jan Kratochvil <jan.kratochvil@redhat.com>
41 Remove momentary breakpoints for completed inferior calls.
42 * gdb.base/call-signal-resume.exp (maintenance print dummy-frames)
43 (maintenance info breakpoints): New tests.
45 --- a/gdb/dummy-frame.c
46 +++ b/gdb/dummy-frame.c
49 #include "gdb_string.h"
51 +#include "gdbthread.h"
53 /* Dummy frame. This saves the processor state just prior to setting
54 up the inferior function call. Older targets save the registers
55 @@ -108,19 +109,36 @@ remove_dummy_frame (struct dummy_frame **dummy_ptr)
59 +/* Delete any breakpoint B which is a momentary breakpoint for return from
60 + inferior call matching DUMMY_VOIDP. */
63 +pop_dummy_frame_bpt (struct breakpoint *b, void *dummy_voidp)
65 + struct dummy_frame *dummy = dummy_voidp;
67 + if (b->disposition == disp_del && frame_id_eq (b->frame_id, dummy->id)
68 + && b->thread == pid_to_thread_id (inferior_ptid))
69 + delete_breakpoint (b);
71 + /* Continue the traversal. */
75 /* Pop *DUMMY_PTR, restoring program state to that before the
79 pop_dummy_frame (struct dummy_frame **dummy_ptr)
81 - struct dummy_frame *dummy;
82 + struct dummy_frame *dummy = *dummy_ptr;
84 + restore_infcall_suspend_state (dummy->caller_state);
86 - restore_infcall_suspend_state ((*dummy_ptr)->caller_state);
87 + iterate_over_breakpoints (pop_dummy_frame_bpt, dummy);
89 /* restore_infcall_control_state frees inf_state,
90 all that remains is to pop *dummy_ptr. */
92 *dummy_ptr = dummy->next;
95 --- a/gdb/testsuite/gdb.base/call-signal-resume.exp
96 +++ b/gdb/testsuite/gdb.base/call-signal-resume.exp
97 @@ -101,6 +101,18 @@ gdb_test "frame $frame_number" ".*"
98 gdb_test_no_output "set confirm off"
99 gdb_test_no_output "return"
101 +# Verify there are no remains of the dummy frame.
102 +gdb_test_no_output "maintenance print dummy-frames"
103 +set test "maintenance info breakpoints"
104 +gdb_test_multiple $test $test {
105 + -re "call dummy.*\r\n$gdb_prompt $" {
108 + -re "\r\n$gdb_prompt $" {
113 # Resume execution, the program should continue without any signal.
115 gdb_test "break stop_two" "Breakpoint \[0-9\]* at .*"