diff options
author | Daniel Jacobowitz <drow@false.org> | 2009-11-13 23:00:17 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2009-11-13 23:00:17 +0000 |
commit | 4e48512954ed27c1c1e1cf873e01f9028dcb2b3b (patch) | |
tree | 73d8be07a818b09b744bb6d696fc1c6666e96124 | |
parent | 910713fdceea718f50650f21722a5695dd57aa8c (diff) | |
download | gdb-4e48512954ed27c1c1e1cf873e01f9028dcb2b3b.zip gdb-4e48512954ed27c1c1e1cf873e01f9028dcb2b3b.tar.gz gdb-4e48512954ed27c1c1e1cf873e01f9028dcb2b3b.tar.bz2 |
* inline-frame.c (find_inline_frame_state): Check for changed PC
here...
(inline_frame_sniffer): ... not here.
-rw-r--r-- | gdb/ChangeLog | 6 | ||||
-rw-r--r-- | gdb/inline-frame.c | 27 |
2 files changed, 24 insertions, 9 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index f6aa0cf..29539b1 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,11 @@ 2009-11-13 Daniel Jacobowitz <dan@codesourcery.com> + * inline-frame.c (find_inline_frame_state): Check for changed PC + here... + (inline_frame_sniffer): ... not here. + +2009-11-13 Daniel Jacobowitz <dan@codesourcery.com> + * ui-file.c (stdio_file_read): Call gdb_select before read. 2009-11-13 Maciej W. Rozycki <macro@codesourcery.com> diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c index 9af88f4..5408e88 100644 --- a/gdb/inline-frame.c +++ b/gdb/inline-frame.c @@ -22,6 +22,7 @@ #include "block.h" #include "frame-unwind.h" #include "inferior.h" +#include "regcache.h" #include "symtab.h" #include "vec.h" @@ -59,7 +60,8 @@ DEF_VEC_O(inline_state_s); static VEC(inline_state_s) *inline_states; -/* Locate saved inlined frame state for PTID, if it exists. */ +/* Locate saved inlined frame state for PTID, if it exists + and is valid. */ static struct inline_state * find_inline_frame_state (ptid_t ptid) @@ -70,7 +72,19 @@ find_inline_frame_state (ptid_t ptid) for (ix = 0; VEC_iterate (inline_state_s, inline_states, ix, state); ix++) { if (ptid_equal (state->ptid, ptid)) - return state; + { + struct regcache *regcache = get_thread_regcache (ptid); + CORE_ADDR current_pc = regcache_read_pc (regcache); + if (current_pc != state->saved_pc) + { + /* PC has changed - this context is invalid. Use the + default behavior. */ + VEC_unordered_remove (inline_state_s, inline_states, ix); + return NULL; + } + else + return state; + } } return NULL; @@ -225,13 +239,8 @@ inline_frame_sniffer (const struct frame_unwind *self, can be stepped into later). */ if (state != NULL && state->skipped_frames > 0 && next_frame == NULL) { - if (this_pc != state->saved_pc) - state->skipped_frames = 0; - else - { - gdb_assert (depth >= state->skipped_frames); - depth -= state->skipped_frames; - } + gdb_assert (depth >= state->skipped_frames); + depth -= state->skipped_frames; } /* If all the inlined functions here already have frames, then pass |