Patchwork Call Dwarf2 "main" pointer die for IA64 VMS (2nd try)

login
register
mail settings
Submitter Douglas B Rupp
Date June 19, 2010, 6:17 p.m.
Message ID <4C1D09CF.8010605@gnat.com>
Download mbox | patch
Permalink /patch/56245/
State New
Headers show

Comments

Douglas B Rupp - June 19, 2010, 6:17 p.m.
Slightly revised patch to insert the debug "main" pointer die required 
by VMS Debug.

Previously submitted patch for dwarf2out.[ch] must be committed first.

OK to commit?

--Douglas Rupp
AdaCore
2010-06-19  Douglas B Rupp  <rupp@gnat.com>

	* config/ia64/ia64-protos.h (ia64_start_function): Declare.
	* config/ia64/sysv4.h (ASM_DECLARE_FUNCTION_NAME): Move contents
	to ia64_start_function. Invoke it.
	* config/ia64/ia64.c (ia64_start_function): Call new function
	dwarf2out_vms_debug_main_pointer.
Richard Henderson - June 25, 2010, 3:55 p.m.
On 06/19/2010 11:17 AM, Douglas B Rupp wrote:
> Slightly revised patch to insert the debug "main" pointer die required
> by VMS Debug.
> 
> Previously submitted patch for dwarf2out.[ch] must be committed first.

Ok.  Commit this *with* the dwarf2out patch, not after.


r~

Patch

diff -rupN gcc/config/ia64/ia64-protos.h gcc/config/ia64/ia64-protos.h
--- gcc/config/ia64/ia64-protos.h	2010-06-13 04:04:19.000000000 -0700
+++ gcc/config/ia64/ia64-protos.h	2010-06-17 13:57:52.000000000 -0700
@@ -79,6 +79,7 @@  extern void ia64_vms_output_aligned_decl
 						 unsigned HOST_WIDE_INT,
 						 unsigned int);
 extern void ia64_vms_elf_asm_named_section (const char *, unsigned int, tree);
+extern void ia64_start_function (FILE *, const char *, tree);
 #endif /* TREE_CODE */
 
 extern int ia64_register_move_cost (enum machine_mode, enum reg_class,
diff -rupN gcc/config/ia64/sysv4.h gcc/config/ia64/sysv4.h
--- gcc/config/ia64/sysv4.h	2009-04-21 12:03:23.000000000 -0700
+++ gcc/config/ia64/sysv4.h	2010-06-17 13:55:56.000000000 -0700
@@ -127,12 +127,7 @@  do {						\
 
 #undef ASM_DECLARE_FUNCTION_NAME
 #define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
-do {									\
-  fputs ("\t.proc ", FILE);						\
-  assemble_name (FILE, NAME);						\
-  fputc ('\n', FILE);							\
-  ASM_OUTPUT_LABEL (FILE, NAME);					\
-} while (0)
+  ia64_start_function(FILE,NAME,DECL)
 
 /* We redefine this to use the ia64 .endp pseudo-op.  */
 
diff -rupN gcc/config/ia64/ia64.c gcc/config/ia64/ia64.c
--- gcc/config/ia64/ia64.c	2010-06-13 04:04:19.000000000 -0700
+++ gcc/config/ia64/ia64.c	2010-06-17 13:55:56.000000000 -0700
@@ -3423,6 +3423,29 @@  ia64_expand_prologue (void)
   finish_spill_pointers ();
 }
 
+/* Output the textual info surrounding the prologue.  */
+
+void
+ia64_start_function (FILE *file, const char *fnname,
+		     tree decl ATTRIBUTE_UNUSED)
+{
+#if VMS_DEBUGGING_INFO
+  if (vms_debug_main
+      && strncmp (vms_debug_main, fnname, strlen (vms_debug_main)) == 0)
+    {
+      targetm.asm_out.globalize_label (asm_out_file, VMS_DEBUG_MAIN_POINTER);
+      ASM_OUTPUT_DEF (asm_out_file, VMS_DEBUG_MAIN_POINTER, fnname);
+      dwarf2out_vms_debug_main_pointer ();
+      vms_debug_main = 0;
+    }
+#endif
+
+  fputs ("\t.proc ", file);
+  assemble_name (file, fnname);
+  fputc ('\n', file);
+  ASM_OUTPUT_LABEL (file, fnname);
+}
+
 /* Called after register allocation to add any instructions needed for the
    epilogue.  Using an epilogue insn is favored compared to putting all of the
    instructions in output_function_prologue(), since it allows the scheduler