Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Manish Goregaokar <manish@mozilla.com>
Cc: gdb-patches@sourceware.org,  Tom Tromey <tom@tromey.com>
Subject: Re: [PATCH 1/2][PR gdb/20239] Make evaluation and type-printing of all NonZero-optimized enums work
Date: Wed, 22 Jun 2016 19:10:00 -0000	[thread overview]
Message-ID: <87vb11jazw.fsf@tromey.com> (raw)
In-Reply-To: <CAFOnWknif9WwaRdDYzxx8ngNJBwgfN24w02KGPVnYA6-VtMcUg@mail.gmail.com>	(Manish Goregaokar's message of "Tue, 21 Jun 2016 15:10:28 +0530")

>>>>> "Manish" == Manish Goregaokar <manish@mozilla.com> writes:

Manish> Regarding the xstrdup, this is done because strsep edits the string
Manish> itself.

Indeed it does.  Somehow I didn't realize this, sorry about that.

Manish> Methods tests fail, but they are
Manish> a preexisting failure due to Rust's debuginfo changing.

Yes, the situation with 1.9 is not that good :(


This patch looks good.  There are formatting nits but really nothing serious.

The normal procedure is that once you've written one good patch you can
get write-after-approval access to gdb.  If you want to go this route,
let me know.  Otherwise (and also let me know) I can push the final
patches for you.

Manish> +         char *type_name;

I think this is assigned to but not used, so you might as well remove
it.

Manish> +      /* Optimized enums have only one field */

gdb style is period with two spaces at the end of a comment.

Manish> +      while ((token = strsep (&tail, "$")) != NULL)
Manish> +      {

The "{" should be indented 2 more spaces, and then the body as well.

Manish> +         if (sscanf (token, "%lu", &fieldno) != 1)
Manish> +         {

Here too.

Manish> +            /* We have reached the enum name, which cannot start with a digit */

The period thing again.  Also this line might be too long.

Manish> +      };

Extra ";".

Manish> +        value = unpack_long (member_type,
Manish> +           valaddr + embedded_offset);

Make sure the continuation line is indented to line up under "member_type".
(Maybe it is but I can't tell ...)

Manish>      int i, len = 0;
Manish> +  int skip_to = 1; /* Skip the discriminant field */

Indentation?  Also gdb doesn't tend to use trailing comments like that;
you can put it before the declaration.

Manish> +    char *zero_field = strrchr (TYPE_FIELD_NAME (type, 0), '$');

const char *

Manish> +    if (zero_field != NULL && strlen (zero_field) > 1) {

"{" on the next line and indented.

Manish> +      fprintfi_filtered (level+2, stream, "%s,\n", zero_field+1);

Spaces around "+"s.

Manish> +      /* there is no explicit discriminant field, skip nothing */

Upper case "There", period.

Manish> -        int first = 1;
Manish> +    int first = 1;

Some spurious change maybe?

Tom


       reply	other threads:[~2016-06-22 19:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAFOnWknif9WwaRdDYzxx8ngNJBwgfN24w02KGPVnYA6-VtMcUg@mail.gmail.com>
2016-06-22 19:10 ` Tom Tromey [this message]
2016-06-25  6:00 ` Manish Goregaokar
2016-06-29  8:55   ` Thomas Preudhomme
2016-06-29  8:58     ` Manish Goregaokar
2016-06-29  9:15       ` Thomas Preudhomme
2016-06-29  9:17         ` Manish Goregaokar
2016-06-29  9:19           ` Thomas Preudhomme
2016-06-29  9:41       ` 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=87vb11jazw.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gdb-patches@sourceware.org \
    --cc=manish@mozilla.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