[04/17] Add some new DW_IDX_* values

Message ID 20231210-debug-names-fix-v1-4-a8f6d2525018@tromey.com
State New
Headers
Series Rewrite .debug_names reader and writer |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Tom Tromey Dec. 10, 2023, 4:44 p.m. UTC
  The new .debug_names writer in GDB needs to emit some symbol
properties, so that the reader can be fully functional.  This patch
adds a few new DW_IDX_* constants, and tries to document the existing
extensions as well.  (I will add more documentation of these to the
GDB manual as well.)
---
 include/dwarf2.def | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Tom Tromey Jan. 9, 2024, 3:08 p.m. UTC | #1
>>>>> "Tom" == Tom Tromey <tom@tromey.com> writes:

Tom> The new .debug_names writer in GDB needs to emit some symbol
Tom> properties, so that the reader can be fully functional.  This patch
Tom> adds a few new DW_IDX_* constants, and tries to document the existing
Tom> extensions as well.  (I will add more documentation of these to the
Tom> GDB manual as well.)

I sent this particular patch to gcc as well.  It was approved there and
I applied it, so I'm going to apply it to gdb now as well.

This doesn't materially impact the rest of this series.

Tom
  
Tom Tromey Jan. 9, 2024, 7:02 p.m. UTC | #2
Tom> The new .debug_names writer in GDB needs to emit some symbol
Tom> properties, so that the reader can be fully functional.  This patch
Tom> adds a few new DW_IDX_* constants, and tries to document the existing
Tom> extensions as well.  (I will add more documentation of these to the
Tom> GDB manual as well.)

> I sent this particular patch to gcc as well.  It was approved there and
> I applied it, so I'm going to apply it to gdb now as well.

It turns out I did this in December and then forgot about it.

Tom
  

Patch

diff --git a/include/dwarf2.def b/include/dwarf2.def
index 7ab3ee611fd..75b75d90188 100644
--- a/include/dwarf2.def
+++ b/include/dwarf2.def
@@ -802,8 +802,17 @@  DW_IDX (DW_IDX_parent, 4)
 DW_IDX (DW_IDX_type_hash, 5)
 DW_IDX_DUP (DW_IDX_lo_user, 0x2000)
 DW_IDX (DW_IDX_hi_user, 0x3fff)
+/* Internal linkage.  A flag.  */
 DW_IDX (DW_IDX_GNU_internal, 0x2000)
+/* External linkage.  A flag.  Note that gdb no longer generates this;
+   the default is to assume external linkage.  */
 DW_IDX (DW_IDX_GNU_external, 0x2001)
+/* This entry is the program's entry point.  A flag.  */
+DW_IDX (DW_IDX_GNU_main, 0x2002)
+/* Language for this entry.  A DW_LANG_* value.  */
+DW_IDX (DW_IDX_GNU_language, 0x2003)
+/* This entry is a linkage name.  A flag.  */
+DW_IDX (DW_IDX_GNU_linkage_name, 0x2004)
 DW_END_IDX
 
 /* DWARF5 Unit type header encodings  */