This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Dwarf2 missing indirect string support for VMS
- From: Douglas B Rupp <rupp at gnat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 23 Jul 2009 13:30:38 -0700
- Subject: [PATCH] Dwarf2 missing indirect string support for VMS
The VMS debugger needs this.
Tested on x86_64-linux-gnu
OK to commit?
--Douglas Rupp
AdaCore
2009-07-23 Douglas B Rupp <rupp@gnat.com>
* doc/tm.texi (DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET):
Document new macro.
* defaults.h: Default it supported.
* dwarf2out.c (AT_string_form): Handle it.
--- gcc/doc/tm.texi.old 2009-07-15 09:33:04.474957937 -0700
+++ gcc/doc/tm.texi 2009-07-15 09:34:24.316255640 -0700
@@ -8955,6 +8955,13 @@ process them properly. This automaticall
a warning if it has been requested explicitly.
@end defmac
+@defmac DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET
+Define this macro to evaluate to a nonzero value if GCC should refrain
+from generating indirect strings in DWARF2 debug information, for instance
+if your target is stuck with an old version of GDB that is unable to
+process them properly.
+@end defmac
+
@defmac DWARF2_ASM_LINE_DEBUG_INFO
Define this macro to be a nonzero value if the assembler can generate Dwarf 2
line debug info sections. This will result in much more compact line number
--- gcc/defaults.h.old 2009-07-14 23:06:48.787044766 -0700
+++ gcc/defaults.h 2009-07-14 23:07:42.764608788 -0700
@@ -860,6 +860,13 @@ see the files COPYING3 and COPYING.RUNTI
#define DWARF2_LOCATION_LISTS_SUPPORT_MISSING_ON_TARGET 0
#endif
+/* For DWARF2, assume there is proper support for indirect strings on the
+ target by default. */
+#if defined (DWARF2_DEBUGGING_INFO) \
+ && !defined (DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET)
+#define DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET 0
+#endif
+
#ifndef LARGEST_EXPONENT_IS_NORMAL
#define LARGEST_EXPONENT_IS_NORMAL(SIZE) 0
#endif
--- gcc/dwarf2out.c.old 2009-07-16 09:15:45.069597974 -0700
+++ gcc/dwarf2out.c 2009-07-16 09:07:54.175887819 -0700
@@ -6586,8 +6586,9 @@ AT_string_form (dw_attr_ref a)
/* If we cannot expect the linker to merge strings in .debug_str
section, only put it into .debug_str if it is worth even in this
single module. */
- if ((debug_str_section->common.flags & SECTION_MERGE) == 0
- && (len - DWARF_OFFSET_SIZE) * node->refcount <= len)
+ if (DWARF2_INDIRECT_STRING_SUPPORT_MISSING_ON_TARGET
+ || ((debug_str_section->common.flags & SECTION_MERGE) == 0
+ && (len - DWARF_OFFSET_SIZE) * node->refcount <= len))
return node->form = DW_FORM_string;
ASM_GENERATE_INTERNAL_LABEL (label, "LASF", dw2_string_counter);