From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 32159 invoked by alias); 13 May 2002 02:22:21 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 32152 invoked from network); 13 May 2002 02:22:19 -0000 Received: from unknown (HELO nevyn.them.org) (128.2.145.6) by sources.redhat.com with SMTP; 13 May 2002 02:22:19 -0000 Received: from drow by nevyn.them.org with local (Exim 3.35 #1 (Debian)) id 1775Tg-0005FY-00; Sun, 12 May 2002 22:22:20 -0400 Date: Sun, 12 May 2002 19:22:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: Gdb List Subject: Re: confusion in the `b' command Message-ID: <20020513022220.GA19482@nevyn.them.org> Mail-Followup-To: Tom Tromey , Gdb List References: <87d6wrmsdt.fsf@creche.redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87d6wrmsdt.fsf@creche.redhat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2002-05/txt/msg00133.txt.bz2 On Mon, Apr 22, 2002 at 01:43:10PM -0600, Tom Tromey wrote: > I'm using x86 Red Hat Linux 6.2. > > Compile the appended java program (probably any program will do) like > this: > > gcj --main=x -g -o x x.java > > Now debug it with the latest cvs trunk gdb: > > gdb -nw ./x > > Now try to set a breakpoint like this: > > b 'x.main > > gdb just beeps at me. > So close the quotes and press enter: > > (gdb) b 'x.main' > the class x does not have any method named main > Hint: try 'x.main' or 'x.main' > (Note leading single quote.) > > Now try again: > > b 'x.main > > I get: > > (gdb) b 'x.main(java.lang.String[])' > > I think this must be a bug. I expected: > > * First, that TAB would work correctly the first time. > > * Second, that b 'x.main' would work anyway, since it is unambiguous. > (I only found the first bug because gdb has basically been forcing > me to hit TAB all along...) These are caused by assumptions in GDB and in the demangler that the class separator is '::' instead of '.'. Try "b 'y::main" and it will complete correctly the first time. We need to be more flexible about this. In Java mode, we probably want to recognize both separators... The second problem is related to the incorrect debug info we were discussing earlier. Witness: (top-gdb) p $32.type.core_type.type_specific.cplus_stuff.fn_fieldlists[0] $39 = {name = 0x829521b "y.main(java.lang.String[])", length = 1, fn_fields = 0x82b812c} The name of the method should be simply "main" in the debug info for the type. Not much GDB can do while that is still wrong. -- Daniel Jacobowitz Carnegie Mellon University MontaVista Software Debian GNU/Linux Developer