From: Kevin Buettner <kevinb@cygnus.com>
To: gdb-patches@sources.redhat.com
Cc: Trond Eivind Glomsrød <teg@redhat.com>
Subject: [PATCH] ia64-tdep.c: Only warn about slot numbers > 2
Date: Wed, 21 Mar 2001 18:34:00 -0000 [thread overview]
Message-ID: <1010322023410.ZM13601@ocotillo.lan> (raw)
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;
next reply other threads:[~2001-03-21 18:34 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-03-21 18:34 Kevin Buettner [this message]
[not found] ` <3ABA1EEE.3B6DC6E9@cygnus.com>
2001-03-22 8:35 ` Kevin Buettner
2001-03-22 18:09 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1010322023410.ZM13601@ocotillo.lan \
--to=kevinb@cygnus.com \
--cc=gdb-patches@sources.redhat.com \
--cc=teg@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox