This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit] [patch] Code cleanup/protection: Reset stale frame_info *s
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: gdb-patches at sourceware dot org
- Date: Wed, 29 Feb 2012 15:54:01 +0100
- Subject: [commit] [patch] Code cleanup/protection: Reset stale frame_info *s
- References: <20120223083750.GB5696@host2.jankratochvil.net>
On Thu, 23 Feb 2012 09:37:50 +0100, Jan Kratochvil wrote:
> gdb/
> 2012-02-23 Jan Kratochvil <jan.kratochvil@redhat.com>
>
> * arm-linux-tdep.c (arm_linux_copy_svc): Reset stale FRAME.
> * breakpoint.c (until_break_command): Likewise.
> * elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
> * infcall.c (call_function_by_hand): Likewise.
> * infcmd.c (finish_forward): Likewise.
> * infrun.c (insert_exception_resume_breakpoint): Likewise.
Checked it in. until_break_command part had to be updated.
Thanks,
Jan
http://sourceware.org/ml/gdb-cvs/2012-02/msg00199.html
--- src/gdb/ChangeLog 2012/02/28 16:30:30 1.13876
+++ src/gdb/ChangeLog 2012/02/29 14:52:40 1.13877
@@ -1,3 +1,12 @@
+2012-02-29 Jan Kratochvil <jan.kratochvil@redhat.com>
+
+ * arm-linux-tdep.c (arm_linux_copy_svc): Reset stale FRAME.
+ * breakpoint.c (until_break_command): Likewise.
+ * elfread.c (elf_gnu_ifunc_resolver_stop): Likewise.
+ * infcall.c (call_function_by_hand): Likewise.
+ * infcmd.c (finish_forward): Likewise.
+ * infrun.c (insert_exception_resume_breakpoint): Likewise.
+
2012-02-28 Joel Brobecker <brobecker@adacore.com>
From Tristan Gingold <gingold@adacore.com>.
--- src/gdb/arm-linux-tdep.c 2012/01/04 08:16:56 1.89
+++ src/gdb/arm-linux-tdep.c 2012/02/29 14:52:43 1.90
@@ -937,6 +937,9 @@
= set_momentary_breakpoint (gdbarch, sal, get_frame_id (frame),
bp_step_resume);
+ /* set_momentary_breakpoint invalidates FRAME. */
+ frame = NULL;
+
/* We need to make sure we actually insert the momentary
breakpoint set above. */
insert_breakpoints ();
--- src/gdb/breakpoint.c 2012/02/24 16:26:36 1.657
+++ src/gdb/breakpoint.c 2012/02/29 14:52:43 1.658
@@ -10478,6 +10478,9 @@
make_cleanup (delete_longjmp_breakpoint_cleanup, &thread);
}
+ /* set_momentary_breakpoint could invalidate FRAME. */
+ frame = NULL;
+
if (anywhere)
/* If the user told us to continue until a specified location,
we don't specify a frame at which we need to stop. */
--- src/gdb/elfread.c 2012/02/21 06:44:13 1.125
+++ src/gdb/elfread.c 2012/02/29 14:52:44 1.126
@@ -995,6 +995,9 @@
prev_frame_id,
bp_gnu_ifunc_resolver_return);
+ /* set_momentary_breakpoint invalidates PREV_FRAME. */
+ prev_frame = NULL;
+
/* Add new b_return to the ring list b->related_breakpoint. */
gdb_assert (b_return->related_breakpoint == b_return);
b_return->related_breakpoint = b->related_breakpoint;
--- src/gdb/infcall.c 2012/01/04 13:51:36 1.150
+++ src/gdb/infcall.c 2012/02/29 14:52:44 1.151
@@ -783,6 +783,10 @@
PUSH_DUMMY_CALL, saved as the dummy-frame TOS, and used by
dummy_id to form the frame ID's stack address. */
bpt = set_momentary_breakpoint (gdbarch, sal, dummy_id, bp_call_dummy);
+
+ /* set_momentary_breakpoint invalidates FRAME. */
+ frame = NULL;
+
bpt->disposition = disp_del;
}
--- src/gdb/infcmd.c 2012/02/23 08:15:04 1.298
+++ src/gdb/infcmd.c 2012/02/29 14:52:44 1.299
@@ -1652,6 +1652,9 @@
get_stack_frame_id (frame),
bp_finish);
+ /* set_momentary_breakpoint invalidates FRAME. */
+ frame = NULL;
+
old_chain = make_cleanup_delete_breakpoint (breakpoint);
set_longjmp_breakpoint (tp, frame_id);
--- src/gdb/infrun.c 2012/02/27 21:36:47 1.525
+++ src/gdb/infrun.c 2012/02/29 14:52:44 1.526
@@ -5520,6 +5520,10 @@
bp = set_momentary_breakpoint_at_pc (get_frame_arch (frame),
handler, bp_exception_resume);
+
+ /* set_momentary_breakpoint_at_pc invalidates FRAME. */
+ frame = NULL;
+
bp->thread = tp->num;
inferior_thread ()->control.exception_resume_breakpoint = bp;
}