print_dwarf_vma (dwarf_vma val, unsigned byte_size)
{
static char buff[18];
+ int offset = 0;
/* Printf does not have a way of specifiying a maximum field width for an
integer value, so we print the full value into a buffer and then select
the precision we need. */
#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
-#ifndef __MSVCRT__
+#ifndef __MINGW32__
snprintf (buff, sizeof (buff), "%16.16llx ", val);
#else
snprintf (buff, sizeof (buff), "%016I64x ", val);
snprintf (buff, sizeof (buff), "%16.16lx ", val);
#endif
- fputs (buff + (byte_size == 4 ? 8 : 0), stdout);
+ if (byte_size != 0)
+ {
+ if (byte_size > 0 && byte_size <= 8)
+ offset = 16 - 2 * byte_size;
+ else
+ error ("Wrong size in print_dwarf_vma");
+ }
+
+ fputs (buff + offset, stdout);
}
+#if __STDC_VERSION__ >= 199901L || (defined(__GNUC__) && __GNUC__ >= 2)
+#ifndef __MINGW32__
+#define DWARF_VMA_FMT "ll"
+#else
+#define DWARF_VMA_FMT "I64"
+#endif
+#else
+#define DWARF_VMA_FMT "l"
+#endif
+
static const char *
-dwarf_vmatoa (const char *fmtch, bfd_vma value)
+dwarf_vmatoa (const char *fmtch, dwarf_vma value)
{
/* As dwarf_vmatoa is used more then once in a printf call
for output, we are cycling through an fixed array of pointers
for return address. */
static int buf_pos = 0;
- static struct dwarf_vmatoa_buf {
+ static struct dwarf_vmatoa_buf
+ {
char place[64];
} buf[16];
char fmt[32];
char *ret;
- sprintf (fmt, "%%%s%s", BFD_VMA_FMT, fmtch);
+ sprintf (fmt, "%%%s%s", DWARF_VMA_FMT, fmtch);
ret = buf[buf_pos++].place;
- buf_pos %= ARRAY_SIZE(buf);
+ buf_pos %= ARRAY_SIZE (buf);
snprintf (ret, sizeof (buf[0].place), fmt, value);
return ret;
}
-bfd_vma
+dwarf_vma
read_leb128 (unsigned char *data, unsigned int *length_return, int sign)
{
- bfd_vma result = 0;
+ dwarf_vma result = 0;
unsigned int num_read = 0;
unsigned int shift = 0;
unsigned char byte;
byte = *data++;
num_read++;
- result |= ((bfd_vma) (byte & 0x7f)) << shift;
+ result |= ((dwarf_vma) (byte & 0x7f)) << shift;
shift += 7;
return result;
}
+/* Create a signed version to avoid painful typecasts. */
+static dwarf_signed_vma
+read_sleb128 (unsigned char *data, unsigned int *length_return)
+{
+ return (dwarf_signed_vma) read_leb128 (data, length_return, 1);
+}
+
typedef struct State_Machine_Registers
{
- unsigned long address;
+ dwarf_vma address;
unsigned int file;
unsigned int line;
unsigned int column;
unsigned int bytes_read;
unsigned int len;
unsigned char *name;
- bfd_vma adr;
+ dwarf_vma adr;
len = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
printf (" %d\t", ++state_machine_regs.last_file_entry);
name = data;
data += strlen ((char *) data) + 1;
- printf ("%" BFD_VMA_FMT "u\t", read_leb128 (data, & bytes_read, 0));
+ printf ("%s\t", dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
data += bytes_read;
- printf ("%" BFD_VMA_FMT "u\t",
- read_leb128 (data, & bytes_read, 0));
+ printf ("%s\t", dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
data += bytes_read;
- printf ("%" BFD_VMA_FMT "u\t", read_leb128 (data, & bytes_read, 0));
+ printf ("%s\t", dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
printf ("%s\n\n", name);
break;
case DW_LNE_set_discriminator:
printf (_("set Discriminator to %s\n"),
- dwarf_vmatoa ("u",
- read_leb128 (data, & bytes_read, 0)));
+ dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
break;
/* HP extensions. */
}
static const char *
-fetch_indirect_string (bfd_vma offset)
+fetch_indirect_string (dwarf_vma offset)
{
struct dwarf_section *section = &debug_displays [str].section;
offset -= section->address;
if (offset > section->size)
{
- warn (_("DW_FORM_strp offset too big: %lx\n"), (long) offset);
+ warn (_("DW_FORM_strp offset too big: %s\n"),
+ dwarf_vmatoa ("x", offset));
return _("<offset is too big>");
}
abbrev_entry *entry;
entry = (abbrev_entry *) malloc (sizeof (*entry));
-
if (entry == NULL)
/* ugg */
return;
abbrev_attr *attr;
attr = (abbrev_attr *) malloc (sizeof (*attr));
-
if (attr == NULL)
/* ugg */
return;
}
static unsigned char *
-display_block (unsigned char *data, unsigned long length)
+display_block (unsigned char *data, dwarf_vma length)
{
- printf (_(" %lu byte block: "), length);
+ printf (_(" %s byte block: "), dwarf_vmatoa ("u", length));
while (length --)
printf ("%lx ", (unsigned long) byte_get (data++, 1));
unsigned int pointer_size,
unsigned int offset_size,
int dwarf_version,
- bfd_vma length,
- bfd_vma cu_offset,
+ dwarf_vma length,
+ dwarf_vma cu_offset,
struct dwarf_section * section)
{
unsigned op;
unsigned int bytes_read;
- bfd_vma uvalue;
+ dwarf_vma uvalue;
unsigned char *end = data + length;
int need_frame_base = 0;
data += 8;
break;
case DW_OP_constu:
- printf ("DW_OP_constu: %" BFD_VMA_FMT "u",
- read_leb128 (data, &bytes_read, 0));
+ printf ("DW_OP_constu: %s",
+ dwarf_vmatoa ("u", read_leb128 (data, &bytes_read, 0)));
data += bytes_read;
break;
case DW_OP_consts:
- printf ("DW_OP_consts: %" BFD_VMA_FMT "d",
- read_leb128 (data, &bytes_read, 1));
+ printf ("DW_OP_consts: %s",
+ dwarf_vmatoa ("d", read_sleb128 (data, &bytes_read)));
data += bytes_read;
break;
case DW_OP_dup:
printf ("DW_OP_plus");
break;
case DW_OP_plus_uconst:
- printf ("DW_OP_plus_uconst: %" BFD_VMA_FMT "u",
- read_leb128 (data, &bytes_read, 0));
+ printf ("DW_OP_plus_uconst: %s",
+ dwarf_vmatoa ("u", read_leb128 (data, &bytes_read, 0)));
data += bytes_read;
break;
case DW_OP_shl:
case DW_OP_breg29:
case DW_OP_breg30:
case DW_OP_breg31:
- printf ("DW_OP_breg%d (%s): %" BFD_VMA_FMT "d",
+ printf ("DW_OP_breg%d (%s): %s",
op - DW_OP_breg0,
regname (op - DW_OP_breg0, 1),
- read_leb128 (data, &bytes_read, 1));
+ dwarf_vmatoa ("d", (dwarf_signed_vma)
+ read_leb128 (data, &bytes_read, 1)));
data += bytes_read;
break;
case DW_OP_regx:
uvalue = read_leb128 (data, &bytes_read, 0);
data += bytes_read;
- printf ("DW_OP_regx: %" BFD_VMA_FMT "u (%s)",
- uvalue, regname (uvalue, 1));
+ printf ("DW_OP_regx: %s (%s)",
+ dwarf_vmatoa ("u", uvalue), regname (uvalue, 1));
break;
case DW_OP_fbreg:
need_frame_base = 1;
- printf ("DW_OP_fbreg: %" BFD_VMA_FMT "d",
- read_leb128 (data, &bytes_read, 1));
+ printf ("DW_OP_fbreg: %s",
+ dwarf_vmatoa ("d", read_sleb128 (data, &bytes_read)));
data += bytes_read;
break;
case DW_OP_bregx:
uvalue = read_leb128 (data, &bytes_read, 0);
data += bytes_read;
- printf ("DW_OP_bregx: %" BFD_VMA_FMT "u (%s) %" BFD_VMA_FMT "d",
- uvalue, regname (uvalue, 1),
- read_leb128 (data, &bytes_read, 1));
+ printf ("DW_OP_bregx: %s (%s) %s",
+ dwarf_vmatoa ("u", uvalue), regname (uvalue, 1),
+ dwarf_vmatoa ("d", read_sleb128 (data, &bytes_read)));
data += bytes_read;
break;
case DW_OP_piece:
- printf ("DW_OP_piece: %" BFD_VMA_FMT "u",
- read_leb128 (data, &bytes_read, 0));
+ printf ("DW_OP_piece: %s",
+ dwarf_vmatoa ("u", read_leb128 (data, &bytes_read, 0)));
data += bytes_read;
break;
case DW_OP_deref_size:
case DW_OP_call2:
/* XXX: Strictly speaking for 64-bit DWARF3 files
this ought to be an 8-byte wide computation. */
- printf ("DW_OP_call2: <0x%" BFD_VMA_FMT "x>",
- (bfd_signed_vma) byte_get (data, 2) + cu_offset);
+ printf ("DW_OP_call2: <0x%s>",
+ dwarf_vmatoa ("x", (dwarf_signed_vma) byte_get (data, 2)
+ + cu_offset));
data += 2;
break;
case DW_OP_call4:
/* XXX: Strictly speaking for 64-bit DWARF3 files
this ought to be an 8-byte wide computation. */
- printf ("DW_OP_call4: <0x%" BFD_VMA_FMT "x>",
- (bfd_signed_vma) byte_get (data, 4) + cu_offset);
+ printf ("DW_OP_call4: <0x%s>",
+ dwarf_vmatoa ("x", (dwarf_signed_vma) byte_get (data, 4)
+ + cu_offset));
data += 4;
break;
case DW_OP_call_ref:
}
if (dwarf_version == 2)
{
- printf ("DW_OP_call_ref: <0x%lx>",
- (long) byte_get (data, pointer_size));
+ printf ("DW_OP_call_ref: <0x%s>",
+ dwarf_vmatoa ("x", byte_get (data, pointer_size)));
data += pointer_size;
}
else
{
- printf ("DW_OP_call_ref: <0x%lx>",
- (long) byte_get (data, offset_size));
+ printf ("DW_OP_call_ref: <0x%s>",
+ dwarf_vmatoa ("x", byte_get (data, offset_size)));
data += offset_size;
}
break;
break;
case DW_OP_bit_piece:
printf ("DW_OP_bit_piece: ");
- printf ("size: %" BFD_VMA_FMT "u ",
- read_leb128 (data, &bytes_read, 0));
+ printf ("size: %s ",
+ dwarf_vmatoa ("u", read_leb128 (data, &bytes_read, 0)));
data += bytes_read;
- printf ("offset: %" BFD_VMA_FMT "u ",
- read_leb128 (data, &bytes_read, 0));
+ printf ("offset: %s ",
+ dwarf_vmatoa ("u", read_leb128 (data, &bytes_read, 0)));
data += bytes_read;
break;
{
int encoding;
dwarf_vma addr;
-
+
encoding = *data++;
addr = get_encoded_value (data, encoding, section);
data += size_of_encoded_value (encoding);
}
if (dwarf_version == 2)
{
- printf ("DW_OP_GNU_implicit_pointer: "
- "<0x%" BFD_VMA_FMT "x> %" BFD_VMA_FMT "d",
- (bfd_vma) byte_get (data, pointer_size),
- (bfd_signed_vma) read_leb128 (data + pointer_size,
- &bytes_read, 1));
+ printf ("DW_OP_GNU_implicit_pointer: <0x%s> %s",
+ dwarf_vmatoa ("x", byte_get (data, pointer_size)),
+ dwarf_vmatoa ("d", read_sleb128 (data + pointer_size,
+ &bytes_read)));
data += pointer_size + bytes_read;
}
else
{
- printf ("DW_OP_GNU_implicit_pointer: "
- "<0x%" BFD_VMA_FMT "x> %" BFD_VMA_FMT "d",
- (bfd_vma) byte_get (data, offset_size),
- (bfd_signed_vma) read_leb128 (data + offset_size,
- &bytes_read, 1));
+ printf ("DW_OP_GNU_implicit_pointer: <0x%s> %s",
+ dwarf_vmatoa ("x", byte_get (data, offset_size)),
+ dwarf_vmatoa ("d", read_sleb128 (data + offset_size,
+ &bytes_read)));
data += offset_size + bytes_read;
}
break;
read_and_display_attr_value (unsigned long attribute,
unsigned long form,
unsigned char * data,
- bfd_vma cu_offset,
- bfd_vma pointer_size,
- bfd_vma offset_size,
+ dwarf_vma cu_offset,
+ dwarf_vma pointer_size,
+ dwarf_vma offset_size,
int dwarf_version,
debug_info * debug_info_p,
int do_loc,
struct dwarf_section * section)
{
- bfd_vma uvalue = 0;
+ dwarf_vma uvalue = 0;
unsigned char *block_start = NULL;
unsigned char * orig_data = data;
unsigned int bytes_read;
data += offset_size;
}
else
- {
- error (_("Internal error: DWARF version is not 2, 3 or 4.\n"));
- }
+ error (_("Internal error: DWARF version is not 2, 3 or 4.\n"));
+
break;
case DW_FORM_addr:
{
case DW_FORM_ref_addr:
if (!do_loc)
- printf (" <0x%" BFD_VMA_FMT "x>", uvalue);
+ printf (" <0x%s>", dwarf_vmatoa ("x",uvalue));
break;
case DW_FORM_ref1:
case DW_FORM_ref4:
case DW_FORM_ref_udata:
if (!do_loc)
- printf (" <0x%" BFD_VMA_FMT "x>", uvalue + cu_offset);
+ printf (" <0x%s>", 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%" BFD_VMA_FMT "x", uvalue);
+ printf (" 0x%s", dwarf_vmatoa ("x", uvalue));
break;
case DW_FORM_flag_present:
case DW_FORM_sdata:
case DW_FORM_udata:
if (!do_loc)
- printf (" %" BFD_VMA_FMT "d", uvalue);
+ printf (" %s", dwarf_vmatoa ("d", uvalue));
break;
case DW_FORM_ref8:
if (!do_loc)
{
uvalue = byte_get (data, 4);
- printf (" 0x%" BFD_VMA_FMT "x", uvalue);
+ printf (" 0x%s", dwarf_vmatoa ("x", uvalue));
printf (" 0x%lx", (unsigned long) byte_get (data + 4, 4));
}
if ((do_loc || do_debug_loc || do_debug_ranges)
if (sizeof (uvalue) == 8)
uvalue = byte_get (data, 8);
else
- error (_("DW_FORM_data8 is unsupported when sizeof (bfd_vma) != 8\n"));
+ error (_("DW_FORM_data8 is unsupported when sizeof (dwarf_vma) != 8\n"));
}
data += 8;
break;
if (lmax == 0 || num >= lmax)
{
lmax += 1024;
- debug_info_p->loc_offsets = (bfd_vma *)
+ debug_info_p->loc_offsets = (dwarf_vma *)
xcrealloc (debug_info_p->loc_offsets,
lmax, sizeof (*debug_info_p->loc_offsets));
debug_info_p->have_frame_base = (int *)
if (lmax == 0 || num >= lmax)
{
lmax += 1024;
- debug_info_p->range_lists = (bfd_vma *)
+ debug_info_p->range_lists = (dwarf_vma *)
xcrealloc (debug_info_p->range_lists,
lmax, sizeof (*debug_info_p->range_lists));
debug_info_p->max_range_lists = lmax;
case DW_LANG_Upc: printf ("(Unified Parallel C)"); break;
default:
if (uvalue >= DW_LANG_lo_user && uvalue <= DW_LANG_hi_user)
- printf ("(implementation defined: %" BFD_VMA_FMT "x)", uvalue);
+ printf ("(implementation defined: %s)",
+ dwarf_vmatoa ("x", uvalue));
else
- printf ("(Unknown: %" BFD_VMA_FMT "x)", uvalue);
+ printf ("(Unknown: %s)", dwarf_vmatoa ("x", uvalue));
break;
}
break;
read_and_display_attr (unsigned long attribute,
unsigned long form,
unsigned char * data,
- bfd_vma cu_offset,
- bfd_vma pointer_size,
- bfd_vma offset_size,
+ dwarf_vma cu_offset,
+ dwarf_vma pointer_size,
+ dwarf_vma offset_size,
int dwarf_version,
debug_info * debug_info_p,
int do_loc,
unsigned char *hdrptr;
unsigned char *tags;
int level;
- bfd_vma cu_offset;
+ dwarf_vma cu_offset;
int offset_size;
int initial_length_size;
unsigned char signature[8] = { 0 };
num_debug_info_entries = num_units;
if (!do_loc)
- {
- printf ("\n");
- }
+ printf ("\n");
return 1;
}
data += strlen ((char *) data) + 1;
- printf ("%" BFD_VMA_FMT "u\t",
- read_leb128 (data, & bytes_read, 0));
+ printf ("%s\t",
+ dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
data += bytes_read;
- printf ("%" BFD_VMA_FMT "u\t",
- read_leb128 (data, & bytes_read, 0));
+ printf ("%s\t",
+ dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
data += bytes_read;
- printf ("%" BFD_VMA_FMT "u\t",
- read_leb128 (data, & bytes_read, 0));
+ printf ("%s\t",
+ dwarf_vmatoa ("u", read_leb128 (data, & bytes_read, 0)));
data += bytes_read;
printf ("%s\n", name);
}
while (data < end_of_sequence)
{
unsigned char op_code;
- int adv;
- unsigned long int uladv;
+ dwarf_signed_vma adv;
+ dwarf_vma uladv;
unsigned int bytes_read;
op_code = *data++;
{
uladv *= linfo.li_min_insn_length;
state_machine_regs.address += uladv;
- printf (_(" Special opcode %d: advance Address by %lu to 0x%lx"),
- op_code, uladv, state_machine_regs.address);
+ printf (_(" Special opcode %d: "
+ "advance Address by %s to 0x%s"),
+ op_code, dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address));
}
else
{
state_machine_regs.op_index
= (state_machine_regs.op_index + uladv)
% linfo.li_max_ops_per_insn;
- printf (_(" Special opcode %d: advance Address by %lu to 0x%lx[%d]"),
- op_code, uladv, state_machine_regs.address,
+ printf (_(" Special opcode %d: "
+ "advance Address by %s to 0x%s[%d]"),
+ op_code, dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address),
state_machine_regs.op_index);
}
adv = (op_code % linfo.li_line_range) + linfo.li_line_base;
state_machine_regs.line += adv;
- printf (_(" and Line by %d to %d\n"),
- adv, state_machine_regs.line);
+ printf (_(" and Line by %s to %d\n"),
+ dwarf_vmatoa ("d", adv), state_machine_regs.line);
}
else switch (op_code)
{
{
uladv *= linfo.li_min_insn_length;
state_machine_regs.address += uladv;
- printf (_(" Advance PC by %lu to 0x%lx\n"), uladv,
- state_machine_regs.address);
+ printf (_(" Advance PC by %s to 0x%s\n"),
+ dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address));
}
else
{
state_machine_regs.op_index
= (state_machine_regs.op_index + uladv)
% linfo.li_max_ops_per_insn;
- printf (_(" Advance PC by %lu to 0x%lx[%d]\n"), uladv,
- state_machine_regs.address,
+ printf (_(" Advance PC by %s to 0x%s[%d]\n"),
+ dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address),
state_machine_regs.op_index);
}
break;
case DW_LNS_advance_line:
- adv = read_leb128 (data, & bytes_read, 1);
+ adv = read_sleb128 (data, & bytes_read);
data += bytes_read;
state_machine_regs.line += adv;
- printf (_(" Advance Line by %d to %d\n"), adv,
- state_machine_regs.line);
+ printf (_(" Advance Line by %s to %d\n"),
+ dwarf_vmatoa ("d", adv),
+ state_machine_regs.line);
break;
case DW_LNS_set_file:
adv = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
- printf (_(" Set File Name to entry %d in the File Name Table\n"),
- adv);
+ printf (_(" Set File Name to entry %s in the File Name Table\n"),
+ dwarf_vmatoa ("d", adv));
state_machine_regs.file = adv;
break;
case DW_LNS_set_column:
uladv = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
- printf (_(" Set column to %lu\n"), uladv);
+ printf (_(" Set column to %s\n"),
+ dwarf_vmatoa ("u", uladv));
state_machine_regs.column = uladv;
break;
case DW_LNS_negate_stmt:
adv = state_machine_regs.is_stmt;
adv = ! adv;
- printf (_(" Set is_stmt to %d\n"), adv);
+ printf (_(" Set is_stmt to %s\n"), dwarf_vmatoa ("d", adv));
state_machine_regs.is_stmt = adv;
break;
{
uladv *= linfo.li_min_insn_length;
state_machine_regs.address += uladv;
- printf (_(" Advance PC by constant %lu to 0x%lx\n"), uladv,
- state_machine_regs.address);
+ printf (_(" Advance PC by constant %s to 0x%s\n"),
+ dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address));
}
else
{
state_machine_regs.op_index
= (state_machine_regs.op_index + uladv)
% linfo.li_max_ops_per_insn;
- printf (_(" Advance PC by constant %lu to 0x%lx[%d]\n"),
- uladv, state_machine_regs.address,
+ printf (_(" Advance PC by constant %s to 0x%s[%d]\n"),
+ dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address),
state_machine_regs.op_index);
}
break;
data += 2;
state_machine_regs.address += uladv;
state_machine_regs.op_index = 0;
- printf (_(" Advance PC by fixed size amount %lu to 0x%lx\n"),
- uladv, state_machine_regs.address);
+ printf (_(" Advance PC by fixed size amount %s to 0x%s\n"),
+ dwarf_vmatoa ("u", uladv),
+ dwarf_vmatoa ("x", state_machine_regs.address));
break;
case DW_LNS_set_prologue_end:
case DW_LNS_set_isa:
uladv = read_leb128 (data, & bytes_read, 0);
data += bytes_read;
- printf (_(" Set ISA to %lu\n"), uladv);
+ printf (_(" Set ISA to %s\n"), dwarf_vmatoa ("u", uladv));
break;
default:
for (i = standard_opcodes[op_code - 1]; i > 0 ; --i)
{
- printf ("0x%" BFD_VMA_FMT "x%s",
- read_leb128 (data, &bytes_read, 0),
+ printf ("0x%s%s", dwarf_vmatoa ("x", read_leb128 (data,
+ &bytes_read, 0)),
i == 1 ? "" : ", ");
data += bytes_read;
}
typedef struct
{
- unsigned char *name;
- unsigned int directory_index;
- unsigned int modification_date;
- unsigned int length;
+ unsigned char *name;
+ unsigned int directory_index;
+ unsigned int modification_date;
+ unsigned int length;
} File_Entry;
/* Output a decoded representation of the .debug_line section. */
break;
case DW_LNS_advance_line:
- adv = read_leb128 (data, & bytes_read, 1);
+ adv = read_sleb128 (data, & bytes_read);
data += bytes_read;
state_machine_regs.line += adv;
break;
for (i = standard_opcodes[op_code - 1]; i > 0 ; --i)
{
- printf ("0x%" BFD_VMA_FMT "x%s",
- read_leb128 (data, &bytes_read, 0),
+ printf ("0x%s%s", dwarf_vmatoa ("x", read_leb128 (data,
+ &bytes_read, 0)),
i == 1 ? "" : ", ");
data += bytes_read;
}
if (!do_wide || (fileNameLength <= MAX_FILENAME_LENGTH))
{
if (linfo.li_max_ops_per_insn == 1)
- printf ("%-35s %11d %#18lx\n", newFileName,
- state_machine_regs.line,
+ printf ("%-35s %11d %#18" DWARF_VMA_FMT "x\n",
+ newFileName, state_machine_regs.line,
state_machine_regs.address);
else
- printf ("%-35s %11d %#18lx[%d]\n", newFileName,
- state_machine_regs.line,
+ printf ("%-35s %11d %#18" DWARF_VMA_FMT "x[%d]\n",
+ newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
}
else
{
if (linfo.li_max_ops_per_insn == 1)
- printf ("%s %11d %#18lx\n", newFileName,
- state_machine_regs.line,
+ printf ("%s %11d %#18" DWARF_VMA_FMT "x\n",
+ newFileName, state_machine_regs.line,
state_machine_regs.address);
else
- printf ("%s %11d %#18lx[%d]\n", newFileName,
- state_machine_regs.line,
+ printf ("%s %11d %#18" DWARF_VMA_FMT "x[%d]\n",
+ newFileName, state_machine_regs.line,
state_machine_regs.address,
state_machine_regs.op_index);
}
sorting purposes. */
struct range_entry
- {
- /* The debug_information[x].range_lists[y] value. */
- unsigned long ranges_offset;
+{
+ /* The debug_information[x].range_lists[y] value. */
+ unsigned long ranges_offset;
- /* Original debug_information to find parameters of the data. */
- debug_info *debug_info_p;
- };
+ /* Original debug_information to find parameters of the data. */
+ debug_info *debug_info_p;
+};
/* Sort struct range_entry in ascending order of its RANGES_OFFSET. */
#define GET(N) byte_get (start, N); start += N
#define LEB() read_leb128 (start, & length_return, 0); start += length_return
-#define SLEB() read_leb128 (start, & length_return, 1); start += length_return
+#define SLEB() read_sleb128 (start, & length_return); start += length_return
static int
display_debug_frames (struct dwarf_section *section,
};
const char *p;
-
+
p = names;
while (*p)
{
const debug_dump_long_opts * entry;
-
+
for (entry = opts_table; entry->option; entry++)
{
size_t len = strlen (entry->option);
-
+
if (strncmp (p, entry->option, len) == 0
&& (p[len] == ',' || p[len] == '\0'))
{
* entry->variable |= entry->val;
-
+
/* The --debug-dump=frames-interp option also
enables the --debug-dump=frames option. */
if (do_debug_frames_interp)
break;
}
}
-
+
if (entry->option == NULL)
{
warn (_("Unrecognized debug option '%s'\n"), p);
if (p == NULL)
break;
}
-
+
if (*p == ',')
p++;
}
case 'i':
do_debug_info = 1;
break;
-
+
case 'a':
do_debug_abbrevs = 1;
break;
-
+
case 'l':
do_debug_lines |= FLAG_DEBUG_LINES_RAW;
break;
-
+
case 'L':
do_debug_lines |= FLAG_DEBUG_LINES_DECODED;
break;
-
+
case 'p':
do_debug_pubnames = 1;
break;
-
+
case 't':
do_debug_pubtypes = 1;
break;
-
+
case 'r':
do_debug_aranges = 1;
break;
-
+
case 'R':
do_debug_ranges = 1;
break;
-
+
case 'F':
do_debug_frames_interp = 1;
case 'f':
do_debug_frames = 1;
break;
-
+
case 'm':
do_debug_macinfo = 1;
break;
-
+
case 's':
do_debug_str = 1;
break;
-
+
case 'o':
do_debug_loc = 1;
break;
-
+
default:
warn (_("Unrecognized debug option '%s'\n"), optarg);
break;