First Last Prev Next    No search results available      Search page      Enter new bug
Bug#: 16439
Product:  
Component:  
Status: NEW
Resolution:
Assigned To: Not yet assigned to anyone <unassigned@gcc.gnu.org>
Host:
Reported against  
Priority:  
Severity:  
Target Milestone:  
 
 
Target:
Reporter: Jeff Johnston <jjohnstn@redhat.com>
Add CC:
CC:
Remove selected CCs
Build:
URL:
Summary:
Keywords:
Known to work:
Known to fail:

Attachment Description Type Created Size Actions
jmain.java jmain.java text/plain 2004-07-08 18:14 82 bytes Edit
Create a New Attachment (proposed patch, testcase, etc.) View All

Bug 16439 depends on: Show dependency tree
Show dependency graph
Bug 16439 blocks:

Additional Comments:





Mark bug as waiting for feedback
Mark bug as suspended




View Bug Activity   |   Format For Printing   |   Clone This Bug


Description:   Last confirmed: 2006-02-20 18:45 Opened: 2004-07-08 18:11
For the following test case in the gdb testsuite: jmain.java

public class jmain
{
  public static void main (String[] args)
    {
        return;
    }
}

The breakpoint for main ends up being line 4 (the open brace) instead of line 5.
 This does not match the C/C++ behavior which is to point to the first statement
of the member function.  Gdb gets the line number info from the compiler which
is the following tailed output from readelf -wl

 Line Number Statements:
  Extended opcode 2: set Address to 0x8048868
  Special opcode 8: advance Address by 0 to 0x8048868 and Line by 3 to 4
  Special opcode 89: advance Address by 6 to 0x804886e and Line by 0 to 4
  Special opcode 175: advance Address by 12 to 0x804887a and Line by 2 to 6
  Special opcode 28: advance Address by 2 to 0x804887c and Line by -5 to 1
  Special opcode 89: advance Address by 6 to 0x8048882 and Line by 0 to 1
  Advance PC by 14 to 8048890
  Extended opcode 1: End of Sequence

------- Comment #1 From Jeff Johnston 2004-07-08 18:14 -------
Created an attachment (id=6712) [edit]
jmain.java

------- Comment #2 From Bryce McKinlay 2004-07-23 02:07 -------
This occurs for "static" and maybe "synchronized" methods. What happens is gcj
inserts some prologue code to check the class initialization status (in the case
of a static method), or in the case of a synchronized method, to aquire the
lock. The line number it uses for the inserted prologue code is that of the
current parser context when starting the method, which points to the method's
opening brace ("{").

It could be changed to instead look for the first non-synthetic code in the
method and use the line number from that.

------- Comment #3 From Andrew Pinski 2005-11-23 04:14 -------
Reconfirm (it is a little easlier to see with the tree dumps):
jmain.main(java.lang.String[]) (args)
{
  [jmain.java : 4] _Jv_InitClass (&jmain.class);
  [jmain.java : 4] {
    [jmain.java : 5] return;
  }
}

First Last Prev Next    No search results available      Search page      Enter new bug