From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: gdb-patches@sourceware.org
Cc: Victor Leschuk <vleschuk@accesssoftek.com>
Subject: [PATCH 7/8] DWARF-5: Macros
Date: Sun, 12 Feb 2017 20:23:00 -0000 [thread overview]
Message-ID: <148693101650.9024.921167249134155014.stgit@host1.jankratochvil.net> (raw)
In-Reply-To: <148693097396.9024.2288256732840761882.stgit@host1.jankratochvil.net>
Hi,
DWARF-5 renamed DW_MACRO_GNU_* to DW_MACRO_*.
Jan
gdb/ChangeLog
2017-02-11 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf2read.c (read_file_scope): Rename DW_MACRO_GNU_*.
(dwarf_parse_macro_header): Accept DWARF version 5.
(dwarf_decode_macro_bytes, dwarf_decode_macros): Rename DW_MACRO_GNU_*.
---
gdb/dwarf2read.c | 78 ++++++++++++++++++++++++++++--------------------------
1 file changed, 40 insertions(+), 38 deletions(-)
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 1b671e4..420cbe0 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -9312,12 +9312,14 @@ read_file_scope (struct die_info *die, struct dwarf2_cu *cu)
refers to information in the line number info statement program
header, so we can only read it if we've read the header
successfully. */
- attr = dwarf2_attr (die, DW_AT_GNU_macros, cu);
+ attr = dwarf2_attr (die, DW_AT_macros, cu);
+ if (attr == NULL)
+ attr = dwarf2_attr (die, DW_AT_GNU_macros, cu);
if (attr && cu->line_header)
{
if (dwarf2_attr (die, DW_AT_macro_info, cu))
complaint (&symfile_complaints,
- _("CU refers to both DW_AT_GNU_macros and DW_AT_macro_info"));
+ _("CU refers to both DW_AT_macros and DW_AT_macro_info"));
dwarf_decode_macros (cu, DW_UNSND (attr), 1);
}
@@ -21713,7 +21715,7 @@ dwarf_parse_macro_header (const gdb_byte **opcode_definitions,
unsigned int version, flags;
version = read_2_bytes (abfd, mac_ptr);
- if (version != 4)
+ if (version != 4 && version != 5)
{
complaint (&symfile_complaints,
_("unrecognized version `%d' in .debug_macro section"),
@@ -21756,7 +21758,7 @@ dwarf_parse_macro_header (const gdb_byte **opcode_definitions,
}
/* A helper for dwarf_decode_macros that handles the GNU extensions,
- including DW_MACRO_GNU_transparent_include. */
+ including DW_MACRO_import. */
static void
dwarf_decode_macro_bytes (bfd *abfd,
@@ -21811,12 +21813,12 @@ dwarf_decode_macro_bytes (bfd *abfd,
case 0:
break;
- case DW_MACRO_GNU_define:
- case DW_MACRO_GNU_undef:
- case DW_MACRO_GNU_define_indirect:
- case DW_MACRO_GNU_undef_indirect:
- case DW_MACRO_GNU_define_indirect_alt:
- case DW_MACRO_GNU_undef_indirect_alt:
+ case DW_MACRO_define:
+ case DW_MACRO_undef:
+ case DW_MACRO_define_strp:
+ case DW_MACRO_undef_strp:
+ case DW_MACRO_define_sup:
+ case DW_MACRO_undef_sup:
{
unsigned int bytes_read;
int line;
@@ -21826,8 +21828,8 @@ dwarf_decode_macro_bytes (bfd *abfd,
line = gdb_read_unsigned_leb128 (abfd, mac_ptr, &bytes_read);
mac_ptr += bytes_read;
- if (macinfo_type == DW_MACRO_GNU_define
- || macinfo_type == DW_MACRO_GNU_undef)
+ if (macinfo_type == DW_MACRO_define
+ || macinfo_type == DW_MACRO_undef)
{
body = read_direct_string (abfd, mac_ptr, &bytes_read);
mac_ptr += bytes_read;
@@ -21839,8 +21841,8 @@ dwarf_decode_macro_bytes (bfd *abfd,
str_offset = read_offset_1 (abfd, mac_ptr, offset_size);
mac_ptr += offset_size;
- if (macinfo_type == DW_MACRO_GNU_define_indirect_alt
- || macinfo_type == DW_MACRO_GNU_undef_indirect_alt
+ if (macinfo_type == DW_MACRO_define_sup
+ || macinfo_type == DW_MACRO_undef_sup
|| section_is_dwz)
{
struct dwz_file *dwz = dwarf2_get_dwz_file ();
@@ -21851,9 +21853,9 @@ dwarf_decode_macro_bytes (bfd *abfd,
body = read_indirect_string_at_offset (abfd, str_offset);
}
- is_define = (macinfo_type == DW_MACRO_GNU_define
- || macinfo_type == DW_MACRO_GNU_define_indirect
- || macinfo_type == DW_MACRO_GNU_define_indirect_alt);
+ is_define = (macinfo_type == DW_MACRO_define
+ || macinfo_type == DW_MACRO_define_strp
+ || macinfo_type == DW_MACRO_define_sup);
if (! current_file)
{
/* DWARF violation as no main source is present. */
@@ -21876,15 +21878,15 @@ dwarf_decode_macro_bytes (bfd *abfd,
parse_macro_definition (current_file, line, body);
else
{
- gdb_assert (macinfo_type == DW_MACRO_GNU_undef
- || macinfo_type == DW_MACRO_GNU_undef_indirect
- || macinfo_type == DW_MACRO_GNU_undef_indirect_alt);
+ gdb_assert (macinfo_type == DW_MACRO_undef
+ || macinfo_type == DW_MACRO_undef_strp
+ || macinfo_type == DW_MACRO_undef_sup);
macro_undef (current_file, line, body);
}
}
break;
- case DW_MACRO_GNU_start_file:
+ case DW_MACRO_start_file:
{
unsigned int bytes_read;
int line, file;
@@ -21904,7 +21906,7 @@ dwarf_decode_macro_bytes (bfd *abfd,
if (at_commandline)
{
- /* This DW_MACRO_GNU_start_file was executed in the
+ /* This DW_MACRO_start_file was executed in the
pass one. */
at_commandline = 0;
}
@@ -21913,7 +21915,7 @@ dwarf_decode_macro_bytes (bfd *abfd,
}
break;
- case DW_MACRO_GNU_end_file:
+ case DW_MACRO_end_file:
if (! current_file)
complaint (&symfile_complaints,
_("macro debug info has an unmatched "
@@ -21952,8 +21954,8 @@ dwarf_decode_macro_bytes (bfd *abfd,
}
break;
- case DW_MACRO_GNU_transparent_include:
- case DW_MACRO_GNU_transparent_include_alt:
+ case DW_MACRO_import:
+ case DW_MACRO_import_sup:
{
LONGEST offset;
void **slot;
@@ -21966,7 +21968,7 @@ dwarf_decode_macro_bytes (bfd *abfd,
offset = read_offset_1 (abfd, mac_ptr, offset_size);
mac_ptr += offset_size;
- if (macinfo_type == DW_MACRO_GNU_transparent_include_alt)
+ if (macinfo_type == DW_MACRO_import_sup)
{
struct dwz_file *dwz = dwarf2_get_dwz_file ();
@@ -21986,7 +21988,7 @@ dwarf_decode_macro_bytes (bfd *abfd,
/* This has actually happened; see
http://sourceware.org/bugzilla/show_bug.cgi?id=13568. */
complaint (&symfile_complaints,
- _("recursive DW_MACRO_GNU_transparent_include in "
+ _("recursive DW_MACRO_import in "
".debug_macro section"));
}
else
@@ -22128,8 +22130,8 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
case 0:
break;
- case DW_MACRO_GNU_define:
- case DW_MACRO_GNU_undef:
+ case DW_MACRO_define:
+ case DW_MACRO_undef:
/* Only skip the data by MAC_PTR. */
{
unsigned int bytes_read;
@@ -22141,7 +22143,7 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
}
break;
- case DW_MACRO_GNU_start_file:
+ case DW_MACRO_start_file:
{
unsigned int bytes_read;
int line, file;
@@ -22155,14 +22157,14 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
}
break;
- case DW_MACRO_GNU_end_file:
+ case DW_MACRO_end_file:
/* No data to skip by MAC_PTR. */
break;
- case DW_MACRO_GNU_define_indirect:
- case DW_MACRO_GNU_undef_indirect:
- case DW_MACRO_GNU_define_indirect_alt:
- case DW_MACRO_GNU_undef_indirect_alt:
+ case DW_MACRO_define_strp:
+ case DW_MACRO_undef_strp:
+ case DW_MACRO_define_sup:
+ case DW_MACRO_undef_sup:
{
unsigned int bytes_read;
@@ -22172,10 +22174,10 @@ dwarf_decode_macros (struct dwarf2_cu *cu, unsigned int offset,
}
break;
- case DW_MACRO_GNU_transparent_include:
- case DW_MACRO_GNU_transparent_include_alt:
+ case DW_MACRO_import:
+ case DW_MACRO_import_sup:
/* Note that, according to the spec, a transparent include
- chain cannot call DW_MACRO_GNU_start_file. So, we can just
+ chain cannot call DW_MACRO_start_file. So, we can just
skip this opcode. */
mac_ptr += offset_size;
break;
next prev parent reply other threads:[~2017-02-12 20:23 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-12 20:23 [PATCH 1/8] Rename read_unsigned_leb128 to gdb_read_unsigned_leb128 Jan Kratochvil
2017-02-12 20:23 ` [PATCH 4/8] Code cleanup: Refactor abbrev_table_read_table cycle Jan Kratochvil
2017-02-17 1:21 ` Pedro Alves
2017-02-12 20:23 ` [PATCH 2/8] Code cleanup: Split create_debug_types_hash_table Jan Kratochvil
2017-02-16 19:33 ` Pedro Alves
2017-02-12 20:23 ` [PATCH 8/8] DWARF-5: DW_FORM_data16 Jan Kratochvil
2017-02-17 12:09 ` Pedro Alves
2017-02-19 21:26 ` Jan Kratochvil
2017-02-20 11:44 ` Pedro Alves
2017-02-17 12:24 ` Pedro Alves
2017-02-12 20:23 ` [PATCH 6/8] DWARF-5: call sites Jan Kratochvil
2017-02-12 20:41 ` Eli Zaretskii
2017-02-17 11:57 ` Pedro Alves
2017-02-19 21:26 ` Jan Kratochvil
2017-02-12 20:23 ` Jan Kratochvil [this message]
2017-02-17 11:59 ` [PATCH 7/8] DWARF-5: Macros Pedro Alves
2017-02-12 20:23 ` [PATCH 5/8] DWARF-5 basic functionality Jan Kratochvil
2017-02-17 11:41 ` Pedro Alves
2017-02-19 21:26 ` Jan Kratochvil
[not found] ` <e23e71b0-3cf7-ca57-c4a7-932d4d2be6a3@redhat.com>
2017-02-20 19:52 ` Jan Kratochvil
2017-02-20 20:07 ` [commit] " Jan Kratochvil
2017-02-12 20:23 ` [PATCH 3/8] Code cleanup: Split dwarf2_ranges_read to a callback Jan Kratochvil
2017-02-17 1:19 ` Pedro Alves
2017-02-19 21:26 ` Jan Kratochvil
2017-02-20 11:11 ` Pedro Alves
2017-02-16 15:23 ` [PATCH 1/8] Rename read_unsigned_leb128 to gdb_read_unsigned_leb128 Pedro Alves
2017-02-16 19:40 ` Jan Kratochvil
2017-02-16 20:01 ` Pedro Alves
2017-02-16 22:54 ` Pedro Alves
2017-02-17 1:28 ` Pedro Alves
2017-02-19 21:25 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=148693101650.9024.921167249134155014.stgit@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=vleschuk@accesssoftek.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox