This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PCH] fixes for reported dwarf2 problems
- From: Geoffrey Keating <gkeating at apple dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Sat, 30 Nov 2002 17:11:42 -0800 (PST)
- Subject: [PCH] fixes for reported dwarf2 problems
This fixes a few merge-related problems in dwarf2out.c that caused
build failures on targets using dwarf2 debugging.
Tested by building and 'make check' on powerpc-eabisim.
--
- Geoffrey Keating <geoffk@apple.com>
===File ~/patches/pchbranch-dwarfmergefixes.patch===========
2002-11-30 Geoffrey Keating <geoffk@apple.com>
* dwarf2out.c (dw2_string_counter): New.
(AT_string_form): Use it.
(same_dw_val_p): Update for removal of hashtable.h hash tables.
Index: dwarf2out.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dwarf2out.c,v
retrieving revision 1.349.2.15
diff -u -p -u -p -r1.349.2.15 dwarf2out.c
--- dwarf2out.c 10 Nov 2002 07:16:52 -0000 1.349.2.15
+++ dwarf2out.c 1 Dec 2002 01:08:11 -0000
@@ -286,6 +286,8 @@ struct indirect_string_node GTY(())
static GTY ((param_is (struct indirect_string_node))) htab_t debug_str_hash;
+static GTY(()) int dw2_string_counter;
+
#if defined (DWARF2_DEBUGGING_INFO) || defined (DWARF2_UNWIND_INFO)
/* Forward declarations for functions defined in this file. */
@@ -4679,7 +4681,6 @@ AT_string_form (a)
{
struct indirect_string_node *node;
unsigned int len;
- extern int const_labelno;
char label[32];
node = a->dw_attr_val.v.val_str;
@@ -4700,8 +4701,8 @@ AT_string_form (a)
&& (len - DWARF_OFFSET_SIZE) * node->refcount <= len)
return node->form = DW_FORM_string;
- ASM_GENERATE_INTERNAL_LABEL (label, "LC", const_labelno);
- ++const_labelno;
+ ASM_GENERATE_INTERNAL_LABEL (label, "LASF", dw2_string_counter);
+ ++dw2_string_counter;
node->label = xstrdup (label);
return node->form = DW_FORM_strp;
@@ -5684,8 +5685,7 @@ same_dw_val_p (v1, v2, mark)
case dw_val_class_flag:
return v1->v.val_flag == v2->v.val_flag;
case dw_val_class_str:
- return !strcmp((const char *) HT_STR (&v1->v.val_str->id),
- (const char *) HT_STR (&v2->v.val_str->id));
+ return !strcmp(v1->v.val_str->str, v2->v.val_str->str);
case dw_val_class_addr:
r1 = v1->v.val_addr;
============================================================