static char *
format_dwarf_addr (Dwfl_Module *dwflmod,
- int address_size, Dwarf_Addr address)
+ int address_size, Dwarf_Addr address, bool tls)
{
/* See if there is a name we can give for this address. */
GElf_Sym sym;
const char *name = print_address_names
- ? dwfl_module_addrsym (dwflmod, address, &sym, NULL) : NULL;
+ ? ((tls ? dwfl_module_addrsym_tls : dwfl_module_addrsym)
+ (dwflmod, address, &sym, NULL))
+ : NULL;
if (name != NULL)
sym.st_value = address - sym.st_value;
if (op == DW_OP_addr)
{
- char *a = format_dwarf_addr (dwflmod, 0, addr);
+ char *a = format_dwarf_addr
+ (dwflmod, 0, addr,
+ len > 0 && (*data == DW_OP_GNU_push_tls_address
+ || *data == DW_OP_form_tls_address));
printf ("%*s[%4" PRIuMAX "] %s %s\n",
indent, "", (uintmax_t) offset, known[op], a);
free (a);
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- char *b = format_dwarf_addr (dwflmod, address_size, end);
+ char *b = format_dwarf_addr (dwflmod, address_size, end, false);
printf (gettext (" [%6tx] base address %s\n"), offset, b);
free (b);
}
first = true;
else
{
- char *b = format_dwarf_addr (dwflmod, address_size, begin);
- char *e = format_dwarf_addr (dwflmod, address_size, end);
+ char *b = format_dwarf_addr (dwflmod, address_size, begin, false);
+ char *e = format_dwarf_addr (dwflmod, address_size, end, false);
/* We have an address range entry. */
if (first) /* First address range entry in a list. */
printf (gettext (" [%6tx] %s..%s\n"), offset, b, e);
dwarf_errmsg (-1));
return DWARF_CB_ABORT;
}
- char *a = format_dwarf_addr (cbargs->dwflmod, cbargs->addrsize, addr);
+ char *a = format_dwarf_addr (cbargs->dwflmod, cbargs->addrsize,
+ addr, false);
printf (" %*s%-20s %s\n",
(int) (level * 2), "", dwarf_attr_string (attr), a);
free (a);
printf (" %*s%-20s ",
(int) (level * 2), "", dwarf_attr_string (attr));
- print_block (block.length, block.data);
switch (attr)
{
12 + level * 2, 12 + level * 2,
cbargs->addrsize, block.length, block.data);
break;
+
+ default:
+ print_block (block.length, block.data);
+ break;
}
break;
line += line_increment;
address += address_increment;
- char *a = format_dwarf_addr (dwflmod, 0, address);
+ char *a = format_dwarf_addr (dwflmod, 0, address, false);
printf (gettext ("\
special opcode %u: address+%u = %s, line%+d = %zu\n"),
opcode, address_increment, a, line_increment, line);
else
address = read_8ubyte_unaligned_inc (dbg, linep);
{
- char *a = format_dwarf_addr (dwflmod, 0, address);
+ char *a = format_dwarf_addr (dwflmod, 0, address, false);
printf (gettext ("set address to %s\n"), a);
free (a);
}
get_uleb128 (u128, linep);
address += minimum_instr_len * u128;
{
- char *a = format_dwarf_addr (dwflmod, 0, address);
+ char *a = format_dwarf_addr (dwflmod, 0, address, false);
printf (gettext ("advance address by %u to %s\n"),
u128, a);
free (a);
* ((255 - opcode_base) / line_range));
address += u128;
{
- char *a = format_dwarf_addr (dwflmod, 0, address);
+ char *a = format_dwarf_addr (dwflmod, 0, address, false);
printf (gettext ("advance address by constant %u to %s\n"),
u128, a);
free (a);
u128 = read_2ubyte_unaligned_inc (dbg, linep);
address += u128;
{
- char *a = format_dwarf_addr (dwflmod, 0, address);
+ char *a = format_dwarf_addr (dwflmod, 0, address, false);
printf (gettext ("\
advance address by fixed value %u to %s\n"),
u128, a);
if (begin == (Dwarf_Addr) -1l) /* Base address entry. */
{
- char *b = format_dwarf_addr (dwflmod, address_size, end);
+ char *b = format_dwarf_addr (dwflmod, address_size, end, false);
printf (gettext (" [%6tx] base address %s\n"), offset, b);
free (b);
}
/* We have a location expression entry. */
uint_fast16_t len = read_2ubyte_unaligned_inc (dbg, readp);
- char *b = format_dwarf_addr (dwflmod, address_size, begin);
- char *e = format_dwarf_addr (dwflmod, address_size, end);
+ char *b = format_dwarf_addr (dwflmod, address_size, begin, false);
+ char *e = format_dwarf_addr (dwflmod, address_size, end, false);
if (first) /* First entry in a list. */
printf (gettext (" [%6tx] %s..%s"), offset, b, e);