patch: improve decode-to-name of additional dwarf2/dwarf3 codes

Jim Blandy jimb@codesourcery.com
Wed Nov 22 22:29:00 GMT 2006


"Gary Funck" <gary@intrepid.com> writes:
> While debugging GDB, I noticed the routines in dwarf2read.c that
> decode Dwarf2 and Dwarf3 codes into their corresponding string
> names have not been updated to include the various encodings
> that have been added over the past few years.  This primarily
> impacts the diagnostic output that assists when debugging GDB.
>
> Attached is a suggested patch (to gdb 6.5), which brings the
> various *_name routines up to date with include/elf/dwarf2.h.
>
> There is a small problem in the decoding caused by the
> following (in dwarf2.h):
>
>     /* GNU extensions.  */
>     DW_OP_GNU_push_tls_address = 0xe0,
>     /* HP extensions.  */
>     DW_OP_HP_unknown     = 0xe0, /* Ouch, the same as GNU_push_tls_address.
> */
>
> I arbitrarily chose to decode 0xe0 as "DW_OP_GNU_push_tls_address".
> Also, I preserved the "#ifdef MIPS" inside dwarf_attr_name(), but
> it wasn't clear to me that it is needed.  If it is, then for
> consistency, perhaps ifdef's for HP, GNU, DWARF3, and other
> extensions to Dwarf2 would also be required.
>
> ChangeLog:
>
>         * dwarf2read.c (dwarf_attr_name dwarf_cfi_name dwarf_stack_op_name
>         dwarf_tag_name dwarf_type_encoding_name): decode additional Dwarf2
>         and Dwarf3 codes into their corresponding string names.

Hi, this looks good.  Some minor comments:

- In your ChangeLog entry, put commas between the function names.
  It's also standard now to enclose each full line in the list of
  function names in its own pair of parens, as was done here, in the
  4th through 6th lines:

	* target.h (enum target_object): Add TARGET_OBJECT_FLASH.
	(target_write_with_progress): Update comment.
	(struct target_ops): Add to_flash_erase and to_flash_done.
	(target_flash_erase, target_flash_done, struct memory_write_request)
	(memory_write_request_s, enum flash_preserve_mode)
	(target_write_memory_blocks): New, including a vector type
	for memory_write_request_s.

- DWARF is an acronym (Debug With Arbitrary Record Format), so it
  needs to be written in all caps.  The version number isn't a part of
  the name; "DWARF 2" and "DWARF 3" is best.

- Thanks for fixing the indentation, and making the comments end with
  a period and two spaces.

Do you have a copyright assignment on file with the FSF?  I know this
change is mostly mechanical, but I think it's arguably copyrightable,
and I'd like to stay out of gray areas when it comes to these
intellectual property issues.



More information about the Gdb-patches mailing list