From: Martin Galvan <martin.galvan@tallertechnologies.com>
To: Pedro Alves <palves@redhat.com>
Cc: gdb-patches <gdb-patches@sourceware.org>,
Daniel Gutson <daniel.gutson@tallertechnologies.com>
Subject: Re: [PING 2][PATCH][PR gdb/19893] Fix handling of synthetic C++ references
Date: Wed, 18 May 2016 16:07:00 -0000 [thread overview]
Message-ID: <CAOKbPba43+EvKtPKDNw9hucfzp3aqn54kD-W0iNMgHO6Ft23Og@mail.gmail.com> (raw)
In-Reply-To: <54fedd9c-e207-934a-0df8-bbab519591b4@redhat.com>
On Wed, May 18, 2016 at 12:48 PM, Pedro Alves <palves@redhat.com> wrote:
> On 05/18/2016 03:47 PM, Martin Galvan wrote:
>
>> * gdb.dwarf2/implref.exp: Rename to...
>> * gdb.dwarf2/implref-const.exp: ...this.
>
> Were there changes other than renaming? Please tweak
> your git config settings to detect renames / do "git diff -M".
Yeah, there were. Will add it to the changelog.
>> +static struct value *
>> +fetch_const_value_from_synthetic_pointer (sect_offset die, LONGEST byte_offset,
> Missing intro comment, which should leave no doubt on why is the function
> named "const value", but then returns a non-const value.
I meant it was a DW_AT_const_value, which (AFAIK) isn't necessarily
represented by a const struct value in gdb.
> But you can actually remove the "result" local and call "return" directly
> in both branches.
Yeah, I just like it when functions have a single return statement.
Will change it :)
>> +# This matches e.g. '{10, 1, 2, 3, 4}'
>> +set new_contents [format {\{%d[\d,\s]+\}} ${first_value}]
>
> Why not match exactly "{10, 1, 2, 3, 4}" ?
The idea was to let the test maintainer alter the array (e.g. add
more/different elements) whenever possible without having to touch the
TCL file as well. But if it's ok to assume it won't change then I can
simplify the regex a bit.
>> + /* Else, we have a synthetic reference. Don't print '@address'; we'll
>> + show '<synthetic pointer>' instead through valprint_check_validity.
>> + Notice however that 'set print object on' will still show '@address'.
>
> Is that a bug, or desirable?
I don't think it's a bug (the address that'll be shown is the
referenced variable's, not something like 0x0). If you ask me, I think
we can just leave it as a (documented) corner case.
Thanks for the feedback!
prev parent reply other threads:[~2016-05-18 16:07 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-16 18:28 Martin Galvan
2016-05-18 10:35 ` Pedro Alves
2016-05-18 14:48 ` Martin Galvan
2016-05-18 14:54 ` Pedro Alves
2016-05-18 15:49 ` Pedro Alves
2016-05-18 16:07 ` Martin Galvan [this message]
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=CAOKbPba43+EvKtPKDNw9hucfzp3aqn54kD-W0iNMgHO6Ft23Og@mail.gmail.com \
--to=martin.galvan@tallertechnologies.com \
--cc=daniel.gutson@tallertechnologies.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@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