Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* Remove deprecated DW_FORM_sig8 define
@ 2011-03-24 15:54 Mark Wielaard
  2011-03-25  0:12 ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2011-03-24 15:54 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: text/plain, Size: 980 bytes --]

Hi,

While reading through the type unit support I noticed the old deprecated
DW_FORM_sig8 still being used in dwarf2read.c. This patch replaces it
with the official name from the dwarf spec, DW_FORM_ref_sig8, which was
already used in some other places.

2011-03-24  Mark Wielaard  <mjw@redhat.com>

        * dwarf2.h (dwarf_form): Remove deprecated DW_FORM_sig8 define.

2011-03-24  Mark Wielaard  <mjw@redhat.com>

        * dwarf2read.c (lookup_signatured_type): Use DW_FORM_ref_sig8 in
        complaint.
        (skip_one_die): Use DW_FORM_ref_sig8, not DW_FORM_sig8.
        (find_partial_die_in_comp_unit): Likewise in comment.
        (read_attribute_value): Likewise.
        (lookup_die_type): Likewise.
        (dwarf_form_name): Likewise.
        (dump_die_shallow): Likewise.
        (follow_die_ref_or_sig): Likewise.

If this is OK, could someone commit it for me?

I have a similar patch for gcc. binutils already uses the new define
exclusively.

Thanks,

Mark

[-- Attachment #2: gdb_ref_sig8.patch --]
[-- Type: text/x-patch, Size: 4736 bytes --]

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index e5600dc..fad4f4b 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,15 @@
+2011-03-24  Mark Wielaard  <mjw@redhat.com>
+
+	* dwarf2read.c (lookup_signatured_type): Use DW_FORM_ref_sig8 in
+	complaint.
+	(skip_one_die): Use DW_FORM_ref_sig8, not DW_FORM_sig8.
+	(find_partial_die_in_comp_unit): Likewise in comment.
+	(read_attribute_value): Likewise.
+	(lookup_die_type): Likewise.
+	(dwarf_form_name): Likewise.
+	(dump_die_shallow): Likewise.
+	(follow_die_ref_or_sig): Likewise.
+
 2011-03-23  Pedro Alves  <pedro@codesourcery.com>
 
 	* regcache.c (regcache_raw_read): If the target didn't supply a
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 190f0bc..0cc5ca0 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -3105,7 +3105,7 @@ lookup_signatured_type (struct objfile *objfile, ULONGEST sig)
   if (dwarf2_per_objfile->signatured_types == NULL)
     {
       complaint (&symfile_complaints,
-		 _("missing `.debug_types' section for DW_FORM_sig8 die"));
+		 _("missing `.debug_types' section for DW_FORM_ref_sig8 die"));
       return 0;
     }
 
@@ -4217,7 +4217,7 @@ skip_one_die (gdb_byte *buffer, gdb_byte *info_ptr,
 	  break;
 	case DW_FORM_data8:
 	case DW_FORM_ref8:
-	case DW_FORM_sig8:
+	case DW_FORM_ref_sig8:
 	  info_ptr += 8;
 	  break;
 	case DW_FORM_string:
@@ -9184,7 +9184,7 @@ find_partial_die_in_comp_unit (unsigned int offset, struct dwarf2_cu *cu)
 /* Find a partial DIE at OFFSET, which may or may not be in CU,
    except in the case of .debug_types DIEs which do not reference
    outside their CU (they do however referencing other types via
-   DW_FORM_sig8).  */
+   DW_FORM_ref_sig8).  */
 
 static struct partial_die_info *
 find_partial_die (unsigned int offset, struct dwarf2_cu *cu)
