diff options
author | rupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-16 19:40:46 +0000 |
---|---|---|
committer | rupp <rupp@138bc75d-0d04-0410-961f-82ee72b054a4> | 2010-06-16 19:40:46 +0000 |
commit | cfe7b52eced8dbc42940b298ea57d7ad5eeaa74a (patch) | |
tree | eef98f370a10307f3f44fbf4305711f9f3f71b89 /gcc | |
parent | 0c662fd1ac476eee2317b326aba254a4557a2f0f (diff) | |
download | gcc-cfe7b52eced8dbc42940b298ea57d7ad5eeaa74a.tar.gz |
This patch adds the end prologue and begin epilogue markers in Dwarf2
that are needed by the VMS debugger on I64.
* config/ia64/vms.h (ASM_OUTPUT_DWARF_DELTA_UNITS): Remove.
(ASM_OUTPUT_DWARF_VMS_DELTA: Define new macro.
* dbxout.c (gcc_debug_hooks): New entry begin_epilogue.
* debug.c: Likewise.
* sdbout.c: Likewise.
* vmsdbgout.c: Likewise.
* debug.h: Likewise. (dwarf2out_vms_{begin,end}_prologue): Declare.
* doc/tm.texi (ASM_OUTPUT_DWARF_VMS_DELTA): Document.
* dwarf2asm.c (dw2_asm_output_vms_delta): New function.
(ASM_OUTPUT_DWARF_VMS_DELTA): Call it.
* dwarf2asm.h (dw2_asm_output_vms_delta): Declare.
* dwarf2out.c (dw_fde_struct): New fields
dw_fde_vms_{end,begin}_prologue.
(PROLOGUE_END_LABEL, EPILOGUE_BEGIN_LABEL): New macros.
(dwarf2out_begin_prologue): Set dw_fde_struct defaults for above.
(dwarf2out_vms_end_prologue): New function.
(dwarf2out_vms_begin_epilogue): New function.
(dw_val_struct): New value dw_val_class_vms_delta.
(gcc_debug_hooks): New entry begin_epilogue. Set end_prologue,
begin_epilogue for VMS.
(AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): Declare
new static functions.
(dwarf_attr_name): New cases DW_AT_HP_{prologue,epilogue}.
(AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): New
static functions.
(print_die): New case dw_val_class_vms_delta.
(attr_checksum): Likewise.
(same_dw_val_p: Likewise.
(size_of_die): Likewise.
(value_format): Likewise.
(output_die): Likewise.
(gen_subprogram_die): Call add_AT_vms_delta on VMS.
(dwarf2out_begin_epilogue): Rename to dwarf2out_cfi_begin_epilogue
* dwarf2out.h (dwarf2out_begin_epilogue): Rename to
dwarf2out_cfi_begin_epilogue
* final.c (final_scan_insn): Likewise. Call begin_epilogue.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@160858 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 39 | ||||
-rw-r--r-- | gcc/config/ia64/vms.h | 16 | ||||
-rw-r--r-- | gcc/dbxout.c | 4 | ||||
-rw-r--r-- | gcc/debug.c | 3 | ||||
-rw-r--r-- | gcc/debug.h | 7 | ||||
-rw-r--r-- | gcc/doc/tm.texi | 6 | ||||
-rw-r--r-- | gcc/dwarf2asm.c | 29 | ||||
-rw-r--r-- | gcc/dwarf2asm.h | 7 | ||||
-rw-r--r-- | gcc/dwarf2out.c | 167 | ||||
-rw-r--r-- | gcc/dwarf2out.h | 4 | ||||
-rw-r--r-- | gcc/final.c | 3 | ||||
-rw-r--r-- | gcc/sdbout.c | 4 | ||||
-rw-r--r-- | gcc/vmsdbgout.c | 3 |
13 files changed, 271 insertions, 21 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d5dc0cf739..3acf2c5cf9e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,42 @@ +2010-06-16 Douglas B Rupp <rupp@gnat.com> + + * config/ia64/vms.h (ASM_OUTPUT_DWARF_DELTA_UNITS): Remove. + (ASM_OUTPUT_DWARF_VMS_DELTA: Define new macro. + * dbxout.c (gcc_debug_hooks): New entry begin_epilogue. + * debug.c: Likewise. + * sdbout.c: Likewise. + * vmsdbgout.c: Likewise. + * debug.h: Likewise. (dwarf2out_vms_{begin,end}_prologue): Declare. + * doc/tm.texi (ASM_OUTPUT_DWARF_VMS_DELTA): Document. + * dwarf2asm.c (dw2_asm_output_vms_delta): New function. + (ASM_OUTPUT_DWARF_VMS_DELTA): Call it. + * dwarf2asm.h (dw2_asm_output_vms_delta): Declare. + * dwarf2out.c (dw_fde_struct): New fields + dw_fde_vms_{end,begin}_prologue. + (PROLOGUE_END_LABEL, EPILOGUE_BEGIN_LABEL): New macros. + (dwarf2out_begin_prologue): Set dw_fde_struct defaults for above. + (dwarf2out_vms_end_prologue): New function. + (dwarf2out_vms_begin_epilogue): New function. + (dw_val_struct): New value dw_val_class_vms_delta. + (gcc_debug_hooks): New entry begin_epilogue. Set end_prologue, + begin_epilogue for VMS. + (AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): Declare + new static functions. + (dwarf_attr_name): New cases DW_AT_HP_{prologue,epilogue}. + (AT_vms_delta1, AT_vms_delta2, add_AT_vms_delta): New + static functions. + (print_die): New case dw_val_class_vms_delta. + (attr_checksum): Likewise. + (same_dw_val_p: Likewise. + (size_of_die): Likewise. + (value_format): Likewise. + (output_die): Likewise. + (gen_subprogram_die): Call add_AT_vms_delta on VMS. + (dwarf2out_begin_epilogue): Rename to dwarf2out_cfi_begin_epilogue + * dwarf2out.h (dwarf2out_begin_epilogue): Rename to + dwarf2out_cfi_begin_epilogue + * final.c (final_scan_insn): Likewise. Call begin_epilogue. + 2010-06-16 Nathan Froyd <froydnj@codesourcery.com> * config/cris/cris-protos.h (cris_print_operand): Delete. diff --git a/gcc/config/ia64/vms.h b/gcc/config/ia64/vms.h index 279586c0398..3d678ce5f85 100644 --- a/gcc/config/ia64/vms.h +++ b/gcc/config/ia64/vms.h @@ -1,5 +1,5 @@ /* Definitions of target machine GNU compiler. IA64-VMS version. - Copyright (C) 2003-2009 Free Software Foundation, Inc. + Copyright (C) 2003-2010 Free Software Foundation, Inc. Contributed by Douglas B Rupp (rupp@gnat.com). This file is part of GCC. @@ -72,13 +72,13 @@ along with GCC; see the file COPYING3. If not see /* Turn on VMS specific Dwarf2 features. */ #define VMS_DEBUGGING_INFO 1 -#define ASM_OUTPUT_DWARF_DELTA_UNITS(FILE,SIZE,LABEL1,LABEL2,UNITS) \ -do { \ - fprintf (FILE, "\tdata4.ua\t ("); \ - assemble_name (FILE, LABEL1); \ - fprintf (FILE, "-"); \ - assemble_name (FILE, LABEL2); \ - fprintf (FILE, ")/16*3"); \ +#define ASM_OUTPUT_DWARF_VMS_DELTA(FILE,SIZE,LABEL1,LABEL2) \ +do { \ + fprintf (FILE, "\tdata4.ua\t@slotcount("); \ + assemble_name (FILE, LABEL1); \ + fprintf (FILE, "-"); \ + assemble_name (FILE, LABEL2); \ + fprintf (FILE, ")"); \ } while (0) #undef STARTFILE_SPEC diff --git a/gcc/dbxout.c b/gcc/dbxout.c index be1e6fdcd0d..066e91f191a 100644 --- a/gcc/dbxout.c +++ b/gcc/dbxout.c @@ -1,6 +1,6 @@ /* Output dbx-format symbol table information from GNU compiler. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -357,6 +357,7 @@ const struct gcc_debug_hooks dbx_debug_hooks = dbxout_source_line, /* source_line */ dbxout_begin_prologue, /* begin_prologue */ debug_nothing_int_charstar, /* end_prologue */ + debug_nothing_int_charstar, /* begin_epilogue */ debug_nothing_int_charstar, /* end_epilogue */ #ifdef DBX_FUNCTION_FIRST dbxout_begin_function, @@ -399,6 +400,7 @@ const struct gcc_debug_hooks xcoff_debug_hooks = xcoffout_source_line, xcoffout_begin_prologue, /* begin_prologue */ debug_nothing_int_charstar, /* end_prologue */ + debug_nothing_int_charstar, /* begin_epilogue */ xcoffout_end_epilogue, debug_nothing_tree, /* begin_function */ xcoffout_end_function, diff --git a/gcc/debug.c b/gcc/debug.c index c60a78d4708..c53d05eae58 100644 --- a/gcc/debug.c +++ b/gcc/debug.c @@ -1,5 +1,5 @@ /* Do-nothing debug hooks for GCC. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -38,6 +38,7 @@ const struct gcc_debug_hooks do_nothing_debug_hooks = debug_nothing_int_charstar_int_bool, /* source_line */ debug_nothing_int_charstar, /* begin_prologue */ debug_nothing_int_charstar, /* end_prologue */ + debug_nothing_int_charstar, /* begin_epilogue */ debug_nothing_int_charstar, /* end_epilogue */ debug_nothing_tree, /* begin_function */ debug_nothing_int, /* end_function */ diff --git a/gcc/debug.h b/gcc/debug.h index 079ecb623ad..2ca0ad86e50 100644 --- a/gcc/debug.h +++ b/gcc/debug.h @@ -1,5 +1,5 @@ /* Debug hooks for GCC. - Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008 + Copyright (C) 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2010 Free Software Foundation, Inc. This program is free software; you can redistribute it and/or modify it @@ -75,6 +75,9 @@ struct gcc_debug_hooks function. */ void (* end_prologue) (unsigned int line, const char *file); + /* Called at beginning of epilogue code. */ + void (* begin_epilogue) (unsigned int line, const char *file); + /* Record end of epilogue code. */ void (* end_epilogue) (unsigned int line, const char *file); @@ -194,6 +197,8 @@ extern const struct gcc_debug_hooks vmsdbg_debug_hooks; /* Dwarf2 frame information. */ extern void dwarf2out_begin_prologue (unsigned int, const char *); +extern void dwarf2out_vms_end_prologue (unsigned int, const char *); +extern void dwarf2out_vms_begin_epilogue (unsigned int, const char *); extern void dwarf2out_end_epilogue (unsigned int, const char *); extern void dwarf2out_frame_init (void); extern void dwarf2out_frame_finish (void); diff --git a/gcc/doc/tm.texi b/gcc/doc/tm.texi index 495bdfa0a2f..b118c657391 100644 --- a/gcc/doc/tm.texi +++ b/gcc/doc/tm.texi @@ -9289,6 +9289,12 @@ A C statement to issue assembly directives that create a difference @var{lab1} minus @var{lab2}, using an integer of the given @var{size}. @end defmac +@defmac ASM_OUTPUT_DWARF_VMS_DELTA (@var{stream}, @var{size}, @var{label1}, @var{label2}) +A C statement to issue assembly directives that create a difference +between the two given labels in system defined units, e.g. instruction +slots on IA64 VMS, using an integer of the given size. +@end defmac + @defmac ASM_OUTPUT_DWARF_OFFSET (@var{stream}, @var{size}, @var{label}, @var{section}) A C statement to issue assembly directives that create a section-relative reference to the given @var{label}, using an integer of the diff --git a/gcc/dwarf2asm.c b/gcc/dwarf2asm.c index 8e16a21d031..84e8cadc9d3 100644 --- a/gcc/dwarf2asm.c +++ b/gcc/dwarf2asm.c @@ -152,6 +152,35 @@ dw2_asm_output_delta (int size, const char *lab1, const char *lab2, va_end (ap); } +/* Output the difference between two symbols in instruction units + in a given size. */ + +void +dw2_asm_output_vms_delta (int size ATTRIBUTE_UNUSED, + const char *lab1, const char *lab2, + const char *comment, ...) +{ + va_list ap; + + va_start (ap, comment); + +#ifndef ASM_OUTPUT_DWARF_VMS_DELTA + /* VMS Delta is only special on ia64-vms, but this funtion also gets + called on alpha-vms so it has to do something sane. */ + dw2_asm_output_delta (size, lab1, lab2, comment); +#else + ASM_OUTPUT_DWARF_VMS_DELTA (asm_out_file, size, lab1, lab2); + if (flag_debug_asm && comment) + { + fprintf (asm_out_file, "\t%s ", ASM_COMMENT_START); + vfprintf (asm_out_file, comment, ap); + } + fputc ('\n', asm_out_file); +#endif + + va_end (ap); +} + /* Output a section-relative reference to a LABEL, which was placed in BASE. In general this can only be done for debugging symbols. E.g. on most targets with the GNU linker, this is accomplished with diff --git a/gcc/dwarf2asm.h b/gcc/dwarf2asm.h index e7be9bdbaee..39515d0ddb3 100644 --- a/gcc/dwarf2asm.h +++ b/gcc/dwarf2asm.h @@ -1,5 +1,6 @@ /* Dwarf2 assembler output helper routines. - Copyright (C) 2001, 2003, 2005, 2007, 2008 Free Software Foundation, Inc. + Copyright (C) 2001, 2003, 2005, 2007, 2008, 2010 + Free Software Foundation, Inc. This file is part of GCC. @@ -30,6 +31,10 @@ extern void dw2_asm_output_delta (int, const char *, const char *, const char *, ...) ATTRIBUTE_NULL_PRINTF_4; +extern void dw2_asm_output_vms_delta (int, const char *, const char *, + const char *, ...) + ATTRIBUTE_NULL_PRINTF_4; + extern void dw2_asm_output_offset (int, const char *, section *, const char *, ...) ATTRIBUTE_NULL_PRINTF_4; diff --git a/gcc/dwarf2out.c b/gcc/dwarf2out.c index e35a780fe48..8d1dd817a36 100644 --- a/gcc/dwarf2out.c +++ b/gcc/dwarf2out.c @@ -299,6 +299,8 @@ typedef struct GTY(()) dw_fde_struct { const char *dw_fde_begin; const char *dw_fde_current_label; const char *dw_fde_end; + const char *dw_fde_vms_end_prologue; + const char *dw_fde_vms_begin_epilogue; const char *dw_fde_hot_section_label; const char *dw_fde_hot_section_end_label; const char *dw_fde_unlikely_section_label; @@ -508,6 +510,14 @@ static void def_cfa_1 (const char *, dw_cfa_location *); #define FUNC_END_LABEL "LFE" #endif +#ifndef PROLOGUE_END_LABEL +#define PROLOGUE_END_LABEL "LPE" +#endif + +#ifndef EPILOGUE_BEGIN_LABEL +#define EPILOGUE_BEGIN_LABEL "LEB" +#endif + #ifndef FRAME_BEGIN_LABEL #define FRAME_BEGIN_LABEL "Lframe" #endif @@ -2789,7 +2799,7 @@ dwarf2out_frame_debug (rtx insn, bool after_p) NOTE_INSN_CFA_RESTORE_STATE at the appropriate place in the stream. */ void -dwarf2out_begin_epilogue (rtx insn) +dwarf2out_cfi_begin_epilogue (rtx insn) { bool saw_frp = false; rtx i; @@ -2862,7 +2872,8 @@ dwarf2out_begin_epilogue (rtx insn) cfa_remember.in_use = 1; } -/* A "subroutine" of dwarf2out_begin_epilogue. Emit the restore required. */ +/* A "subroutine" of dwarf2out_cfi_begin_epilogue. Emit the restore + required. */ void dwarf2out_frame_debug_restore_state (void) @@ -3961,6 +3972,8 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, fde->dw_fde_switched_sections = 0; fde->dw_fde_switched_cold_to_hot = 0; fde->dw_fde_end = NULL; + fde->dw_fde_vms_end_prologue = NULL; + fde->dw_fde_vms_begin_epilogue = NULL; fde->dw_fde_cfi = NULL; fde->dw_fde_switch_cfi = NULL; fde->funcdef_number = current_function_funcdef_no; @@ -4017,6 +4030,51 @@ dwarf2out_begin_prologue (unsigned int line ATTRIBUTE_UNUSED, } } +/* Output a marker (i.e. a label) for the end of the generated code + for a function prologue. This gets called *after* the prologue code has + been generated. */ + +void +dwarf2out_vms_end_prologue (unsigned int line ATTRIBUTE_UNUSED, + const char *file ATTRIBUTE_UNUSED) +{ + dw_fde_ref fde; + char label[MAX_ARTIFICIAL_LABEL_BYTES]; + + /* Output a label to mark the endpoint of the code generated for this + function. */ + ASM_GENERATE_INTERNAL_LABEL (label, PROLOGUE_END_LABEL, + current_function_funcdef_no); + ASM_OUTPUT_DEBUG_LABEL (asm_out_file, PROLOGUE_END_LABEL, + current_function_funcdef_no); + fde = &fde_table[fde_table_in_use - 1]; + fde->dw_fde_vms_end_prologue = xstrdup (label); +} + +/* Output a marker (i.e. a label) for the beginning of the generated code + for a function epilogue. This gets called *before* the prologue code has + been generated. */ + +void +dwarf2out_vms_begin_epilogue (unsigned int line ATTRIBUTE_UNUSED, + const char *file ATTRIBUTE_UNUSED) +{ + dw_fde_ref fde; + char label[MAX_ARTIFICIAL_LABEL_BYTES]; + + fde = &fde_table[fde_table_in_use - 1]; + if (fde->dw_fde_vms_begin_epilogue) + return; + + /* Output a label to mark the endpoint of the code generated for this + function. */ + ASM_GENERATE_INTERNAL_LABEL (label, EPILOGUE_BEGIN_LABEL, + current_function_funcdef_no); + ASM_OUTPUT_DEBUG_LABEL (asm_out_file, EPILOGUE_BEGIN_LABEL, + current_function_funcdef_no); + fde->dw_fde_vms_begin_epilogue = xstrdup (label); +} + /* 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. */ @@ -4193,7 +4251,8 @@ enum dw_val_class dw_val_class_str, dw_val_class_macptr, dw_val_class_file, - dw_val_class_data8 + dw_val_class_data8, + dw_val_class_vms_delta }; /* Describe a floating point constant value, or a vector constant value. */ @@ -4231,6 +4290,11 @@ typedef struct GTY(()) dw_val_struct { unsigned char GTY ((tag ("dw_val_class_flag"))) val_flag; struct dwarf_file_data * GTY ((tag ("dw_val_class_file"))) val_file; unsigned char GTY ((tag ("dw_val_class_data8"))) val_data8[8]; + struct dw_val_vms_delta_union + { + char * lbl1; + char * lbl2; + } GTY ((tag ("dw_val_class_vms_delta"))) val_vms_delta; } GTY ((desc ("%1.val_class"))) v; } @@ -5466,7 +5530,13 @@ const struct gcc_debug_hooks dwarf2_debug_hooks = dwarf2out_ignore_block, dwarf2out_source_line, dwarf2out_begin_prologue, - debug_nothing_int_charstar, /* end_prologue */ +#if VMS_DEBUGGING_INFO + dwarf2out_vms_end_prologue, + dwarf2out_vms_begin_epilogue, +#else + debug_nothing_int_charstar, + debug_nothing_int_charstar, +#endif dwarf2out_end_epilogue, dwarf2out_begin_function, debug_nothing_int, /* end_function */ @@ -6230,6 +6300,10 @@ static void prune_unused_types_walk_attribs (dw_die_ref); static void prune_unused_types_prune (dw_die_ref); static void prune_unused_types (void); static int maybe_emit_file (struct dwarf_file_data *fd); +static inline const char *AT_vms_delta1 (dw_attr_ref); +static inline const char *AT_vms_delta2 (dw_attr_ref); +static inline void add_AT_vms_delta (dw_die_ref, enum dwarf_attribute, + const char *, const char *); static void append_entry_to_tmpl_value_parm_die_table (dw_die_ref, tree); static void gen_remaining_tmpl_value_param_die_attribute (void); @@ -6737,14 +6811,24 @@ dwarf_attr_name (unsigned int attr) return "DW_AT_MIPS_tail_loop_begin"; case DW_AT_MIPS_epilog_begin: return "DW_AT_MIPS_epilog_begin"; +#if VMS_DEBUGGING_INFO + case DW_AT_HP_prologue: + return "DW_AT_HP_prologue"; +#else case DW_AT_MIPS_loop_unroll_factor: return "DW_AT_MIPS_loop_unroll_factor"; +#endif case DW_AT_MIPS_software_pipeline_depth: return "DW_AT_MIPS_software_pipeline_depth"; case DW_AT_MIPS_linkage_name: return "DW_AT_MIPS_linkage_name"; +#if VMS_DEBUGGING_INFO + case DW_AT_HP_epilogue: + return "DW_AT_HP_epilogue"; +#else case DW_AT_MIPS_stride: return "DW_AT_MIPS_stride"; +#endif case DW_AT_MIPS_abstract_name: return "DW_AT_MIPS_abstract_name"; case DW_AT_MIPS_clone_origin: @@ -7310,6 +7394,21 @@ AT_file (dw_attr_ref a) return a->dw_attr_val.v.val_file; } +/* Add a vms delta attribute value to a DIE. */ + +static inline void +add_AT_vms_delta (dw_die_ref die, enum dwarf_attribute attr_kind, + const char *lbl1, const char *lbl2) +{ + dw_attr_node attr; + + attr.dw_attr = attr_kind; + attr.dw_attr_val.val_class = dw_val_class_vms_delta; + attr.dw_attr_val.v.val_vms_delta.lbl1 = xstrdup (lbl1); + attr.dw_attr_val.v.val_vms_delta.lbl2 = xstrdup (lbl2); + add_dwarf_attr (die, &attr); +} + /* Add a label identifier attribute value to a DIE. */ static inline void @@ -7381,6 +7480,24 @@ add_AT_range_list (dw_die_ref die, enum dwarf_attribute attr_kind, add_dwarf_attr (die, &attr); } +/* Return the start label of a delta attribute. */ + +static inline const char * +AT_vms_delta1 (dw_attr_ref a) +{ + gcc_assert (a && (AT_class (a) == dw_val_class_vms_delta)); + return a->dw_attr_val.v.val_vms_delta.lbl1; +} + +/* Return the end label of a delta attribute. */ + +static inline const char * +AT_vms_delta2 (dw_attr_ref a) +{ + gcc_assert (a && (AT_class (a) == dw_val_class_vms_delta)); + return a->dw_attr_val.v.val_vms_delta.lbl2; +} + static inline const char * AT_lbl (dw_attr_ref a) { @@ -8178,6 +8295,10 @@ print_die (dw_die_ref die, FILE *outfile) else fprintf (outfile, "die -> <null>"); break; + case dw_val_class_vms_delta: + fprintf (outfile, "delta: @slotcount(%s-%s)", + AT_vms_delta2 (a), AT_vms_delta1 (a)); + break; case dw_val_class_lbl_id: case dw_val_class_lineptr: case dw_val_class_macptr: @@ -8356,6 +8477,7 @@ attr_checksum (dw_attr_ref at, struct md5_ctx *ctx, int *mark) break; case dw_val_class_fde_ref: + case dw_val_class_vms_delta: case dw_val_class_lbl_id: case dw_val_class_lineptr: case dw_val_class_macptr: @@ -9086,6 +9208,7 @@ same_dw_val_p (const dw_val_node *v1, const dw_val_node *v2, int *mark) return same_die_p (v1->v.val_die_ref.die, v2->v.val_die_ref.die, mark); case dw_val_class_fde_ref: + case dw_val_class_vms_delta: case dw_val_class_lbl_id: case dw_val_class_lineptr: case dw_val_class_macptr: @@ -10267,6 +10390,9 @@ size_of_die (dw_die_ref die) case dw_val_class_data8: size += 8; break; + case dw_val_class_vms_delta: + size += DWARF_OFFSET_SIZE; + break; default: gcc_unreachable (); } @@ -10424,6 +10550,7 @@ value_format (dw_attr_ref a) if (dwarf_version >= 4) return DW_FORM_sec_offset; /* FALLTHRU */ + case dw_val_class_vms_delta: case dw_val_class_offset: switch (DWARF_OFFSET_SIZE) { @@ -10889,6 +11016,12 @@ output_die (dw_die_ref die) } break; + case dw_val_class_vms_delta: + dw2_asm_output_vms_delta (DWARF_OFFSET_SIZE, + AT_vms_delta2 (a), AT_vms_delta1 (a), + "%s", name); + break; + case dw_val_class_lbl_id: dw2_asm_output_addr (DWARF2_ADDR_SIZE, AT_lbl (a), "%s", name); break; @@ -18435,6 +18568,32 @@ gen_subprogram_die (tree decl, dw_die_ref context_die) current_function_funcdef_no); add_AT_lbl_id (subr_die, DW_AT_high_pc, label_id); +#if VMS_DEBUGGING_INFO + /* HP OpenVMS Industry Standard 64: DWARF Extensions + Section 2.3 Prologue and Epilogue Attributes: + When a breakpoint is set on entry to a function, it is generally + desirable for execution to be suspended, not on the very first + instruction of the function, but rather at a point after the + function's frame has been set up, after any language defined local + declaration processing has been completed, and before execution of + the first statement of the function begins. Debuggers generally + cannot properly determine where this point is. Similarly for a + breakpoint set on exit from a function. The prologue and epilogue + attributes allow a compiler to communicate the location(s) to use. */ + + { + dw_fde_ref fde = &fde_table[current_funcdef_fde]; + + if (fde->dw_fde_vms_end_prologue) + add_AT_vms_delta (subr_die, DW_AT_HP_prologue, + fde->dw_fde_begin, fde->dw_fde_vms_end_prologue); + + if (fde->dw_fde_vms_begin_epilogue) + add_AT_vms_delta (subr_die, DW_AT_HP_epilogue, + fde->dw_fde_begin, fde->dw_fde_vms_begin_epilogue); + } +#endif + add_pubname (decl, subr_die); add_arange (decl, subr_die); } diff --git a/gcc/dwarf2out.h b/gcc/dwarf2out.h index 85c320dfbd5..21d87cbfb6e 100644 --- a/gcc/dwarf2out.h +++ b/gcc/dwarf2out.h @@ -1,5 +1,5 @@ /* dwarf2out.h - Various declarations for functions found in dwarf2out.c - Copyright (C) 1998, 1999, 2000, 2003, 2007 + Copyright (C) 1998, 1999, 2000, 2003, 2007, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -20,7 +20,7 @@ along with GCC; see the file COPYING3. If not see extern void dwarf2out_decl (tree); extern void dwarf2out_frame_debug (rtx, bool); -extern void dwarf2out_begin_epilogue (rtx); +extern void dwarf2out_cfi_begin_epilogue (rtx); extern void dwarf2out_frame_debug_restore_state (void); extern void debug_dwarf (void); diff --git a/gcc/final.c b/gcc/final.c index 6ca36340dc5..31e9155ad09 100644 --- a/gcc/final.c +++ b/gcc/final.c @@ -1896,8 +1896,9 @@ final_scan_insn (rtx insn, FILE *file, int optimize ATTRIBUTE_UNUSED, case NOTE_INSN_EPILOGUE_BEG: #if defined (DWARF2_UNWIND_INFO) && defined (HAVE_epilogue) if (dwarf2out_do_frame ()) - dwarf2out_begin_epilogue (insn); + dwarf2out_cfi_begin_epilogue (insn); #endif + (*debug_hooks->begin_epilogue) (last_linenum, last_filename); targetm.asm_out.function_begin_epilogue (file); break; diff --git a/gcc/sdbout.c b/gcc/sdbout.c index 87a00b4a61e..f0e54bf4052 100644 --- a/gcc/sdbout.c +++ b/gcc/sdbout.c @@ -1,6 +1,6 @@ /* Output sdb-format symbol table information from GNU compiler. Copyright (C) 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, - 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 + 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. This file is part of GCC. @@ -325,6 +325,7 @@ const struct gcc_debug_hooks sdb_debug_hooks = sdbout_begin_prologue, /* begin_prologue */ debug_nothing_int_charstar, /* end_prologue */ #endif + debug_nothing_int_charstar, /* begin_epilogue */ sdbout_end_epilogue, /* end_epilogue */ sdbout_begin_function, /* begin_function */ sdbout_end_function, /* end_function */ @@ -1719,6 +1720,7 @@ const struct gcc_debug_hooks sdb_debug_hooks = 0, /* source_line */ 0, /* begin_prologue */ 0, /* end_prologue */ + 0, /* begin_epilogue */ 0, /* end_epilogue */ 0, /* begin_function */ 0, /* end_function */ diff --git a/gcc/vmsdbgout.c b/gcc/vmsdbgout.c index 6856ab3124a..78d41a4d6b5 100644 --- a/gcc/vmsdbgout.c +++ b/gcc/vmsdbgout.c @@ -1,6 +1,6 @@ /* Output VMS debug format symbol table information from GCC. Copyright (C) 1987, 1988, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009 + 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2007, 2008, 2009, 2010 Free Software Foundation, Inc. Contributed by Douglas B. Rupp (rupp@gnat.com). Updated by Bernard W. Giroud (bgiroud@users.sourceforge.net). @@ -202,6 +202,7 @@ const struct gcc_debug_hooks vmsdbg_debug_hooks vmsdbgout_source_line, vmsdbgout_begin_prologue, vmsdbgout_end_prologue, + debug_nothing_int_charstar, /* begin_epilogue */ vmsdbgout_end_epilogue, vmsdbgout_begin_function, vmsdbgout_end_function, |