#include "regcache.h"
#include "objfiles.h"
#include "exceptions.h"
+#include "block.h"
#include "elf/dwarf2.h"
#include "dwarf2expr.h"
int length;
struct objfile *objfile = dwarf2_per_cu_objfile (baton->per_cu);
struct gdbarch *gdbarch = get_objfile_arch (objfile);
+ enum bfd_endian byte_order = gdbarch_byte_order (gdbarch);
unsigned int addr_size = dwarf2_per_cu_addr_size (baton->per_cu);
CORE_ADDR base_mask = ~(~(CORE_ADDR)1 << (addr_size * 8 - 1));
/* Adjust base_address for relocatable objects. */
low += base_address;
high += base_address;
- length = extract_unsigned_integer (loc_ptr, 2);
+ length = extract_unsigned_integer (loc_ptr, 2, byte_order);
loc_ptr += 2;
if (pc >= low && pc < high)
struct symbol *framefunc;
struct dwarf_expr_baton *debaton = (struct dwarf_expr_baton *) baton;
- framefunc = get_frame_function (debaton->frame);
+ /* Use block_linkage_function, which returns a real (not inlined)
+ function, instead of get_frame_function, which may return an
+ inlined function. */
+ framefunc = block_linkage_function (get_frame_block (debaton->frame, NULL));
/* If we found a frame-relative symbol then it was certainly within
some function associated with a frame. If we can't find the frame,
something has gone wrong. */
gdb_assert (framefunc != NULL);
- if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_loclist_funcs)
+ if (SYMBOL_LOCATION_BATON (framefunc) == NULL)
+ *start = NULL;
+ else if (SYMBOL_COMPUTED_OPS (framefunc) == &dwarf2_loclist_funcs)
{
struct dwarf2_loclist_baton *symbaton;
struct frame_info *frame = debaton->frame;
fprintf_filtered (stream,
"a thread-local variable at offset %s in the "
"thread-local storage for `%s'",
- paddr_nz (offset), objfile->name);
+ paddress (gdbarch, offset), objfile->name);
return 1;
}