* ia64-tdep.c (fetch_instruction): Warn about slot numbers greater
authorKevin Buettner <kevinb@redhat.com>
Thu, 22 Mar 2001 02:11:11 +0000 (02:11 +0000)
committerKevin Buettner <kevinb@redhat.com>
Thu, 22 Mar 2001 02:11:11 +0000 (02:11 +0000)
than two instead of generating an error.

gdb/ChangeLog
gdb/ia64-tdep.c

index 3e7846d500d9677f90280d79a9503d0466ff4eeb..702d180fd0d63c5f702d1105ef370dd59e3fc2af 100644 (file)
@@ -1,3 +1,8 @@
+2001-03-21  Kevin Buettner  <kevinb@redhat.com>
+
+       * ia64-tdep.c (fetch_instruction): Warn about slot numbers greater
+       than two instead of generating an error.
+       
 2001-03-21  Jim Blandy  <jimb@redhat.com>
 
        * cp-valprint.c: Reformat to bring into line with GNU coding
index 5efd58a92a54b6afa9daf051b39c3dea38fe8989..e46c4b46fb071b3ed7f02997c8aa3e93f4f77307 100644 (file)
@@ -492,8 +492,25 @@ fetch_instruction (CORE_ADDR addr, instruction_type *it, long long *instr)
   long long template;
   int val;
 
+  /* Warn about slot numbers greater than 2.  We used to generate
+     an error here on the assumption that the user entered an invalid
+     address.  But, sometimes GDB itself requests an invalid address.
+     This can (easily) happen when execution stops in a function for
+     which there are no symbols.  The prologue scanner will attempt to
+     find the beginning of the function - if the nearest symbol
+     happens to not be aligned on a bundle boundary (16 bytes), the
+     resulting starting address will cause GDB to think that the slot
+     number is too large.
+
+     So we warn about it and set the slot number to zero.  It is
+     not necessarily a fatal condition, particularly if debugging
+     at the assembly language level.  */
   if (slotnum > 2)
-    error("Can't fetch instructions for slot numbers greater than 2.");
+    {
+      warning ("Can't fetch instructions for slot numbers greater than 2.\n"
+              "Using slot 0 instead");
+      slotnum = 0;
+    }
 
   addr &= ~0x0f;
 
This page took 0.032726 seconds and 4 git commands to generate.