diff options
author | Yao Qi <yao@codesourcery.com> | 2014-06-24 21:47:14 +0800 |
---|---|---|
committer | Yao Qi <yao@codesourcery.com> | 2014-06-26 16:26:01 +0800 |
commit | efc889c1a86826b6619485bf379467daaea1ad3e (patch) | |
tree | aee4291a6b9aceff16d036733b4865f2c081af47 /gdb | |
parent | 60d77146a249ae9b51d7ce98930cdbedb2cfa352 (diff) | |
download | gdb-efc889c1a86826b6619485bf379467daaea1ad3e.zip gdb-efc889c1a86826b6619485bf379467daaea1ad3e.tar.gz gdb-efc889c1a86826b6619485bf379467daaea1ad3e.tar.bz2 |
Move local variables to inner block
dummy_frame_sniffer has two local variables dummyframe and this_id,
but they are only used in the if block below. This patch is to move
them into the inner block.
gdb:
2014-06-26 Yao Qi <yao@codesourcery.com>
* dummy-frame.c (dummy_frame_sniffer): Move local variables
dummyframe and this_id into inner block below.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/dummy-frame.c | 7 |
2 files changed, 8 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 66484b5..2b7e33c 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2014-06-26 Yao Qi <yao@codesourcery.com> + * dummy-frame.c (dummy_frame_sniffer): Move local variables + dummyframe and this_id into inner block below. + +2014-06-26 Yao Qi <yao@codesourcery.com> + * infrun.c (_initialize_infrun): Replace "signal_program[0]" with "signal_pass[0]" in the initialization of signal_pass. diff --git a/gdb/dummy-frame.c b/gdb/dummy-frame.c index 998ca93..dd2ff12 100644 --- a/gdb/dummy-frame.c +++ b/gdb/dummy-frame.c @@ -195,9 +195,6 @@ dummy_frame_sniffer (const struct frame_unwind *self, struct frame_info *this_frame, void **this_prologue_cache) { - struct dummy_frame *dummyframe; - struct frame_id this_id; - /* When unwinding a normal frame, the stack structure is determined by analyzing the frame's function's code (be it using brute force prologue analysis, or the dwarf2 CFI). In the case of a dummy @@ -209,9 +206,11 @@ dummy_frame_sniffer (const struct frame_unwind *self, /* Don't bother unless there is at least one dummy frame. */ if (dummy_frame_stack != NULL) { + struct dummy_frame *dummyframe; /* Use an architecture specific method to extract this frame's dummy ID, assuming it is a dummy frame. */ - this_id = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame); + struct frame_id this_id + = gdbarch_dummy_id (get_frame_arch (this_frame), this_frame); /* Use that ID to find the corresponding cache entry. */ for (dummyframe = dummy_frame_stack; |