This is the mail archive of the
gdb-prs@sourceware.org
mailing list for the GDB project.
[Bug rust/20239] NonZero-optimized enums don't print properly
- From: "tromey at sourceware dot org" <sourceware-bugzilla at sourceware dot org>
- To: gdb-prs at sourceware dot org
- Date: Mon, 20 Jun 2016 14:09:53 +0000
- Subject: [Bug rust/20239] NonZero-optimized enums don't print properly
- Auto-submitted: auto-generated
- References: <bug-20239-4717 at http dot sourceware dot org/bugzilla/>
https://sourceware.org/bugzilla/show_bug.cgi?id=20239
--- Comment #4 from Tom Tromey <tromey at sourceware dot org> ---
gdb bugzilla doesn't have splinter, so it's a pain to review here.
For the next revision I suggest email to gdb-patches; see
https://sourceware.org/gdb/wiki/ContributionChecklist
It's fine to CC me. Alternatively if you don't want to bother with
all of this stuff, I can take over.
Anyway, I'll just mention a few things here.
First, no ChangeLog entries. See the instructions.
Patch nits:
> char* type_name, field_name;
This gives field_name the wrong type; I'm a bit surprised this compiled.
> name = xstrdup (TYPE_FIELD_NAME (type, 0));
> cleanup = make_cleanup (xfree, name);
I don't think there's a need to copy the field name.
> while ((token = strsep (&tail, "$")) != NULL) {
GNU style puts the brace on the next line, indented 2 more spaces.
There's a long section in the GNU standards manual about this; or
just look at existing code.
There's a few instances of this.
> 1+1;
Weird :)
char* zero_field = strrchr (TYPE_FIELD_NAME (type, 0), '$');
In GNU style there's a space before the "*", like "char *zero_field = ".
> gdb_test "print str_some" \
> " = core::option::Option<collections::string::String>::Some\\(collections::string::String .*"
The second line here should be indented.
Also I wonder if it's worth having an even more complicated test?
--
You are receiving this mail because:
You are on the CC list for the bug.