]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* tm-hppa.h (PROLOGUE_FIRSTLINE_OVERLAP): Delete. Causes more
authorJeff Law <law@redhat.com>
Tue, 22 Aug 1995 08:04:15 +0000 (08:04 +0000)
committerJeff Law <law@redhat.com>
Tue, 22 Aug 1995 08:04:15 +0000 (08:04 +0000)
problems than it fixes.
* hppa-tdep.c (skip_prologue): If we exit the main loop without
finding all the register saves, retry again without looking for
the registers we could not find the first time.

Better fix for 7768.

gdb/ChangeLog
gdb/config/pa/tm-hppa.h
gdb/hppa-tdep.c

index 2e243b1665d080a331428940b73d2705c46b513e..44740bb8c4ab2c6f98586e0de7b29b27631f70a5 100644 (file)
@@ -1,3 +1,11 @@
+Tue Aug 22 02:00:47 1995  Jeff Law  (law@snake.cs.utah.edu)
+
+       * tm-hppa.h (PROLOGUE_FIRSTLINE_OVERLAP): Delete.  Causes more
+       problems than it fixes.
+       * hppa-tdep.c (skip_prologue): If we exit the main loop without
+       finding all the register saves, retry again without looking for
+       the registers we could not find the first time.
+
 Mon Aug 21 23:39:56 1995  Jeff Law  (law@snake.cs.utah.edu)
 
        * hppa-tdep.c (frame_chain_valid): Handle systems where "$START$"
index 0e1c104ee24d37ddb12fbdc8f48b2cc809a5ff00..142d8b34d56412bb2ad4baf90aaf4b8fb4bc2b9e 100644 (file)
@@ -620,10 +620,3 @@ extern CORE_ADDR skip_trampoline_code PARAMS ((CORE_ADDR, char *));
 #define HPREAD_ADJUST_STACK_ADDRESS(ADDR) hpread_adjust_stack_address(ADDR)
 
 extern int hpread_adjust_stack_address PARAMS ((CORE_ADDR));
-
-/* When prologues are scheduled, the first line of the function may
-   overlap with prologue instructions.  We want to avoid "skipping"
-   to the start of the next source line in such situations (might
-   skip over a conditional branch when trying to set a breakpoint at
-   the start of a function.  */
-#define PROLOGUE_FIRSTLINE_OVERLAP
index 4735baa2818583c15bfacda8af008fd2f711bfec..3addc58ed916951fc7cd07d6b7e3a12ec6b91769 100644 (file)
@@ -2288,10 +2288,15 @@ skip_prologue (pc)
      CORE_ADDR pc;
 {
   char buf[4];
+  CORE_ADDR orig_pc = pc;
   unsigned long inst, stack_remaining, save_gr, save_fr, save_rp, save_sp;
-  unsigned long args_stored, status, i;
+  unsigned long args_stored, status, i, restart_gr, restart_fr;
   struct unwind_table_entry *u;
 
+  restart_gr = 0;
+  restart_fr = 0;
+
+restart:
   u = find_unwind_entry (pc);
   if (!u)
     return pc;
@@ -2322,11 +2327,13 @@ skip_prologue (pc)
 
       save_gr |= (1 << i);
     }
+  save_gr &= ~restart_gr;
 
   /* Turn the Entry_FR field into a bitmask too.  */
   save_fr = 0;
   for (i = 12; i < u->Entry_FR + 12; i++)
     save_fr |= (1 << i);
+  save_fr &= ~restart_fr;
 
   /* Loop until we find everything of interest or hit a branch.
 
@@ -2476,6 +2483,22 @@ skip_prologue (pc)
       pc += 4;
     }
 
+  /* We've got a tenative location for the end of the prologue.  However
+     because of limitations in the unwind descriptor mechanism we may
+     have went too far into user code looking for the save of a register
+     that does not exist.  So, if there registers we expected to be saved
+     but never were, mask them out and restart.
+
+     This should only happen in optimized code, and should be very rare.  */
+  if (save_gr || save_fr
+      && ! (restart_fr || restart_gr))
+    {
+      pc = orig_pc;
+      restart_gr = save_gr;
+      restart_fr = save_fr;
+      goto restart;
+    }
+
   return pc;
 }