Bug 6587 - gcj generates incorrect debug output
Summary: gcj generates incorrect debug output
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: java (show other bugs)
Version: 3.3
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: wrong-debug
: 10068 (view as bug list)
Depends on:
Blocks:
 
Reported: 2002-05-06 15:36 UTC by Tom Tromey
Modified: 2006-01-15 21:14 UTC (History)
3 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2006-01-15 21:14:08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom Tromey 2002-05-06 15:36:00 UTC
Try compiling this file with "gcj -g":

public class x
{
  public static void main (String[] args)
  {
    char c = args[0].charAt(0);
    System.out.println(c);
  }
}


Using readelf you can see this:

 <2><184>: Abbrev Number: 4 (DW_TAG_subprogram)
     DW_AT_sibling     : <b4>   
     DW_AT_external    : 1      
     DW_AT_name        : x.main(java.lang.String[])     
     DW_AT_decl_file   : 1      
     DW_AT_decl_line   : 458756 
     DW_AT_MIPS_linkage_name: _ZN1x4mainEP6JArrayIPN4java4lang6StringEE 
     DW_AT_declaration : 1      

This confuses gdb.  If you try: b 'x.main', gdb will
tell you there is no such method.

Also this appears for the constructor:

 <2><1db>: Abbrev Number: 6 (DW_TAG_subprogram)
     DW_AT_external    : 1      
     DW_AT_name        : ()     
     DW_AT_MIPS_linkage_name: _ZN1xC1Ev 
     DW_AT_artificial  : 1      
     DW_AT_declaration : 1      

This is also clearly incorrect.

Release:
current trunk

Environment:
x86 Red Hat Linux 6.2
Comment 1 Dara Hazeghi 2003-05-12 12:30:37 UTC
From: Dara Hazeghi <dhazeghi@yahoo.com>
To: gcc-gnats@gcc.gnu.org
Cc:  
Subject: Re: java/6587: gcj generates incorrect debug output
Date: Mon, 12 May 2003 12:30:37 -0700

 http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit- 
 trail&database=gcc&pr=6587
 
 Hello,
 
 I can confirm this problem still exists on gcc 3.2, 3.3 branch and  
 mainline (20030511) on i686-linux.
 
 Dara
Comment 2 Andrew Pinski 2003-05-26 20:44:36 UTC
See Dara's comment.
Comment 3 Andrew Pinski 2003-07-22 13:41:40 UTC
3.3 when it was 3.2.
Comment 4 Tom Tromey 2003-11-23 19:18:45 UTC
*** Bug 10068 has been marked as a duplicate of this bug. ***