From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: binutils@sourceware.org
Cc: Victor Leschuk <vleschuk@accesssoftek.com>
Subject: [PATCH 1/6] DWARF attrs: add delimiter
Date: Wed, 15 Feb 2017 22:58:00 -0000 [thread overview]
Message-ID: <148719947800.19826.950569475344047705.stgit@host1.jankratochvil.net> (raw)
Hi,
currently DWARF attributes are always prefixed by ' '.
But DWARF-5 file name table needs to prefix it by 't':
The File name Table (offset 0x30):
Entry Dir Name
0 0 (indirect line string, offset: 0x0): /home/jkratoch/t/classic.C
1 1 (indirect line string, offset: 0x11): classic.C
Jan
2017-02-12 Jan Kratochvil <jan.kratochvil@redhat.com>
* dwarf.c (display_block): Add parameter delimiter.
(decode_location_expression): Update display_block callers.
(read_and_display_attr_value): Add parameter delimiter.
(read_and_display_attr, display_debug_macro): Update
read_and_display_attr_value caller.
---
binutils/dwarf.c | 50 +++++++++++++++++++++++++-------------------------
1 file changed, 25 insertions(+), 25 deletions(-)
diff --git a/binutils/dwarf.c b/binutils/dwarf.c
index 0184a7a..368c498 100644
--- a/binutils/dwarf.c
+++ b/binutils/dwarf.c
@@ -871,11 +871,11 @@ get_FORM_name (unsigned long form)
static unsigned char *
display_block (unsigned char *data,
dwarf_vma length,
- const unsigned char * const end)
+ const unsigned char * const end, char delimiter)
{
dwarf_vma maxlen;
- printf (_(" %s byte block: "), dwarf_vmatoa ("u", length));
+ printf (_("%c%s byte block: "), delimiter, dwarf_vmatoa ("u", length));
if (data > end)
return (unsigned char *) end;
@@ -1268,7 +1268,7 @@ decode_location_expression (unsigned char * data,
printf ("DW_OP_implicit_value");
uvalue = read_uleb128 (data, &bytes_read, end);
data += bytes_read;
- data = display_block (data, uvalue, end);
+ data = display_block (data, uvalue, end, ' ');
break;
/* GNU extensions. */
@@ -1337,7 +1337,7 @@ decode_location_expression (unsigned char * data,
printf ("DW_OP_GNU_const_type: <0x%s> ",
dwarf_vmatoa ("x", cu_offset + uvalue));
SAFE_BYTE_GET_AND_INC (uvalue, data, 1, end);
- data = display_block (data, uvalue, end);
+ data = display_block (data, uvalue, end, ' ');
break;
case DW_OP_GNU_regval_type:
uvalue = read_uleb128 (data, &bytes_read, end);
@@ -1508,7 +1508,7 @@ read_and_display_attr_value (unsigned long attribute,
debug_info * debug_info_p,
int do_loc,
struct dwarf_section * section,
- struct cu_tu_set * this_set)
+ struct cu_tu_set * this_set, char delimiter)
{
dwarf_vma uvalue = 0;
unsigned char *block_start = NULL;
@@ -1587,12 +1587,12 @@ read_and_display_attr_value (unsigned long attribute,
form = read_uleb128 (data, & bytes_read, end);
data += bytes_read;
if (!do_loc)
- printf (" %s", get_FORM_name (form));
+ printf ("%c%s", delimiter, get_FORM_name (form));
return read_and_display_attr_value (attribute, form, data, end,
cu_offset, pointer_size,
offset_size, dwarf_version,
debug_info_p, do_loc,
- section, this_set);
+ section, this_set, delimiter);
case DW_FORM_GNU_addr_index:
uvalue = read_uleb128 (data, & bytes_read, end);
data += bytes_read;
@@ -1603,12 +1603,12 @@ read_and_display_attr_value (unsigned long attribute,
{
case DW_FORM_ref_addr:
if (!do_loc)
- printf (" <0x%s>", dwarf_vmatoa ("x",uvalue));
+ printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x",uvalue));
break;
case DW_FORM_GNU_ref_alt:
if (!do_loc)
- printf (" <alt 0x%s>", dwarf_vmatoa ("x",uvalue));
+ printf ("%c<alt 0x%s>", delimiter, dwarf_vmatoa ("x",uvalue));
break;
case DW_FORM_ref1:
@@ -1616,14 +1616,14 @@ read_and_display_attr_value (unsigned long attribute,
case DW_FORM_ref4:
case DW_FORM_ref_udata:
if (!do_loc)
- printf (" <0x%s>", dwarf_vmatoa ("x", uvalue + cu_offset));
+ printf ("%c<0x%s>", delimiter, dwarf_vmatoa ("x", uvalue + cu_offset));
break;
case DW_FORM_data4:
case DW_FORM_addr:
case DW_FORM_sec_offset:
if (!do_loc)
- printf (" 0x%s", dwarf_vmatoa ("x", uvalue));
+ printf ("%c0x%s", delimiter, dwarf_vmatoa ("x", uvalue));
break;
case DW_FORM_flag_present:
@@ -1633,7 +1633,7 @@ read_and_display_attr_value (unsigned long attribute,
case DW_FORM_sdata:
case DW_FORM_udata:
if (!do_loc)
- printf (" %s", dwarf_vmatoa ("d", uvalue));
+ printf ("%c%s", delimiter, dwarf_vmatoa ("d", uvalue));
break;
case DW_FORM_ref8:
@@ -1648,7 +1648,7 @@ read_and_display_attr_value (unsigned long attribute,
utmp = uvalue;
if (form == DW_FORM_ref8)
add64 (& high_bits, & utmp, cu_offset);
- printf (" 0x%s",
+ printf ("%c0x%s", delimiter,
dwarf_vmatoa64 (high_bits, utmp, buf, sizeof (buf)));
}
@@ -1666,7 +1666,7 @@ read_and_display_attr_value (unsigned long attribute,
case DW_FORM_string:
if (!do_loc)
- printf (" %.*s", (int) (end - data), data);
+ printf ("%c%.*s", delimiter, (int) (end - data), data);
data += strnlen ((char *) data, end - data) + 1;
break;
@@ -1693,7 +1693,7 @@ read_and_display_attr_value (unsigned long attribute,
if (do_loc)
data = block_start + uvalue;
else
- data = display_block (block_start, uvalue, end);
+ data = display_block (block_start, uvalue, end, delimiter);
break;
case DW_FORM_block1:
@@ -1714,7 +1714,7 @@ read_and_display_attr_value (unsigned long attribute,
if (do_loc)
data = block_start + uvalue;
else
- data = display_block (block_start, uvalue, end);
+ data = display_block (block_start, uvalue, end, delimiter);
break;
case DW_FORM_block2:
@@ -1735,7 +1735,7 @@ read_and_display_attr_value (unsigned long attribute,
if (do_loc)
data = block_start + uvalue;
else
- data = display_block (block_start, uvalue, end);
+ data = display_block (block_start, uvalue, end, delimiter);
break;
case DW_FORM_block4:
@@ -1759,12 +1759,12 @@ read_and_display_attr_value (unsigned long attribute,
if (do_loc)
data = block_start + uvalue;
else
- data = display_block (block_start, uvalue, end);
+ data = display_block (block_start, uvalue, end, delimiter);
break;
case DW_FORM_strp:
if (!do_loc)
- printf (_(" (indirect string, offset: 0x%s): %s"),
+ printf (_("%c(indirect string, offset: 0x%s): %s"), delimiter,
dwarf_vmatoa ("x", uvalue),
fetch_indirect_string (uvalue));
break;
@@ -1775,7 +1775,7 @@ read_and_display_attr_value (unsigned long attribute,
const char *suffix = strrchr (section->name, '.');
int dwo = (suffix && strcmp (suffix, ".dwo") == 0) ? 1 : 0;
- printf (_(" (indexed string: 0x%s): %s"),
+ printf (_("%c(indexed string: 0x%s): %s"), delimiter,
dwarf_vmatoa ("x", uvalue),
fetch_indexed_string (uvalue, this_set, offset_size, dwo));
}
@@ -1783,7 +1783,7 @@ read_and_display_attr_value (unsigned long attribute,
case DW_FORM_GNU_strp_alt:
if (!do_loc)
- printf (_(" (alt indirect string, offset: 0x%s)"),
+ printf (_("%c(alt indirect string, offset: 0x%s)"), delimiter,
dwarf_vmatoa ("x", uvalue));
break;
@@ -1798,7 +1798,7 @@ read_and_display_attr_value (unsigned long attribute,
char buf[64];
SAFE_BYTE_GET64 (data, &high_bits, &uvalue, end);
- printf (" signature: 0x%s",
+ printf ("%csignature: 0x%s", delimiter,
dwarf_vmatoa64 (high_bits, uvalue, buf, sizeof (buf)));
}
data += 8;
@@ -1806,7 +1806,7 @@ read_and_display_attr_value (unsigned long attribute,
case DW_FORM_GNU_addr_index:
if (!do_loc)
- printf (_(" (addr_index: 0x%s): %s"),
+ printf (_("%c(addr_index: 0x%s): %s"), delimiter,
dwarf_vmatoa ("x", uvalue),
fetch_indexed_value (uvalue * pointer_size, pointer_size));
break;
@@ -2233,7 +2233,7 @@ read_and_display_attr (unsigned long attribute,
data = read_and_display_attr_value (attribute, form, data, end,
cu_offset, pointer_size, offset_size,
dwarf_version, debug_info_p,
- do_loc, section, this_set);
+ do_loc, section, this_set, ' ');
if (!do_loc)
printf ("\n");
return data;
@@ -4332,7 +4332,7 @@ display_debug_macro (struct dwarf_section *section,
= read_and_display_attr_value (0, val,
curr, end, 0, 0, offset_size,
version, NULL, 0, NULL,
- NULL);
+ NULL, ' ');
if (n != nargs - 1)
printf (",");
}
next reply other threads:[~2017-02-15 22:58 UTC|newest]
Thread overview: 32+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-15 22:58 Jan Kratochvil [this message]
2017-02-15 22:58 ` [PATCH 5/6] DWARF-5: Macros Jan Kratochvil
2017-02-22 11:50 ` Nick Clifton
2017-02-23 22:13 ` [commit] " Jan Kratochvil
2017-02-15 22:58 ` [PATCH 6/6] DWARF-5: DW_FORM_data16 Jan Kratochvil
2017-02-22 11:51 ` Nick Clifton
2017-02-23 22:13 ` [commit] " Jan Kratochvil
2017-02-15 22:58 ` [PATCH 2/6] Display user op byte Jan Kratochvil
2017-02-22 11:30 ` Nick Clifton
2017-02-22 19:24 ` [commit] " Jan Kratochvil
2017-02-15 22:58 ` [PATCH 4/6] DWARF-5: call sites Jan Kratochvil
2017-02-22 11:49 ` Nick Clifton
2017-02-23 22:12 ` [commit] " Jan Kratochvil
2017-02-15 22:58 ` [PATCH 3/6] DWARF-5 basic functionality Jan Kratochvil
2017-02-22 11:36 ` Nick Clifton
2017-02-22 18:42 ` Jan Kratochvil
2017-02-22 11:47 ` Nick Clifton
2017-02-22 19:13 ` [patch] dwarf.c: Use more dwarf_vma [Re: [PATCH 3/6] DWARF-5 basic functionality] Jan Kratochvil
2017-02-23 16:34 ` Nick Clifton
2017-02-23 16:35 ` Nick Clifton
2017-02-23 20:38 ` [commit] " Jan Kratochvil
2017-02-23 22:12 ` [commit] [PATCH 3/6] DWARF-5 basic functionality Jan Kratochvil
2017-02-27 21:58 ` Maciej W. Rozycki
2017-02-27 22:24 ` [obv] DWARF-5: Fix compilation with GCC 4.4.7 [Re: [commit] [PATCH 3/6] DWARF-5 basic functionality] Jan Kratochvil
2017-02-16 10:59 ` [PATCH 1/6] DWARF attrs: add delimiter Nick Clifton
2017-02-16 20:13 ` Jan Kratochvil
2017-02-17 8:37 ` Nick Clifton
2017-02-18 19:47 ` [patch] DWARF-5: testcase [Re: [PATCH 1/6] DWARF attrs: add delimiter] Jan Kratochvil
2017-02-21 9:44 ` Nick Clifton
2017-02-23 22:17 ` [commit] [patch] DWARF-5: testcase Jan Kratochvil
2017-02-22 11:48 ` [PATCH 1/6] DWARF attrs: add delimiter Nick Clifton
2017-02-23 22:08 ` [commit] " 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=148719947800.19826.950569475344047705.stgit@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=binutils@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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).