mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-18 16:53:50 +08:00
* dwarf.c (dwarf_vmatoa64): New function.
(read_and_display_attr_value): Print 8-byte forms as single hex numbers. (process_debug_info): Print type signatures as single hex numbers. * elfcomm.c (byte_get_64): New function. * elfcomm.h (byte_get_64): New function.
This commit is contained in:
@ -1,3 +1,12 @@
|
|||||||
|
2012-02-14 Cary Coutant <ccoutant@google.com>
|
||||||
|
|
||||||
|
* dwarf.c (dwarf_vmatoa64): New function.
|
||||||
|
(read_and_display_attr_value): Print 8-byte forms as single hex
|
||||||
|
numbers.
|
||||||
|
(process_debug_info): Print type signatures as single hex numbers.
|
||||||
|
* elfcomm.c (byte_get_64): New function.
|
||||||
|
* elfcomm.h (byte_get_64): New function.
|
||||||
|
|
||||||
2012-02-11 Kai Tietz <ktietz@redhat.com>
|
2012-02-11 Kai Tietz <ktietz@redhat.com>
|
||||||
|
|
||||||
PR binutils/13657
|
PR binutils/13657
|
||||||
|
@ -169,6 +169,27 @@ dwarf_vmatoa (const char *fmtch, dwarf_vma value)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Format a 64-bit value, given as two 32-bit values, in hex.
|
||||||
|
For reentrancy, this uses a buffer provided by the caller. */
|
||||||
|
|
||||||
|
static const char *
|
||||||
|
dwarf_vmatoa64 (dwarf_vma hvalue, dwarf_vma lvalue, char *buf,
|
||||||
|
unsigned int buf_len)
|
||||||
|
{
|
||||||
|
int len = 0;
|
||||||
|
|
||||||
|
if (hvalue == 0)
|
||||||
|
snprintf (buf, buf_len, "%" DWARF_VMA_FMT "x", lvalue);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
len = snprintf (buf, buf_len, "%" DWARF_VMA_FMT "x", hvalue);
|
||||||
|
snprintf (buf + len, buf_len - len,
|
||||||
|
"%08" DWARF_VMA_FMT "x", lvalue);
|
||||||
|
}
|
||||||
|
|
||||||
|
return buf;
|
||||||
|
}
|
||||||
|
|
||||||
dwarf_vma
|
dwarf_vma
|
||||||
read_leb128 (unsigned char *data, unsigned int *length_return, int sign)
|
read_leb128 (unsigned char *data, unsigned int *length_return, int sign)
|
||||||
{
|
{
|
||||||
@ -1381,9 +1402,12 @@ read_and_display_attr_value (unsigned long attribute,
|
|||||||
case DW_FORM_data8:
|
case DW_FORM_data8:
|
||||||
if (!do_loc)
|
if (!do_loc)
|
||||||
{
|
{
|
||||||
uvalue = byte_get (data, 4);
|
dwarf_vma high_bits;
|
||||||
printf (" 0x%s", dwarf_vmatoa ("x", uvalue));
|
char buf[64];
|
||||||
printf (" 0x%lx", (unsigned long) byte_get (data + 4, 4));
|
|
||||||
|
byte_get_64 (data, &high_bits, &uvalue);
|
||||||
|
printf (" 0x%s",
|
||||||
|
dwarf_vmatoa64 (high_bits, uvalue, buf, sizeof (buf)));
|
||||||
}
|
}
|
||||||
if ((do_loc || do_debug_loc || do_debug_ranges)
|
if ((do_loc || do_debug_loc || do_debug_ranges)
|
||||||
&& num_debug_info_entries == 0)
|
&& num_debug_info_entries == 0)
|
||||||
@ -1453,15 +1477,13 @@ read_and_display_attr_value (unsigned long attribute,
|
|||||||
case DW_FORM_ref_sig8:
|
case DW_FORM_ref_sig8:
|
||||||
if (!do_loc)
|
if (!do_loc)
|
||||||
{
|
{
|
||||||
int i;
|
dwarf_vma high_bits;
|
||||||
printf (" signature: ");
|
char buf[64];
|
||||||
for (i = 0; i < 8; i++)
|
|
||||||
{
|
byte_get_64 (data, &high_bits, &uvalue);
|
||||||
printf ("%02x", (unsigned) byte_get (data, 1));
|
printf (" signature: 0x%s",
|
||||||
data += 1;
|
dwarf_vmatoa64 (high_bits, uvalue, buf, sizeof (buf)));
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
|
||||||
data += 8;
|
data += 8;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2113,7 +2135,8 @@ process_debug_info (struct dwarf_section *section,
|
|||||||
dwarf_vma cu_offset;
|
dwarf_vma cu_offset;
|
||||||
int offset_size;
|
int offset_size;
|
||||||
int initial_length_size;
|
int initial_length_size;
|
||||||
unsigned char signature[8] = { 0 };
|
dwarf_vma signature_high = 0;
|
||||||
|
dwarf_vma signature_low = 0;
|
||||||
dwarf_vma type_offset = 0;
|
dwarf_vma type_offset = 0;
|
||||||
|
|
||||||
hdrptr = start;
|
hdrptr = start;
|
||||||
@ -2147,14 +2170,8 @@ process_debug_info (struct dwarf_section *section,
|
|||||||
|
|
||||||
if (do_types)
|
if (do_types)
|
||||||
{
|
{
|
||||||
int i;
|
byte_get_64 (hdrptr, &signature_high, &signature_low);
|
||||||
|
hdrptr += 8;
|
||||||
for (i = 0; i < 8; i++)
|
|
||||||
{
|
|
||||||
signature[i] = byte_get (hdrptr, 1);
|
|
||||||
hdrptr += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
type_offset = byte_get (hdrptr, offset_size);
|
type_offset = byte_get (hdrptr, offset_size);
|
||||||
hdrptr += offset_size;
|
hdrptr += offset_size;
|
||||||
}
|
}
|
||||||
@ -2191,11 +2208,11 @@ process_debug_info (struct dwarf_section *section,
|
|||||||
printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size);
|
printf (_(" Pointer Size: %d\n"), compunit.cu_pointer_size);
|
||||||
if (do_types)
|
if (do_types)
|
||||||
{
|
{
|
||||||
int i;
|
char buf[64];
|
||||||
printf (_(" Signature: "));
|
|
||||||
for (i = 0; i < 8; i++)
|
printf (_(" Signature: 0x%s\n"),
|
||||||
printf ("%02x", signature[i]);
|
dwarf_vmatoa64 (signature_high, signature_low,
|
||||||
printf ("\n");
|
buf, sizeof (buf)));
|
||||||
printf (_(" Type Offset: 0x%s\n"),
|
printf (_(" Type Offset: 0x%s\n"),
|
||||||
dwarf_vmatoa ("x", type_offset));
|
dwarf_vmatoa ("x", type_offset));
|
||||||
}
|
}
|
||||||
|
@ -238,6 +238,25 @@ byte_get_signed (unsigned char *field, int size)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Return the high-order 32-bits and the low-order 32-bits
|
||||||
|
of an 8-byte value separately. */
|
||||||
|
|
||||||
|
void
|
||||||
|
byte_get_64 (unsigned char *field, elf_vma *high, elf_vma *low)
|
||||||
|
{
|
||||||
|
if (byte_get == byte_get_big_endian)
|
||||||
|
{
|
||||||
|
*high = byte_get_big_endian (field, 4);
|
||||||
|
*low = byte_get_big_endian (field + 4, 4);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
*high = byte_get_little_endian (field + 4, 4);
|
||||||
|
*low = byte_get_little_endian (field, 4);
|
||||||
|
}
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Return the path name for a proxy entry in a thin archive, adjusted
|
/* Return the path name for a proxy entry in a thin archive, adjusted
|
||||||
relative to the path name of the thin archive itself if necessary.
|
relative to the path name of the thin archive itself if necessary.
|
||||||
Always returns a pointer to malloc'ed memory. */
|
Always returns a pointer to malloc'ed memory. */
|
||||||
|
@ -47,6 +47,7 @@ extern elf_vma (*byte_get) (unsigned char *, int);
|
|||||||
extern elf_vma byte_get_signed (unsigned char *, int);
|
extern elf_vma byte_get_signed (unsigned char *, int);
|
||||||
extern elf_vma byte_get_little_endian (unsigned char *, int);
|
extern elf_vma byte_get_little_endian (unsigned char *, int);
|
||||||
extern elf_vma byte_get_big_endian (unsigned char *, int);
|
extern elf_vma byte_get_big_endian (unsigned char *, int);
|
||||||
|
extern void byte_get_64 (unsigned char *, elf_vma *, elf_vma *);
|
||||||
|
|
||||||
#define BYTE_PUT(field, val) byte_put (field, val, sizeof (field))
|
#define BYTE_PUT(field, val) byte_put (field, val, sizeof (field))
|
||||||
#define BYTE_GET(field) byte_get (field, sizeof (field))
|
#define BYTE_GET(field) byte_get (field, sizeof (field))
|
||||||
|
Reference in New Issue
Block a user