}
}
+static int
+size_of_encoded_value (int encoding)
+{
+ switch (encoding & 0x7)
+ {
+ default: /* ??? */
+ case 0: return eh_addr_size;
+ case 2: return 2;
+ case 3: return 4;
+ case 4: return 8;
+ }
+}
+
+static dwarf_vma
+get_encoded_value (unsigned char *data, int encoding)
+{
+ int size = size_of_encoded_value (encoding);
+
+ if (encoding & DW_EH_PE_signed)
+ return byte_get_signed (data, size);
+ else
+ return byte_get (data, size);
+}
+
/* Print a dwarf_vma value (typically an address, offset or length) in
hexadecimal format, followed by a space. The length of the value (and
hence the precision displayed) is determined by the byte_size parameter. */
snprintf (buff, sizeof (buff), "%16.16lx ", val);
#endif
- printf (buff + (byte_size == 4 ? 8 : 0));
+ fputs (buff + (byte_size == 4 ? 8 : 0), stdout);
}
static unsigned long int
decode_location_expression (unsigned char * data,
unsigned int pointer_size,
unsigned long length,
- unsigned long cu_offset)
+ unsigned long cu_offset,
+ struct dwarf_section * section)
{
unsigned op;
unsigned int bytes_read;
printf ("DW_OP_GNU_uninit");
/* FIXME: Is there data associated with this OP ? */
break;
+ case DW_OP_GNU_encoded_addr:
+ {
+ int encoding;
+ dwarf_vma addr;
+
+ encoding = *data++;
+ addr = get_encoded_value (data, encoding);
+ if ((encoding & 0x70) == DW_EH_PE_pcrel)
+ addr += section->address + (data - section->start);
+ data += size_of_encoded_value (encoding);
+
+ printf ("DW_OP_GNU_encoded_addr: fmt:%02x addr:", encoding);
+ print_dwarf_vma (addr, pointer_size);
+ }
+ break;
/* HP extensions. */
case DW_OP_HP_is_value:
need_frame_base = decode_location_expression (block_start,
pointer_size,
uvalue,
- cu_offset);
+ cu_offset, section);
printf (")");
if (need_frame_base && !have_frame_base)
printf (_(" [without DW_AT_frame_base]"));
if (uvalue >= section->size)
warn (_("Offset %lx used as value for DW_AT_import attribute of DIE at offset %lx is too big.\n"),
- uvalue, (long int)(orig_data - section->start));
+ uvalue, (unsigned long) (orig_data - section->start));
else
{
unsigned long abbrev_number;
{
if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in .debug_loc section.\n"),
- (long)(start - section_begin), (long)(next - section_begin));
+ (unsigned long) (start - section_begin),
+ (unsigned long) (next - section_begin));
else if (start > next)
warn (_("There is an overlap [0x%lx - 0x%lx] in .debug_loc section.\n"),
- (long)(start - section_begin), (long)(next - section_begin));
+ (unsigned long) (start - section_begin),
+ (unsigned long) (next - section_begin));
}
start = next;
need_frame_base = decode_location_expression (start,
pointer_size,
length,
- cu_offset);
+ cu_offset, section);
putchar (')');
if (need_frame_base && !has_frame_base)
{
if (start < next)
warn (_("There is a hole [0x%lx - 0x%lx] in %s section.\n"),
- (long)(start - section_begin),
- (long)(next - section_begin), section->name);
+ (unsigned long) (start - section_begin),
+ (unsigned long) (next - section_begin), section->name);
else if (start > next)
warn (_("There is an overlap [0x%lx - 0x%lx] in %s section.\n"),
- (long)(start - section_begin),
- (long)(next - section_begin), section->name);
+ (unsigned long) (start - section_begin),
+ (unsigned long) (next - section_begin), section->name);
}
start = next;
"mm4", "mm5", "mm6", "mm7",
"fcw", "fsw", "mxcsr",
"es", "cs", "ss", "ds", "fs", "gs", NULL, NULL,
- "tr", "ldtr",
- NULL, NULL, NULL,
- "ymm0", "ymm1", "ymm2", "ymm3",
- "ymm4", "ymm5", "ymm6", "ymm7"
+ "tr", "ldtr"
};
static const char *const dwarf_regnames_x86_64[] =
"es", "cs", "ss", "ds", "fs", "gs", NULL, NULL,
"fs.base", "gs.base", NULL, NULL,
"tr", "ldtr",
- "mxcsr", "fcw", "fsw",
- NULL, NULL, NULL,
- "ymm0", "ymm1", "ymm2", "ymm3",
- "ymm4", "ymm5", "ymm6", "ymm7",
- "ymm8", "ymm9", "ymm10", "ymm11",
- "ymm12", "ymm13", "ymm14", "ymm15"
+ "mxcsr", "fcw", "fsw"
};
static const char *const *dwarf_regnames;
printf ("\n");
}
-static int
-size_of_encoded_value (int encoding)
-{
- switch (encoding & 0x7)
- {
- default: /* ??? */
- case 0: return eh_addr_size;
- case 2: return 2;
- case 3: return 4;
- case 4: return 8;
- }
-}
-
-static dwarf_vma
-get_encoded_value (unsigned char *data, int encoding)
-{
- int size = size_of_encoded_value (encoding);
-
- if (encoding & DW_EH_PE_signed)
- return byte_get_signed (data, size);
- else
- return byte_get (data, size);
-}
-
#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
if (! do_debug_frames_interp)
{
printf (" DW_CFA_def_cfa_expression (");
- decode_location_expression (start, eh_addr_size, ul, 0);
+ decode_location_expression (start, eh_addr_size, ul, 0,
+ section);
printf (")\n");
}
fc->cfa_exp = 1;
printf (" DW_CFA_expression: %s (",
regname (reg, 0));
decode_location_expression (start, eh_addr_size,
- ul, 0);
+ ul, 0, section);
printf (")\n");
}
fc->col_type[reg] = DW_CFA_expression;
{
printf (" DW_CFA_val_expression: %s (",
regname (reg, 0));
- decode_location_expression (start, eh_addr_size, ul, 0);
+ decode_location_expression (start, eh_addr_size, ul, 0,
+ section);
printf (")\n");
}
fc->col_type[reg] = DW_CFA_val_expression;
struct dwarf_section_display debug_displays[] =
{
- { { ".debug_abbrev", NULL, 0, 0 },
+ { { ".debug_abbrev", ".zdebug_abbrev", NULL, NULL, 0, 0 },
display_debug_abbrev, 0, 0 },
- { { ".debug_aranges", NULL, 0, 0 },
+ { { ".debug_aranges", ".zdebug_aranges", NULL, NULL, 0, 0 },
display_debug_aranges, 0, 0 },
- { { ".debug_frame", NULL, 0, 0 },
+ { { ".debug_frame", ".zdebug_frame", NULL, NULL, 0, 0 },
display_debug_frames, 1, 0 },
- { { ".debug_info", NULL, 0, 0 },
+ { { ".debug_info", ".zdebug_info", NULL, NULL, 0, 0 },
display_debug_info, 1, 0 },
- { { ".debug_line", NULL, 0, 0 },
+ { { ".debug_line", ".zdebug_line", NULL, NULL, 0, 0 },
display_debug_lines, 0, 0 },
- { { ".debug_pubnames", NULL, 0, 0 },
+ { { ".debug_pubnames", ".zdebug_pubnames", NULL, NULL, 0, 0 },
display_debug_pubnames, 0, 0 },
- { { ".eh_frame", NULL, 0, 0 },
+ { { ".eh_frame", "", NULL, NULL, 0, 0 },
display_debug_frames, 1, 1 },
- { { ".debug_macinfo", NULL, 0, 0 },
+ { { ".debug_macinfo", ".zdebug_macinfo", NULL, NULL, 0, 0 },
display_debug_macinfo, 0, 0 },
- { { ".debug_str", NULL, 0, 0 },
+ { { ".debug_str", ".zdebug_str", NULL, NULL, 0, 0 },
display_debug_str, 0, 0 },
- { { ".debug_loc", NULL, 0, 0 },
+ { { ".debug_loc", ".zdebug_loc", NULL, NULL, 0, 0 },
display_debug_loc, 0, 0 },
- { { ".debug_pubtypes", NULL, 0, 0 },
+ { { ".debug_pubtypes", ".zdebug_pubtypes", NULL, NULL, 0, 0 },
display_debug_pubnames, 0, 0 },
- { { ".debug_ranges", NULL, 0, 0 },
+ { { ".debug_ranges", ".zdebug_ranges", NULL, NULL, 0, 0 },
display_debug_ranges, 0, 0 },
- { { ".debug_static_func", NULL, 0, 0 },
+ { { ".debug_static_func", ".zdebug_static_func", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
- { { ".debug_static_vars", NULL, 0, 0 },
+ { { ".debug_static_vars", ".zdebug_static_vars", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
- { { ".debug_types", NULL, 0, 0 },
+ { { ".debug_types", ".zdebug_types", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 },
- { { ".debug_weaknames", NULL, 0, 0 },
+ { { ".debug_weaknames", ".zdebug_weaknames", NULL, NULL, 0, 0 },
display_debug_not_supported, 0, 0 }
};