aboutsummaryrefslogtreecommitdiff
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
commitced15480d01bd4e4650619a3c3c0df85d8cfaf50 (patch)
treeb568f4545559935f49811687bb5e46f953712934 /gdb/avr-tdep.c
parentb4743822622cd693b81467bf255475295ec28e91 (diff)
downloadgdb-ced15480d01bd4e4650619a3c3c0df85d8cfaf50.zip
gdb-ced15480d01bd4e4650619a3c3c0df85d8cfaf50.tar.gz
gdb-ced15480d01bd4e4650619a3c3c0df85d8cfaf50.tar.bz2
* 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 21b179c..79d0af1 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;
}