From: Joost van der Sluis <joost@cnoc.nl>
To: Joel Brobecker <brobecker@adacore.com>
Cc: gdb@sourceware.org
Subject: Re: Crash of Archer's gdb on mingw (passing null argument to vasprintf)
Date: Mon, 03 Oct 2011 16:17:00 -0000 [thread overview]
Message-ID: <1317658598.28003.48.camel@feddie.cnoc.lan> (raw)
In-Reply-To: <20111003145904.GK27340@adacore.com>
[-- Attachment #1: Type: text/plain, Size: 808 bytes --]
On Mon, 2011-10-03 at 07:59 -0700, Joel Brobecker wrote:
> > In gdbtypes.c there's this code:
> >
> > warning (_("Range for type %s has invalid bounds %s..%s"),
> > TYPE_NAME (type), plongest (TYPE_LOW_BOUND (range_type)),
> > plongest (TYPE_HIGH_BOUND (range_type)));
> >
> > This goes wrong when TYPE_NAME (type) is null.
>
> We should several example of us handling this type of situation.
> Typically we use:
>
> TYPE_NAME (type) ? TYPE_NAME (type) : "<anonymous>"
I've found the TYPE_ERROR_NAME macro. Now another question: how do I
send a patch for inclusion in gdb? Can I send it to this list? Or
gdb-patches?
btw: patch is attached. First part will only apply to Archer though. (My
guess is the archer-jankratochvil-vla branch)
Regards,
Joost van der Slui
[-- Attachment #2: TYPE_NAME_fix.diff --]
[-- Type: text/x-patch, Size: 998 bytes --]
--- a/gdb/gdbtypes.c
+++ b/gdb/gdbtypes.c
@@ -1527,7 +1544,7 @@ type_length_get (struct type *type, struct type *target_type, int full_span)
/* It may happen for wrong DWARF annotations returning garbage data. */
if (count < 0)
warning (_("Range for type %s has invalid bounds %s..%s"),
- TYPE_NAME (type), plongest (TYPE_LOW_BOUND (range_type)),
+ TYPE_ERROR_NAME (type), plongest (TYPE_LOW_BOUND (range_type)),
plongest (TYPE_HIGH_BOUND (range_type)));
/* The code below does not handle count == 0 right. */
if (count <= 0)
--- a/gdb/gnu-v3-abi.c
+++ b/gdb/gnu-v3-abi.c
@@ -319,7 +319,7 @@ gnuv3_rtti_type (struct value *value,
|| strncmp (vtable_symbol_name, "vtable for ", 11))
{
warning (_("can't find linker symbol for virtual table for `%s' value"),
- TYPE_NAME (values_type));
+ TYPE_ERROR_NAME (values_type));
if (vtable_symbol_name)
warning (_(" found `%s' instead"), vtable_symbol_name);
return NULL;
next prev parent reply other threads:[~2011-10-03 16:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-10-03 9:39 Joost van der Sluis
2011-10-03 10:07 ` Mark Kettenis
2011-10-03 14:59 ` Joel Brobecker
2011-10-03 16:17 ` Joost van der Sluis [this message]
2011-10-03 16:25 ` Joel Brobecker
2011-10-12 7:30 ` Joost van der Sluis
2011-10-03 16:35 ` Jan Kratochvil
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=1317658598.28003.48.camel@feddie.cnoc.lan \
--to=joost@cnoc.nl \
--cc=brobecker@adacore.com \
--cc=gdb@sourceware.org \
/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