This is the mail archive of the java-prs@sourceware.cygnus.com mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gdb/217: GDB java problems: constructors and 'ptype'



>Number:         217
>Category:       gdb
>Synopsis:       GDB java problems: constructors and 'ptype'
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    green
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Apr 26 16:50:00 PDT 2000
>Closed-Date:
>Last-Modified:
>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:
>Unformatted:

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]