This is the mail archive of the
gdb-prs@sources.redhat.com
mailing list for the GDB project.
Re: java/1039: regression: cannot set breakpoint on jmisc.main(java.lang.String[])
- From: Tom Tromey <tromey at redhat dot com>
- To: nobody at sources dot redhat dot com
- Cc: gdb-prs at sources dot redhat dot com,
- Date: 1 Mar 2003 00:08:00 -0000
- Subject: Re: java/1039: regression: cannot set breakpoint on jmisc.main(java.lang.String[])
- Reply-to: Tom Tromey <tromey at redhat dot com>
The following reply was made to PR java/1039; it has been noted by GNATS.
From: Tom Tromey <tromey at redhat dot com>
To: David Carlton <carlton at math dot stanford dot edu>
Cc: gdb-gnats at sources dot redhat dot com
Subject: Re: java/1039: regression: cannot set breakpoint on jmisc.main(java.lang.String[])
Date: 28 Feb 2003 16:51:03 -0700
>>>>> "David" == David Carlton <carlton at math dot stanford dot edu> writes:
David> I'm using gcj 2.95.3.
FYI, probably no serious gcj users use this version. It is way too
old.
Setting a breakpoint on a class' main hasn't worked for me for a long
time. Naturally, I'm always using a fairly recent gcj. In this
example, I'm using the appended code, gcj 3.3, and a fairly recent
(less than a month old) cvs trunk gdb.
fleche. gcj -c -g HelloWorld.java
fleche. gcj -g --main=HelloWorld -o H HelloWorld.o
fleche. ~/gnu/baseline-gdb/install/bin/gdb ./H
GNU gdb 2003-02-21-cvs
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) b HelloWorld.main
the class HelloWorld does not have any method named main
Hint: try 'HelloWorld.main<TAB> or 'HelloWorld.main<ESC-?>
(Note leading single quote.)
In the past I had some formula for making this work (I brought it up
on the gdb list once last year), but I've since forgotten it. I
couldn't figure out how to get a breakpoint set there.
Tom
/*
* HelloWorld.java
*
* Expected Output: "Hello World!"
*/
public class HelloWorld {
public static void main (String[] args) {
System.out.println("Hello World!");
}
}