Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: gdb-patches@sources.redhat.com
Subject: Re: Patch: printing java `char' values
Date: Tue, 07 May 2002 13:43:00 -0000	[thread overview]
Message-ID: <20020507204334.GA30186@nevyn.them.org> (raw)
In-Reply-To: <877kmh8a6r.fsf@creche.redhat.com>

On Mon, May 06, 2002 at 11:20:44AM -0600, Tom Tromey wrote:
> Compile the appended java program with `gcj -g'.  Run gdb on it, and
> run it with the argument "abc".  Put a breakpoint on main and step
> past the assignment.  Then do `p c'.
> 
> I get:
> 
>     (gdb) p c
>     $1 = 97
> 
> This is wrong.  Debugging gdb a little, I found that in java_val_print
> we are seeint a TYPE_CODE_INT and not a TYPE_CODE_CHAR.
> 
> The appended hack fixes the problem for me.  I'm sure there is some
> better way to handle this, but I don't know what.  Why would I end up
> with a TYPE_CODE_INT here?

Hmm...

$2 = {code = TYPE_CODE_INT, name = 0x82eeb88 "char", tag_name = 0x0,
...

So there is a created type named "char" with TYPE_CODE_INT.  Where does
it come from?  It comes from the DWARF-2: the DW_TAG_base_type entry
for "char" appears twice, once marked as "signed" and once as "unsigned
char".  "signed" is an integer.

You've gotta figure out where that's coming from.  It sounds like it
might be worthwhile to spend some time reading over gcj's DWARF-2
output and trying to figure out where some of the oddities come from.

-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer


  parent reply	other threads:[~2002-05-07 20:43 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 [this message]
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

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=20020507204334.GA30186@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb-patches@sources.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