@@ -9487,7 +9487,7 @@ read_attribute_value (struct attribute *attr, unsigned form,
       DW_ADDR (attr) = cu->header.offset + read_8_bytes (abfd, info_ptr);
       info_ptr += 8;
       break;
-    case DW_FORM_sig8:
+    case DW_FORM_ref_sig8:
       /* Convert the signature to something we can record in DW_UNSND
 	 for later lookup.
          NOTE: This is NULL if the type wasn't found.  */
@@ -11497,7 +11497,7 @@ lookup_die_type (struct die_info *die, struct attribute *attr,
 
       this_type = get_die_type_at_offset (offset, cu->per_cu);
     }
-  else if (attr->form == DW_FORM_sig8)
+  else if (attr->form == DW_FORM_ref_sig8)
     {
       struct signatured_type *sig_type = DW_SIGNATURED_TYPE (attr);
       struct dwarf2_cu *sig_cu;
@@ -12537,8 +12537,8 @@ dwarf_form_name (unsigned form)
       return "DW_FORM_exprloc";
     case DW_FORM_flag_present:
       return "DW_FORM_flag_present";
-    case DW_FORM_sig8:
-      return "DW_FORM_sig8";
+    case DW_FORM_ref_sig8:
+      return "DW_FORM_ref_sig8";
     default:
       return "DW_FORM_<unknown>";
     }
@@ -13089,7 +13089,7 @@ dump_die_shallow (struct ui_file *f, int indent, struct die_info *die)
 	  fprintf_unfiltered (f, "section offset: %s",
 			      pulongest (DW_UNSND (&die->attrs[i])));
 	  break;
-	case DW_FORM_sig8:
+	case DW_FORM_ref_sig8:
 	  if (DW_SIGNATURED_TYPE (&die->attrs[i]) != NULL)
 	    fprintf_unfiltered (f, "signatured type, offset: 0x%x",
 				DW_SIGNATURED_TYPE (&die->attrs[i])->offset);
@@ -13291,7 +13291,7 @@ follow_die_ref_or_sig (struct die_info *src_die, struct attribute *attr,
 
   if (is_ref_attr (attr))
     die = follow_die_ref (src_die, attr, ref_cu);
-  else if (attr->form == DW_FORM_sig8)
+  else if (attr->form == DW_FORM_ref_sig8)
     die = follow_die_sig (src_die, attr, ref_cu);
   else
     {
@@ -13322,7 +13322,7 @@ follow_die_offset (unsigned int offset, struct dwarf2_cu **ref_cu)
     {
       /* .debug_types CUs cannot reference anything outside their CU.
 	 If they need to, they have to reference a signatured type via
-	 DW_FORM_sig8.  */
+	 DW_FORM_ref_sig8.  */
       if (! offset_in_cu_p (&cu->header, offset))
 	return NULL;
     }
diff --git a/include/ChangeLog b/include/ChangeLog
index 863d6f3..de6858b 100644
--- a/include/ChangeLog
+++ b/include/ChangeLog
@@ -1,3 +1,7 @@
+2011-03-24  Mark Wielaard  <mjw@redhat.com>
+
+	* dwarf2.h (dwarf_form): Remove deprecated DW_FORM_sig8 define.
+
 2010-03-23  Rafael Ávila de Espíndola <respindola@mozilla.com>
 
 	* plugin-api.h (ld_plugin_get_view): New.
diff --git a/include/dwarf2.h b/include/dwarf2.h
index 46f2291..ef0fa5f 100644
--- a/include/dwarf2.h
+++ b/include/dwarf2.h
@@ -189,7 +189,6 @@ enum dwarf_form
     DW_FORM_exprloc = 0x18,
     DW_FORM_flag_present = 0x19,
     DW_FORM_ref_sig8 = 0x20
-#define DW_FORM_sig8  DW_FORM_ref_sig8  /* Note: The use of DW_FORM_sig8 is deprecated.  */
   };
 
 /* Attribute names and codes.  */

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remove deprecated DW_FORM_sig8 define
  2011-03-24 15:54 Remove deprecated DW_FORM_sig8 define Mark Wielaard
@ 2011-03-25  0:12 ` Tom Tromey
  2011-03-25 15:15   ` Mark Wielaard
  0 siblings, 1 reply; 4+ messages in thread
From: Tom Tromey @ 2011-03-25  0:12 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: gdb-patches

>>>>> "Mark" == Mark Wielaard <mjw@redhat.com> writes:

Mark> 2011-03-24  Mark Wielaard  <mjw@redhat.com>
Mark>         * dwarf2read.c (lookup_signatured_type): Use DW_FORM_ref_sig8 in
Mark>         complaint.
Mark>         (skip_one_die): Use DW_FORM_ref_sig8, not DW_FORM_sig8.
Mark>         (find_partial_die_in_comp_unit): Likewise in comment.
Mark>         (read_attribute_value): Likewise.
Mark>         (lookup_die_type): Likewise.
Mark>         (dwarf_form_name): Likewise.
Mark>         (dump_die_shallow): Likewise.
Mark>         (follow_die_ref_or_sig): Likewise.

I'm checking this part in.

The dwarf2.h change needs approval from gcc-patches first.
If it is ok'd, and you need me to commit it, let me know.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remove deprecated DW_FORM_sig8 define
  2011-03-25  0:12 ` Tom Tromey
@ 2011-03-25 15:15   ` Mark Wielaard
  2011-03-25 15:59     ` Tom Tromey
  0 siblings, 1 reply; 4+ messages in thread
From: Mark Wielaard @ 2011-03-25 15:15 UTC (permalink / raw)
  To: Tom Tromey; +Cc: gdb-patches

On Thu, 2011-03-24 at 14:34 -0600, Tom Tromey wrote:
> The dwarf2.h change needs approval from gcc-patches first.
> If it is ok'd, and you need me to commit it, let me know.

The gcc dwarf2.h change was approved and pushed to the gcc repo.

Thanks,

Mark


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Remove deprecated DW_FORM_sig8 define
  2011-03-25 15:15   ` Mark Wielaard
@ 2011-03-25 15:59     ` Tom Tromey
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Tromey @ 2011-03-25 15:59 UTC (permalink / raw)
  To: Mark Wielaard; +Cc: gdb-patches

>>>>> "Mark" == Mark Wielaard <mjw@redhat.com> writes:

Mark> On Thu, 2011-03-24 at 14:34 -0600, Tom Tromey wrote:
>> The dwarf2.h change needs approval from gcc-patches first.
>> If it is ok'd, and you need me to commit it, let me know.

Mark> The gcc dwarf2.h change was approved and pushed to the gcc repo.

I checked it into src as well.

Tom


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-03-25 15:54 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-03-24 15:54 Remove deprecated DW_FORM_sig8 define Mark Wielaard
2011-03-25  0:12 ` Tom Tromey
2011-03-25 15:15   ` Mark Wielaard
2011-03-25 15:59     ` Tom Tromey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox