* gdb/avr-tdep.c(avr_skip_prologue): Fix to return the correct pc.
authorTheodore A. Roth <troth@openavr.org>
Mon, 5 Aug 2002 17:27:55 +0000 (17:27 +0000)
committerTheodore A. Roth <troth@openavr.org>
Mon, 5 Aug 2002 17:27:55 +0000 (17:27 +0000)
gdb/ChangeLog
gdb/avr-tdep.c

index b999f7335bfce623bf6f62217786568491565fb0..80b4df3d7f84e6e796208774a787ddd4dd8cfd6c 100644 (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
index 21b179c1c5aa256b72404174eac3e86a179832dd..79d0af19df3efec2e995f852b0487575f745d34c 100644 (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;
     }
 
This page took 0.029512 seconds and 4 git commands to generate.