This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug rust/20239] NonZero-optimized enums don't print properly


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]