[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Libunwind-devel] [PATCH] Implement DWARF DW_CFA_val_expression for
From: |
Arun Sharma |
Subject: |
Re: [Libunwind-devel] [PATCH] Implement DWARF DW_CFA_val_expression for x86_64 |
Date: |
Fri, 31 Jan 2014 00:35:01 -0800 |
On Mon, Jan 20, 2014 at 3:41 AM, Tim Deegan
<address@hidden> wrote:
> Ubuntu's libc-bin (2.15-0ubuntu20.2) on x86_64 uses DW_CFA_val_expression
> in describing the pthread spinlock operations __lll_unlock_wake() and
> __lll_lock_wait(). libunwind 1.1 doesn't understand that opcode and
> so backtraces from those operations are truncated.
>
Thanks for submitting this! A couple of minor nits.
> static inline int
> @@ -172,9 +183,12 @@ dwarf_put (struct dwarf_cursor *c, dwarf_loc_t loc,
> unw_word_t val)
> if (DWARF_IS_REG_LOC (loc))
> return (*c->as->acc.access_reg) (c->as, DWARF_GET_LOC (loc), &val,
> 1, c->as_arg);
> - else
> + if (DWARF_IS_MEM_LOC (loc))
> return (*c->as->acc.access_mem) (c->as, DWARF_GET_LOC (loc), &val,
> 1, c->as_arg);
> + assert(DWARF_IS_VAL_LOC (loc));
> + loc = DWARF_VAL_LOC(c, val);
Is this code necessary?
> + case DWARF_WHERE_EXPR_VAL:
DWARF_WHERE_VAL_EXPR reads better.
> + addr = rs->reg[i].val;
> + if ((ret = eval_location_expr (c, as, a, addr, c->loc + i, arg, 1))
> < 0)
> return ret;
This is fine. Another way to do it would be to update the
DWARF_LOC_TYPE after the eval() instead of passing in an extra
parameter (is_val).
https://sourceware.org/bugzilla/show_bug.cgi?id=15771 seems related.
-Arun