Re: [PATCH] Fix agent code generate bug of ref

Yao Qi
2013-03-11T13:39:20Z

On 03/10/2013 01:00 PM, Hui Zhu wrote:
> @@ -2929,7 +2929,7 @@ dwarf2_compile_expr_to_ax (struct agent_
> if (op == DW_OP_deref_size)
> size = *op_ptr++;
> else
> - size = addr_size;
> + size = addr_size_bits;

The problem here is SIZE is "size in bytes", but
>
> switch (size)
> {

SIZE is checked as "size in bits". Your fix is right, but not complete.
We also have to fix it when op is DW_OP_deref_size, something like the
patch below.

I am not familiar with this area, so I might be wrong.

--
Yao (é½å°§)

@@ -2931,7 +2931,7 @@ dwarf2_compile_expr_to_ax (struct agent_expr
*expr, struct axs_value *loc,
else
size = addr_size;

- switch (size)
+ switch (size * TARGET_CHAR_BIT)
{
case 8:
ax_simple (expr, aop_ref8);