Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Thiago Jung Bauermann <bauerman@br.ibm.com>
Cc: Daniel Jacobowitz <drow@false.org>,
	        gdb-patches ml <gdb-patches@sourceware.org>
Subject: Re: [RFA] Add la_getstr member to language_defn
Date: Thu, 05 Feb 2009 00:55:00 -0000	[thread overview]
Message-ID: <m3tz79d7rf.fsf@fleche.redhat.com> (raw)
In-Reply-To: <1233785351.14735.56.camel@localhost.localdomain> (Thiago Jung Bauermann's message of "Wed\, 04 Feb 2009 20\:09\:11 -0200")

>>>>> "Thiago" == Thiago Jung Bauermann <bauerman@br.ibm.com> writes:

Thiago> Right. Here's the new version. It also uses c_get_string for Ada and
Thiago> minimal...

I read it a little more closely and I'm afraid I have a couple more
comments.  Mostly they are little formatting nits, nothing important.

If you agree with the more substantive comments, then I think this
patch is ok with the suggested changes -- no need for another review.
If you don't agree, let's discuss it.

Thiago> +void
Thiago> +c_get_string (struct value *value, gdb_byte **buffer, int *length,
Thiago> +	      const char **charset)
Thiago> +{
Thiago> +  int err, width;
Thiago> +  unsigned int fetchlimit;
Thiago> +  struct type *type = value_type (value);

I think this should probably use check_typedef.  Otherwise it seems
like we would not extract some strings properly.  E.g., consider a
case like "typedef char *string;" ... what will happen?

Thiago> +  else if (TYPE_CODE (value_type (value)) == TYPE_CODE_PTR)

This should use 'type' instead of calling value_type again.

Thiago> +	if (extract_unsigned_integer (contents + i*width, width) == 0)

Need spaces around the "*".

Thiago> +      /* i is now either the number of non-null characters, or fetchlimit.  */

Use "I", not "i" .. a tiny nit for the GNU style, where the value of a
variable is referred to by uppercasing the name.

Thiago> +      *length = i*width;

Spaces.

Thiago> +  /* If the last character is null, subtract it from length.  */
Thiago> +  if (extract_unsigned_integer (*buffer + *length - width, width) == 0)
Thiago> +      *length -= width;

This second line looks like it has too much indentation.

Also, I suspect this should start "if (*length > 0 &&".
Otherwise, it seems like it will read memory before *BUFFER when
*LENGTH==0.

Thiago> +error:

Emacs claims that labels are indented one space in the GNU style.
I didn't see this in the standards manual though.

Thiago> +++ b/gdb/value.h
[...]
Thiago> +extern char * type_to_string (struct type *type);

Extra space after the "*".

thanks for persevering,
Tom


  reply	other threads:[~2009-02-05  0:55 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-24 13:24 Thiago Jung Bauermann
2008-11-24 13:32 ` Daniel Jacobowitz
2008-11-24 14:59   ` Thiago Jung Bauermann
2008-11-24 16:19     ` Daniel Jacobowitz
2008-11-24 20:22       ` Thiago Jung Bauermann
2008-11-25  2:16         ` Daniel Jacobowitz
2008-11-25  8:53           ` Thiago Jung Bauermann
2009-01-03  2:27             ` Thiago Jung Bauermann
2009-02-02 18:42               ` Tom Tromey
2009-02-03 12:51                 ` Thiago Jung Bauermann
2009-02-03 17:44                   ` Tom Tromey
2009-02-04 12:37                     ` Thiago Jung Bauermann
2009-02-04 19:19                       ` Tom Tromey
2009-02-04 22:26                         ` Thiago Jung Bauermann
2009-02-05  0:55                           ` Tom Tromey [this message]
2009-02-05 12:21                             ` Thiago Jung Bauermann
2009-02-05 16:01                               ` Pierre Muller
2009-02-05 16:30                                 ` Thiago Jung Bauermann
2009-02-05 16:46                                 ` Tom Tromey
2009-02-05 15:55                           ` Tom Tromey
2009-02-05 16:07                             ` Pierre Muller
2009-02-05 16:33                               ` Thiago Jung Bauermann
2009-02-05 16:46                                 ` Tom Tromey
2009-02-03  0:23               ` Joel Brobecker
2009-02-03 13:02                 ` Thiago Jung Bauermann
2009-02-03 17:01                   ` Joel Brobecker
2009-02-03 17:40                     ` Tom Tromey
2009-02-05 17:01                     ` Thiago Jung Bauermann
2009-02-05 23:51                       ` Joel Brobecker
2008-11-24 20:03 ` Tom Tromey
2008-11-24 21:19   ` Thiago Jung Bauermann
2008-11-25  0:55     ` Tom Tromey
2008-11-25 11:27       ` Thiago Jung Bauermann

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=m3tz79d7rf.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=bauerman@br.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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