[PATCH] Fix agent code generate bug of ref

Hui Zhu teawater@gmail.com
Tue Mar 12 02:22:00 GMT 2013


On Mon, Mar 11, 2013 at 10:38 PM, Tom Tromey <tromey@redhat.com> wrote:
>>>>>> "Yao" == Yao Qi <yao@codesourcery.com> writes:
>
> Yao> SIZE is checked as "size in bits".  Your fix is right, but not
> Yao> complete. We also have to fix it when op is DW_OP_deref_size,
> Yao> something like the patch below.
>
> Yao> I am not familiar with this area, so I might be wrong.
>
> You are correct, but IMO it is simpler to divide each of the case
> constants by 8.
>
> Tom

Hi Tom,

Post a new version change 8 to TARGET_CHAR_BIT.

Thanks,
Hui

2013-03-12  Yao Qi  <yao@codesourcery.com>
	    Hui Zhu  <hui_zhu@mentor.com>

	* dwarf2loc.c (dwarf2_compile_expr_to_ax): Change use bits number
	in DW_OP_deref and DW_OP_deref_size.

--- a/dwarf2loc.c
+++ b/dwarf2loc.c
@@ -2933,7 +2933,7 @@ dwarf2_compile_expr_to_ax (struct agent_
 	    else
 	      size = addr_size;

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



More information about the Gdb-patches mailing list