Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] ia64-tdep.c: Only warn about slot numbers > 2
@ 2001-03-21 18:34 Kevin Buettner
       [not found] ` <3ABA1EEE.3B6DC6E9@cygnus.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Kevin Buettner @ 2001-03-21 18:34 UTC (permalink / raw)
  To: gdb-patches; +Cc: Trond Eivind Glomsrød

I've just committed the changes below.

This patch addresses the concerns raised in the following bug report:

    https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=32544

In particular, GDB doesn't segfault anymore.  A warning message
regarding slot numbers that are greater than zero is still printed,
but IMO, it is better to print these to alert the user that something
may wrong...

	* ia64-tdep.c (fetch_instruction): Warn about slot numbers greater
	than two instead of generating an error.

Index: ia64-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/ia64-tdep.c,v
retrieving revision 1.15
diff -u -p -r1.15 ia64-tdep.c
--- ia64-tdep.c	2001/03/01 01:39:21	1.15
+++ ia64-tdep.c	2001/03/22 01:55:48
@@ -492,8 +492,25 @@ fetch_instruction (CORE_ADDR addr, 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;
 


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-03-22 18:09 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-21 18:34 [PATCH] ia64-tdep.c: Only warn about slot numbers > 2 Kevin Buettner
     [not found] ` <3ABA1EEE.3B6DC6E9@cygnus.com>
2001-03-22  8:35   ` Kevin Buettner
2001-03-22 18:09     ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox