summaryrefslogtreecommitdiff
path: root/gdb/avr-tdep.c
diff options
context:
space:
mode:
authorTheodore A. Roth <troth@openavr.org>2002-08-05 17:27:55 +0000
committerTheodore A. Roth <troth@openavr.org>2002-08-05 17:27:55 +0000
commit85de67a7a425726113d278847689b54f01ef7224 (patch)
tree24cf3c10a588ece6171f2243ea33618ad8e782c8 /gdb/avr-tdep.c
parent9ad616c56cbe60519cea3820a5e508e14d13c839 (diff)
downloadgdb-85de67a7a425726113d278847689b54f01ef7224.tar.gz
* gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc.
Diffstat (limited to 'gdb/avr-tdep.c')
-rw-r--r--gdb/avr-tdep.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/gdb/avr-tdep.c b/gdb/avr-tdep.c
index 21b179c1c5a..79d0af19df3 100644
--- a/gdb/avr-tdep.c
+++ b/gdb/avr-tdep.c
@@ -996,7 +996,14 @@ avr_skip_prologue (CORE_ADDR pc)
{
sal = find_pc_line (func_addr, 0);
- if (sal.line != 0 && sal.end < func_end)
+ /* troth/2002-08-05: For some very simple functions, gcc doesn't
+ generate a prologue and the sal.end ends up being the 2-byte ``ret''
+ instruction at the end of the function, but func_end ends up being
+ the address of the first instruction of the _next_ function. By
+ adjusting func_end by 2 bytes, we can catch these functions and not
+ return sal.end if it is the ``ret'' instruction. */
+
+ if (sal.line != 0 && sal.end < (func_end-2))
return sal.end;
}