From patchwork Sat Jun 26 19:40:22 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas B Rupp X-Patchwork-Id: 57064 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id AD65BB6EF3 for ; Sun, 27 Jun 2010 05:40:57 +1000 (EST) Received: (qmail 1060 invoked by alias); 26 Jun 2010 19:40:56 -0000 Received: (qmail 1049 invoked by uid 22791); 26 Jun 2010 19:40:55 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL, BAYES_00, TW_DB, T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 26 Jun 2010 19:40:50 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 229BF2BAB22; Sat, 26 Jun 2010 15:40:49 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id Xuj-BOquKNvE; Sat, 26 Jun 2010 15:40:49 -0400 (EDT) Received: from [192.168.1.104] (dpc6682073249.direcpc.com [66.82.73.249]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 28CA42BAAFD; Sat, 26 Jun 2010 15:40:43 -0400 (EDT) Message-ID: <4C2657A6.3050109@gnat.com> Date: Sat, 26 Jun 2010 12:40:22 -0700 From: Douglas B Rupp User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: Jim Wilson , Richard Henderson CC: gcc-patches@gcc.gnu.org Subject: [PATCH] Add type_decl and begin_epilogue to vmsdbgout.c X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org This patch adds two pass through calls to dwarf2out.c for VMS_AND_DWARF2 debug format plus outputting a begin epilogue label for VMS Debug. OK to commit? 2010-06-26 Douglas B Rupp * vmsdbgout.c (vmsdbgout_begin_epilogue): Declare (vmsdbgout_type_decl): Declare (vmsdbg_debug_hooks): Add entry for type_decl and begin_epilogue. (FUNC_EPILOGUE_LABEL): New macro (vmsdbgout_begin_epilogue): New function. (vmsdbgout_type_decl): New function. diff -rupN gcc-head-src.orig/gcc/vmsdbgout.c gcc-head-src/gcc/vmsdbgout.c --- gcc/vmsdbgout.c 2010-06-16 12:40:46.000000000 -0700 +++ gcc/vmsdbgout.c 2010-06-25 23:25:23.000000000 -0700 @@ -180,10 +165,12 @@ static void vmsdbgout_source_line (unsig static void vmsdbgout_begin_prologue (unsigned int, const char *); static void vmsdbgout_end_prologue (unsigned int, const char *); static void vmsdbgout_end_function (unsigned int); +static void vmsdbgout_begin_epilogue (unsigned int, const char *); static void vmsdbgout_end_epilogue (unsigned int, const char *); static void vmsdbgout_begin_function (tree); static void vmsdbgout_decl (tree); static void vmsdbgout_global_decl (tree); +static void vmsdbgout_type_decl (tree, int); static void vmsdbgout_abstract_function (tree); /* The debug hooks structure. */ @@ -202,13 +189,13 @@ const struct gcc_debug_hooks vmsdbg_debu vmsdbgout_source_line, vmsdbgout_begin_prologue, vmsdbgout_end_prologue, - debug_nothing_int_charstar, /* begin_epilogue */ + vmsdbgout_begin_epilogue, vmsdbgout_end_epilogue, vmsdbgout_begin_function, vmsdbgout_end_function, vmsdbgout_decl, vmsdbgout_global_decl, - debug_nothing_tree_int, /* type_decl */ + vmsdbgout_type_decl, /* type_decl */ debug_nothing_tree_tree_tree_bool, /* imported_module_or_decl */ debug_nothing_tree, /* deferred_inline_function */ vmsdbgout_abstract_function, @@ -286,6 +273,9 @@ static char text_end_label[MAX_ARTIFICIA #ifndef FUNC_PROLOG_LABEL #define FUNC_PROLOG_LABEL "LVFP" #endif +#ifndef FUNC_EPILOG_LABEL +#define FUNC_EPILOG_LABEL "LVEB" +#endif #ifndef FUNC_END_LABEL #define FUNC_END_LABEL "LVFE" #endif @@ -1319,6 +1179,38 @@ vmsdbgout_end_function (unsigned int lin (*dwarf2_debug_hooks.end_function) (line); } +/* Output a marker (i.e. a label) for the beginning of the epilogue. + This gets called *before* the epilogue code has been generated. */ + +static void +vmsdbgout_begin_epilogue (unsigned int line, const char *file) +{ + char label[MAX_ARTIFICIAL_LABEL_BYTES]; + static int save_current_function_funcdef_no = -1; + + if (write_symbols == VMS_AND_DWARF2_DEBUG) + (*dwarf2_debug_hooks.begin_epilogue) (line, file); + + if (debug_info_level > DINFO_LEVEL_NONE) + { + if (save_current_function_funcdef_no != current_function_funcdef_no) + { + /* Output a label to mark the endpoint of the code generated for this + function. */ + ASM_GENERATE_INTERNAL_LABEL (label, FUNC_EPILOG_LABEL, + current_function_funcdef_no); + + ASM_OUTPUT_LABEL (asm_out_file, label); + + save_current_function_funcdef_no = current_function_funcdef_no; + + /* VMS PCA expects every PC range to correlate to some line and + file. */ + vmsdbgout_source_line (line, file, 0, true); + } + } +} + /* Output a marker (i.e. a label) for the absolute end of the generated code for a function definition. This gets called *after* the epilogue code has been generated. */ @@ -1667,6 +1554,15 @@ vmsdbgout_global_decl (tree decl) /* Not implemented in VMS Debug. */ static void +vmsdbgout_type_decl (tree decl, int local) +{ + if (write_symbols == VMS_AND_DWARF2_DEBUG) + (*dwarf2_debug_hooks.type_decl) (decl, local); +} + +/* Not implemented in VMS Debug. */ + +static void vmsdbgout_abstract_function (tree decl) { if (write_symbols == VMS_AND_DWARF2_DEBUG)