From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6827 invoked by alias); 15 Nov 2005 03:04:45 -0000 Received: (qmail 6805 invoked by uid 48); 15 Nov 2005 03:04:44 -0000 Date: Tue, 15 Nov 2005 03:04:00 -0000 Message-ID: <20051115030444.6804.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug java/1427] gcj should generate N_MAIN stab or DW_AT_entry_point dwarf2 debug info In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: java-prs@gcc.gnu.org From: "woodzltc at sources dot redhat dot com" Mailing-List: contact java-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: java-prs-owner@gcc.gnu.org X-SW-Source: 2005-q4/txt/msg00354.txt.bz2 List-Id: ------- Comment #18 from woodzltc at sources dot redhat dot com 2005-11-15 03:04 ------- Hi Andrew, (In reply to comment #8) > Dwarf2 has DW_AT_entry_point for the same thing as the stabs N_MAIN. I am now believing that DW_CC_program is for this purpose in DWARF. Please have a look at the following two excerpted paragraphs in section 3.3.1 of DWARF standard: If the semantics of the language of the compilation unit containing the subroutine entry distinguishes between ordinary subroutines and subroutines that can serve as the “main program,” that is, subroutines that cannot be called directly according to the ordinary calling conventions, then the debugging information entry for such a subroutine may have a calling convention attribute whose value is the constant DW_CC_program. The DW_CC_program value is intended to support Fortran main programs. It is not intended as a way of finding the entry address for the program. ==== End of the excerpt ==== Although it is intended to support Fortran main programs. But I think that it might also be ok for java as well. If my understanding is right, I think the fix is not that hard (at least for gfortran). Here is my thought: when gfortran trying to emit symbol MAIN__, we can add an extra attribute DW_AT_calling_convention and set it to DW_CC_program. Then in gdb's dwarf2reader, we can add a routine to find out the symbol whose DW_AT_calling_convention is DW_CC_program, and set it to the main function. I am not familar with the gfortran code, if anyone could code the above patch in gfortran's side, I could try to code in the gdb's side. But if anyone is willing to point out where to emit DWARF debuginfo for MAIN__ in gfortran's source, I am very happy to have a try in gfortran. For java, the process might be the same. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1427