This is the mail archive of the
gcc-prs@gcc.gnu.org
mailing list for the GCC project.
libgcj/1187: GDB java problems: constructors and 'ptype'
- To: java-gnats at sourceware dot cygnus dot com
- Subject: libgcj/1187: GDB java problems: constructors and 'ptype'
- From: bryce at albatross dot co dot nz
- Date: 26 Apr 2000 23:46:26 -0000
- Reply-To: bryce at albatross dot co dot nz
>Number: 1187
>Category: libgcj
>Synopsis: GDB java problems: constructors and 'ptype'
>Confidential: no
>Severity: serious
>Priority: medium
>Responsible: green
>State: closed
>Class: sw-bug
>Submitter-Id: net
>Arrival-Date: Wed Dec 20 12:17:17 PST 2000
>Closed-Date: Tue Oct 17 21:35:18 PDT 2000
>Last-Modified: Tue Oct 17 21:40:00 PDT 2000
>Originator: Bryce McKinlay
>Release: unknown-1.0
>Organization:
>Environment:
gcj 20000422 and gdb 20000423
>Description:
GDB has various annoying glitches when debugging java code.
Here is a couple that I tracked down.
Given the following code:
public class TestGDB
{
String str1 = "some string";
public static void main(String args[])
{
new TestGDB();
}
public TestGDB ()
{
int a = 6;
System.out.println(a);
}
}
One can successfully run gdb and put a breakpoint on the
constructor for "TestGDB" using "b TestGDB.TestGDB". However,
ptype doesn't work:
(gdb) ptype TestGDB
type = <unknown type>
Now, comment out the field "str1" and recompile the example.
Suddenly, ptype works:
(gdb) ptype TestGDB
type = class TestGDB extends java.lang.Object {
void main(java.lang.String[]);
void <init>(void);
}
But the constructor "TestGDB" is missing from the type info,
and we cant set a breakpoint on it either:
(gdb) b TestGDB.TestGDB
the class TestGDB does not have any method named TestGDB
Hint: try 'TestGDB.TestGDB<TAB> or 'TestGDB.TestGDB<ESC-?>
(Note leading single quote.)
>How-To-Repeat:
>Fix:
>Release-Note:
>Audit-Trail:
Formerly PR gdb/217
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Tue Oct 17 21:35:18 2000
State-Changed-Why:
This was the "$finit" bug that was fixed a while ago. The
bug does not occur with a recent compiler and gdb 5.0.
From: bryce@albatross.co.nz
To: bryce@albatross.co.nz, green@cygnus.com, java-gnats@sourceware.cygnus.com
Cc:
Subject: Re: gdb/217
Date: 18 Oct 2000 04:35:18 -0000
Synopsis: GDB java problems: constructors and 'ptype'
State-Changed-From-To: open->closed
State-Changed-By: bryce
State-Changed-When: Tue Oct 17 21:35:18 2000
State-Changed-Why:
This was the "$finit" bug that was fixed a while ago. The
bug does not occur with a recent compiler and gdb 5.0.
http://sources.redhat.com/cgi-bin/gnatsweb.pl?cmd=view&pr=217&database=java
>Unformatted: