From: Sergio Durigan Junior <sergiodj@redhat.com>
To: Tom Tromey <tom@tromey.com>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Don't crash if dwarf_decode_macro_bytes's 'body' is NULL
Date: Tue, 14 May 2019 23:36:00 -0000 [thread overview]
Message-ID: <87wois4nhr.fsf@redhat.com> (raw)
In-Reply-To: <871s108z6j.fsf@tromey.com> (Tom Tromey's message of "Tue, 14 May 2019 16:10:44 -0600")
On Tuesday, May 14 2019, Tom Tromey wrote:
>>>>>> "Sergio" == Sergio Durigan Junior <sergiodj@redhat.com> writes:
>
> Sergio> OK for master?
>
> Sergio> gdb/ChangeLog:
> Sergio> 2019-05-14 Sergio Durigan Junior <sergiodj@redhat.com>
>
> Sergio> Ref.: https://bugzilla.redhat.com/show_bug.cgi?id=1708192
> Sergio> * dwarf2read.c (dwarf_decode_macro_bytes): Check whether 'body' is
> Sergio> NULL, and complain if that's the case.
>
> Sergio> + complaint (_("debug info gives %s invalid macro definition "
> Sergio> + "without body (corrupted?) at line %d"),
> Sergio> + at_commandline ? _("command-line")
> Sergio> + : _("in-file"),
> Sergio> + line == 0 ? _("zero") : _("non-zero"), line);
>
> This seems weird since it doesn't use current_file, and if I'm reading
> correctly, there are 3 arguments but only 2 % substitutions. The
> compiler should catch the latter, so that's doubly strange. I think for
> a complaint it's fine to emit a line==0 or whatever, mostly it's for
> helping to track down the incorrect spot.
Sorry, you're right, I left one extra argument there. I was testing the
patch on a VM, where I had everything correct, but then I made some
extra adjustments and forgot to remove the extra "line == 0 ? _("zero")
: _("non-zero")".
As for the filename, I was following what other complaints were doing.
But I also agree that having a filename would be best. What do you
think of:
complaint (_("debug info gives %s invalid macro definition "
"without body (corrupted?) at line %d"
"on file %s"),
at_commandline ? _("command-line")
: _("in-file"),
line, current_file->filename);
?
Thanks,
--
Sergio
GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36
Please send encrypted e-mail if possible
http://sergiodj.net/
next prev parent reply other threads:[~2019-05-14 23:36 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-10 21:04 [PATCH] Don't crash if parse_definition_macro's " Sergio Durigan Junior
2019-05-13 14:01 ` Tom Tromey
2019-05-14 20:54 ` Sergio Durigan Junior
2019-05-14 20:55 ` [PATCH] Don't crash if dwarf_decode_macro_bytes's " Sergio Durigan Junior
2019-05-14 22:10 ` Tom Tromey
2019-05-14 23:36 ` Sergio Durigan Junior [this message]
2019-05-15 1:38 ` Tom Tromey
2019-05-15 8:49 ` Andreas Schwab
2019-05-15 13:53 ` Tom Tromey
2019-05-15 13:59 ` Sergio Durigan Junior
2019-05-29 14:43 ` [PATCH] Don't crash is dwarf_decode_macro_bytes's 'body' is NULL, even when '!is_define' Sergio Durigan Junior
2019-05-29 15:55 ` Tom Tromey
2019-05-29 20:16 ` Sergio Durigan Junior
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=87wois4nhr.fsf@redhat.com \
--to=sergiodj@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tom@tromey.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