Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Michael Snyder <msnyder@redhat.com>
To: tromey@redhat.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: Patch: printing java `char' values
Date: Thu, 09 May 2002 11:09:00 -0000	[thread overview]
Message-ID: <3CDAB84E.E6311EC@redhat.com> (raw)
In-Reply-To: <87661ykl5c.fsf@creche.redhat.com>

Tom Tromey wrote:
> 
> >>>>> "Michael" == Michael Snyder <msnyder@redhat.com> writes:
> 
> Michael> Yes, that's the idea.  I wouldn't even bother with the temp
> Michael> variable-- I would just call TYPE_CODE (type) twice.  It's a
> Michael> macro, and not expensive to evaluate.  Then you don't need
> Michael> the brackets.
> 
> Ok.  I've made this change and another one suggested by Andrew Cagney
> privately.
> 
> Is this one ok to commit?
> 
> Tom

Looks good -- commit away.

> 
> Index: ChangeLog
> from  Tom Tromey  <tromey@redhat.com>
> 
>         * jv-valprint.c (java_val_print): Handle `char' as a special case
>         of TYPE_CODE_INT.
> 
> Index: jv-valprint.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/jv-valprint.c,v
> retrieving revision 1.9
> diff -u -r1.9 jv-valprint.c
> --- jv-valprint.c 21 Oct 2001 01:57:42 -0000 1.9
> +++ jv-valprint.c 9 May 2002 04:05:49 -0000
> @@ -497,18 +498,17 @@
>        return i;
> 
>      case TYPE_CODE_CHAR:
> -      format = format ? format : output_format;
> -      if (format)
> -       print_scalar_formatted (valaddr, type, format, 0, stream);
> -      else
> -       LA_PRINT_CHAR ((int) unpack_long (type, valaddr), stream);
> -      break;
> -
>      case TYPE_CODE_INT:
> -      /* Can't just call c_val_print because that print bytes as C chars. */
> +      /* Can't just call c_val_print because that prints bytes as C
> +        chars.  */
>        format = format ? format : output_format;
>        if (format)
>         print_scalar_formatted (valaddr, type, format, 0, stream);
> +      else if (TYPE_CODE (type) == TYPE_CODE_CHAR
> +              || (TYPE_CODE (type) == TYPE_CODE_INT
> +                  && TYPE_LENGTH (type) == 2
> +                  && strcmp (TYPE_NAME (type), "char") == 0))
> +       LA_PRINT_CHAR ((int) unpack_long (type, valaddr), stream);
>        else
>         val_print_type_code_int (type, valaddr, stream);
>        break;


      reply	other threads:[~2002-05-09 18:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-05-06 10:11 Tom Tromey
2002-05-06 17:05 ` Michael Snyder
2002-05-07 13:29   ` Tom Tromey
2002-05-07 15:45     ` Andrew Cagney
2002-05-07 13:43 ` Daniel Jacobowitz
2002-05-07 14:22 ` Michael Snyder
2002-05-07 14:35   ` Tom Tromey
2002-05-08 12:12     ` Michael Snyder
2002-05-08 12:47       ` Daniel Jacobowitz
2002-05-08 13:32         ` Tom Tromey
2002-05-08 13:46           ` Daniel Jacobowitz
2002-05-08 14:10             ` Michael Snyder
2002-05-08 14:20               ` Daniel Jacobowitz
2002-05-08 15:39                 ` Michael Snyder
2002-05-08 15:42       ` Tom Tromey
2002-05-08 16:52         ` Michael Snyder
2002-05-08 21:09           ` Tom Tromey
2002-05-09 11:09             ` Michael Snyder [this message]

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=3CDAB84E.E6311EC@redhat.com \
    --to=msnyder@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=tromey@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