DW_OP_0 (DW_OP_GNU_push_tls_address) \
DW_OP_0 (DW_OP_call_frame_cfa) \
DW_OP_2 (DW_OP_bit_piece, DW_FORM_udata, DW_FORM_udata) \
- DW_OP_0 (DW_OP_GNU_uninit)
+ DW_OP_0 (DW_OP_GNU_uninit) \
+ /* DWARF 4 */ \
+ DW_OP_0 (DW_OP_stack_value) \
+ DW_OP_1 (DW_OP_implicit_value, DW_FORM_block)
context for LEB128 loading. */
static bool
read_ctx_read_form (struct read_ctx *ctx, int address_size, uint8_t form,
- uint64_t *valuep, struct where *where, const char *what)
+ uint64_t *valuep, struct where *where, const char *what,
+ bool allow_block)
{
switch (form)
{
return read_ctx_read_8ubyte (ctx, valuep);
};
+ if (allow_block)
+ {
+ int dform;
+ switch (form)
+ {
+#define HANDLE(BFORM, DFORM) \
+ case BFORM: \
+ dform = DFORM; \
+ break
+ HANDLE (DW_FORM_block, DW_FORM_udata);
+ HANDLE (DW_FORM_block1, DW_FORM_data1);
+ HANDLE (DW_FORM_block2, DW_FORM_data2);
+ HANDLE (DW_FORM_block4, DW_FORM_data4);
+#undef HANDLE
+ default:
+ return false;
+ }
+
+ uint64_t length;
+ return read_ctx_read_form (ctx, address_size, dform,
+ &length, where, what, false)
+ && read_ctx_skip (ctx, length);
+ }
+
return false;
}
uint64_t _off = read_ctx_get_offset (&ctx) + init_off; \
uint64_t *_ptr = (PTR); \
if (!read_ctx_read_form (&ctx, cu->head->address_size, (OP), \
- _ptr, &where, STR " operand")) \
+ _ptr, &where, STR " operand", true)) \
{ \
wr_error (&where, ": opcode \"%s\"" \
": can't read " STR " operand (form \"%s\").\n", \