From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19029 invoked by alias); 8 May 2002 20:46:29 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 19014 invoked from network); 8 May 2002 20:46:26 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 8 May 2002 20:46:26 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 175YKQ-0000hx-00; Wed, 08 May 2002 16:46:26 -0400 Date: Wed, 08 May 2002 13:46:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: Michael Snyder , gdb-patches@sources.redhat.com Subject: Re: Patch: printing java `char' values Message-ID: <20020508204626.GA2093@nevyn.them.org> Mail-Followup-To: Tom Tromey , Michael Snyder , gdb-patches@sources.redhat.com References: <877kmh8a6r.fsf@creche.redhat.com> <3CD8429E.DA6D6BC7@redhat.com> <873cx3vdhy.fsf@creche.redhat.com> <3CD9756D.F0AE4AF@redhat.com> <20020508194746.GA31548@nevyn.them.org> <878z6umkwn.fsf@creche.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <878z6umkwn.fsf@creche.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-05/txt/msg00228.txt.bz2 On Wed, May 08, 2002 at 02:42:16PM -0600, Tom Tromey wrote: > >>>>> "Daniel" == Daniel Jacobowitz writes: > > Daniel> Soemthing interesting is going on here... I'd like to know how > Daniel> it works in the stabs case. Tom, could you compile your test > Daniel> with -gstabs+ and step through the char printing code? When I > Daniel> do that, 'c' has TYPE_CODE_CHAR set anyway, even though the > Daniel> stabs reader marked it as TYPE_CODE_INT. It'd be nice to > Daniel> figure out where that magic happens. > > When I use -gstabs+ the type looks like this: > > (gdb) p *type > $1 = { > code = TYPE_CODE_CHAR, > name = 0x83e6574 "char", Yes, exactly. I'd like to figure out where that comes from. ... got it. Again, there are two definitions of char in the object file: 4 LSYM 0 0 00000000 112 char:t(0,2)=r(0,2);0;127; 37 LSYM 0 0 00000000 1088 char:t(0,2)=@s16;-20; See that -20? That's the supposedly rs6000-only (that function is no longer accurately named) character type. Amusingly, both of those have a size of one. Aren't java 'char' variables bigger than that? Another debug info problem. > length = 2, Hmm, looks like the length got corrected somehow. So, the debug info needs to be fixed to only emit the builtin types once; and then either GDB needs to decide to represent DWARF-2 char types as TYPE_CODE_CHAR also, or to support TYPE_CODE_INT characters in Java code. I've no idea which decision is better. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer