From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30756 invoked by alias); 14 Oct 2006 14:17:31 -0000 Received: (qmail 30694 invoked by uid 48); 14 Oct 2006 14:17:31 -0000 Date: Sat, 14 Oct 2006 14:17:00 -0000 Message-ID: <20061014141731.30693.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: "steven at gcc dot gnu dot org" 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: 2006-q4/txt/msg00037.txt.bz2 List-Id: ------- Comment #19 from steven at gcc dot gnu dot org 2006-10-14 14:17 ------- Someone should make gdb understand the DW_AT_calling_convention attribute. This is the bit necessary to make it work for Fortran. I considered stealing a bit on FUNCTION_DECL to mark it as the main program but it seems to me that this hard-coded solution should be acceptable as well (but, your thoughts?). Index: dwarf2out.c =================================================================== --- dwarf2out.c (revision 117672) +++ dwarf2out.c (working copy) @@ -11105,11 +11105,18 @@ add_calling_convention_attribute (dw_die { enum dwarf_calling_convention value = DW_CC_normal; - value = targetm.dwarf_calling_convention (type); + if (is_fortran ()) + { + /* The subroutine named MAIN__ is the main program for Fortran. */ + const char *subroutine_name = get_AT_string (subr_die, DW_AT_name); + if (strcmp (subroutine_name, "MAIN__") == 0) + value = DW_CC_program; + } + else + value = targetm.dwarf_calling_convention (type); - /* Only add the attribute if the backend requests it, and - is not DW_CC_normal. */ - if (value && (value != DW_CC_normal)) + /* Only add the attribute if it is not DW_CC_normal. */ + if (value != DW_CC_normal) add_AT_unsigned (subr_die, DW_AT_calling_convention, value); } -- steven at gcc dot gnu dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |steven at gcc dot gnu dot | |org http://gcc.gnu.org/bugzilla/show_bug.cgi?id=1427