This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Implement debug main pointer on IA64 VMS


VMS Debug requires the "main" procedure to be specially designated.

OK to commit?

--Douglas B Rupp
AdaCore
2009-07-29  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.

diff -rupN gcc/config/ia64/ia64-protos.h gcc/config/ia64/ia64-protos.h
--- gcc/config/ia64/ia64-protos.h	2007-08-23 18:41:01.000000000 -0700
+++ gcc/config/ia64/ia64-protos.h	2009-01-21 15:51:36.000000000 -0800
@@ -77,6 +77,7 @@ extern void ia64_function_arg_advance (C
 				       tree, int);
 extern int ia64_function_arg_boundary (enum machine_mode, tree);
 extern void ia64_asm_output_external (FILE *, tree, const char *);
+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	2007-03-09 18:36:16.000000000 -0800
+++ gcc/config/ia64/sysv4.h	2009-01-21 15:37:02.000000000 -0800
@@ -103,12 +109,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	2008-11-20 23:28:27.000000000 -0800
+++ gcc/config/ia64/ia64.c	2009-01-23 00:23:45.000000000 -0800
@@ -3308,6 +3412,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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]