This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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);


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]