diff options
author | Mark Kettenis <kettenis@gnu.org> | 2003-05-23 16:59:13 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@gnu.org> | 2003-05-23 16:59:13 +0000 |
commit | 2cc1fc51ab6d7e6ce8f373bbec1c9d14cb9ef920 (patch) | |
tree | f2fa9d4a7ce4be8d3eb221863ce26c2683ccb8b7 /gdb/blockframe.c | |
parent | eeec499c7ea76a37ff5ff79d15f23225db97a3f9 (diff) | |
download | gdb-2cc1fc51ab6d7e6ce8f373bbec1c9d14cb9ef920.tar.gz |
* blockframe.c (get_pc_function_start): Rewrite to avoid
asignments in if-statements.
Diffstat (limited to 'gdb/blockframe.c')
-rw-r--r-- | gdb/blockframe.c | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/gdb/blockframe.c b/gdb/blockframe.c index 3c713763a71..1027a465273 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -223,28 +223,31 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block) CORE_ADDR get_pc_function_start (CORE_ADDR pc) { - register struct block *bl; - register struct symbol *symbol; - register struct minimal_symbol *msymbol; - CORE_ADDR fstart; + struct block *bl; + struct minimal_symbol *msymbol; - if ((bl = block_for_pc (pc)) != NULL && - (symbol = block_function (bl)) != NULL) - { - bl = SYMBOL_BLOCK_VALUE (symbol); - fstart = BLOCK_START (bl); - } - else if ((msymbol = lookup_minimal_symbol_by_pc (pc)) != NULL) + bl = block_for_pc (pc); + if (bl) { - fstart = SYMBOL_VALUE_ADDRESS (msymbol); - if (!find_pc_section (fstart)) - return 0; + struct symbol *symbol = block_function (bl); + + if (symbol) + { + bl = SYMBOL_BLOCK_VALUE (symbol); + return BLOCK_START (bl); + } } - else + + msymbol = lookup_minimal_symbol_by_pc (pc); + if (msymbol) { - fstart = 0; + CORE_ADDR fstart = SYMBOL_VALUE_ADDRESS (msymbol); + + if (find_pc_section (fstart)) + return fstart; } - return (fstart); + + return 0; } /* Return the symbol for the function executing in frame FRAME. */ |