Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Tom Tromey <tromey@redhat.com>
Cc: Gdb List <gdb@sources.redhat.com>
Subject: Re: confusion in the `b' command
Date: Sun, 12 May 2002 19:22:00 -0000	[thread overview]
Message-ID: <20020513022220.GA19482@nevyn.them.org> (raw)
In-Reply-To: <87d6wrmsdt.fsf@creche.redhat.com>

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<TAB>
> 
> 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'<TAB> or 'x.main'<ESC-?>
>     (Note leading single quote.)
> 
> Now try again:
> 
>     b 'x.main<TAB>
> 
> 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<TAB>" 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


      parent reply	other threads:[~2002-05-13  2:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-04-22 12:37 Tom Tromey
2002-04-22 13:13 ` Eli Zaretskii
2002-04-22 13:38   ` Tom Tromey
2002-04-22 22:58     ` Eli Zaretskii
2002-05-12 19:22 ` Daniel Jacobowitz [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=20020513022220.GA19482@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=gdb@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