From: Tom Tromey <tom@tromey.com>
To: Pedro Alves <palves@redhat.com>
Cc: Tom Tromey <tom@tromey.com>, gdb-patches@sourceware.org
Subject: Re: [PATCH 6/8] Add support for the Rust language
Date: Wed, 27 Apr 2016 18:27:00 -0000 [thread overview]
Message-ID: <87y47yc3ge.fsf@tromey.com> (raw)
In-Reply-To: <5720A5E4.2020603@redhat.com> (Pedro Alves's message of "Wed, 27 Apr 2016 12:43:32 +0100")
>> + /* Rust does not currently emit DW_LANG_Rust or DW_LANG_Rust_old.
Pedro> "Currently" is a moving target. Could you replace it with some
Pedro> version number or some such?
Yeah, good idea. Eli suggested something similar in the docs as well.
It turns out that the patch to drop DW_LANG_Rust didn't go in yet, since
it causes an assertion failure in LLVM. This will probably shake out
before the copyright assignments are done anyway.
>> +#define RUSTDEBUG 1 /* Default to debug support */
Pedro> Is this referenced anywhere, or a leftoever from when this used
Pedro> the bison prefix support?
Just a leftover.
>> + /* We treat this differently than Ada. */
Pedro> What does "differently" mean?
I removed this comment, but basically Rust reuses the OP_AGGREGATE name,
but not the layout in the expression structure. This seems weird, but
it was handy, and it's already done elsewhere in gdb.
Pedro> Similar to the Fortran opcode, did you think about promoting
Pedro> OP_AGGREGATE out of ada-operator.def ?
Nope! There's no big difference between std-operator.def and
ada-operator.def now... just maybe whether op_name_standard handles the
operator or not.
>> + if (TYPE_CODE (type) == TYPE_CODE_NAMESPACE)
>> + goto got_ns;
Pedro> This goto will probably need to go away with C++-ification.
Pedro> Maybe the got_ns label label could be a helper function, called here,
Pedro> and where it is currently defined. However, other .y files use
Pedro> gotos as well, so guess it shouldn't be a requirement.
I rearranged this a bit to avoid the goto.
>> +
>> +/* The parser error handler. */
>> +
>> +void
>> +rustyyerror (char *msg)
>> +{
>> + const char *where = prev_lexptr ? prev_lexptr : lexptr;
>> + error (_("A %s in expression, near `%s'."), (msg ? msg : "error"), where);
Pedro> _("error"), I suppose. I note this expands to the non-grammatical "A error".
Pedro> Maybe reword to avoid it? Maybe drop the "A" ?
I dropped the "A". I actually copied this function from c-exp.y. Maybe
this is another wart -- every .y has to implement this function but it
seems to me that there's no great reason for it.
>> +static struct disr_info
>> +rust_get_disr_info (struct type *type, const gdb_byte *valaddr,
Pedro> Did you mean to name these discr_info and rust_get_discr_info ?
Pedro> I mean, the missing 'c'.
Manish wrote this part -- but not to blame him, this actually mirrors
what is done in the Rust compiler. I don't know why that abbreviation
was chosen by Rust. However, it is visible in the debuginfo, as enum
discriminants can be named "RUST$ENUM$DISR".
Tom
next prev parent reply other threads:[~2016-04-27 18:27 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-04-27 2:50 [PATCH 0/8] Add Rust language support Tom Tromey
2016-04-27 2:50 ` [PATCH 4/8] Add self-test framework to gdb Tom Tromey
2016-04-27 11:40 ` Pedro Alves
2016-04-27 17:58 ` Tom Tromey
2016-04-27 2:50 ` [PATCH 7/8] Update gdb test suite for Rust Tom Tromey
2016-04-27 11:44 ` Pedro Alves
2016-04-27 2:50 ` [PATCH 1/8] Add DW_LANG_Rust and DW_LANG_Rust_old Tom Tromey
2016-04-27 11:44 ` Pedro Alves
2016-04-27 2:50 ` [PATCH 5/8] Add array start and end strings to generic_val_print_decorations Tom Tromey
2016-04-27 11:40 ` Pedro Alves
2016-04-27 2:50 ` [PATCH 3/8] Make gdb expression debugging handle OP_F90_RANGE Tom Tromey
2016-04-27 11:38 ` Pedro Alves
2016-04-27 2:50 ` [PATCH 2/8] Fix latent yacc-related bug in gdb/Makefile.in init.c rule Tom Tromey
2016-04-27 11:38 ` Pedro Alves
2016-04-27 2:50 ` [PATCH 6/8] Add support for the Rust language Tom Tromey
2016-04-27 11:43 ` Pedro Alves
2016-04-27 11:49 ` Pedro Alves
2016-04-27 18:27 ` Tom Tromey [this message]
2016-04-27 18:36 ` Pedro Alves
2016-04-27 19:52 ` Tom Tromey
2016-04-27 2:50 ` [PATCH 8/8] Add Rust documentation Tom Tromey
2016-04-27 7:10 ` Eli Zaretskii
2016-04-27 11:47 ` [PATCH 0/8] Add Rust language support Pedro Alves
2016-04-27 16:22 ` Tom Tromey
2016-04-27 18:23 ` Pedro Alves
2016-04-27 21:56 ` Pedro Alves
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=87y47yc3ge.fsf@tromey.com \
--to=tom@tromey.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