From: Theodore A. Roth Date: Mon, 5 Aug 2002 17:27:55 +0000 (+0000) Subject: * gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=ced15480d01bd4e4650619a3c3c0df85d8cfaf50;p=binutils-gdb.git * gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index b999f7335bf..80b4df3d7f8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2002-08-05 Theodore A. Roth + + * gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc. + 2002-08-05 Andrew Cagney * mcore-tdep.c (mcore_gdbarch_init): Use 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; }