public inbox for gcc-prs@sourceware.org
help / color / mirror / Atom feed
* libgcj/1187: GDB java problems: constructors and 'ptype'
@ 2000-12-20 12:22 bryce
  0 siblings, 0 replies; only message in thread
From: bryce @ 2000-12-20 12:22 UTC (permalink / raw)
  To: java-gnats

>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:



^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-20 12:22 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-20 12:22 libgcj/1187: GDB java problems: constructors and 'ptype' bryce

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).