* gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc.

This commit is contained in:
Theodore A. Roth
2002-08-05 17:27:55 +00:00
parent b474382262
commit ced15480d0
2 changed files with 12 additions and 1 deletions

View File

@@ -1,3 +1,7 @@
2002-08-05 Theodore A. Roth <troth@verinet.com>
* gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc.
2002-08-05 Andrew Cagney <ac131313@redhat.com>
* mcore-tdep.c (mcore_gdbarch_init): Use

View File

@@ -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;
}