summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHui Zhu <teawater@gmail.com>2013-03-12 14:44:56 +0000
committerHui Zhu <teawater@gmail.com>2013-03-12 14:44:56 +0000
commit9df7235c1a26e64a8edcd66813926d928494a180 (patch)
tree948effddb1b2b339468420881e1090ab3842c6da
parent82d049abf18bdffbccf6318a212a8be366a9ee17 (diff)
downloadbinutils-gdb-9df7235c1a26e64a8edcd66813926d928494a180.tar.gz
2013-03-12 Yao Qi <yao@codesourcery.com>
Hui Zhu <hui@codesourcery.com> * dwarf2loc.c (access_memory): Change nbits to nbytes in gdb_assert. (dwarf2_compile_expr_to_ax): Call access_memory in DW_OP_deref and DW_OP_deref_size.
-rw-r--r--gdb/ChangeLog7
-rw-r--r--gdb/dwarf2loc.c26
2 files changed, 12 insertions, 21 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 6bb26b57266..e7eb57a1a51 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,10 @@
+2013-03-12 Yao Qi <yao@codesourcery.com>
+ Hui Zhu <hui@codesourcery.com>
+
+ * dwarf2loc.c (access_memory): Change nbits to nbytes in gdb_assert.
+ (dwarf2_compile_expr_to_ax): Call access_memory in DW_OP_deref and
+ DW_OP_deref_size.
+
2013-03-12 Paul Hilfinger <hilfingr@adacore.com>
* ada-lex.l (rules): Only recognize 'thread' as a
diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c
index f300df2ac1c..f6fa4200a42 100644
--- a/gdb/dwarf2loc.c
+++ b/gdb/dwarf2loc.c
@@ -2539,7 +2539,7 @@ access_memory (struct gdbarch *arch, struct agent_expr *expr, ULONGEST nbits)
{
ULONGEST nbytes = (nbits + 7) / 8;
- gdb_assert (nbits > 0 && nbits <= sizeof (LONGEST));
+ gdb_assert (nbytes > 0 && nbytes <= sizeof (LONGEST));
if (trace_kludge)
ax_trace_quick (expr, nbytes);
@@ -2933,26 +2933,10 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc,
else
size = addr_size;
- switch (size)
- {
- case 8:
- ax_simple (expr, aop_ref8);
- break;
- case 16:
- ax_simple (expr, aop_ref16);
- break;
- case 32:
- ax_simple (expr, aop_ref32);
- break;
- case 64:
- ax_simple (expr, aop_ref64);
- break;
- default:
- /* Note that get_DW_OP_name will never return
- NULL here. */
- error (_("Unsupported size %d in %s"),
- size, get_DW_OP_name (op));
- }
+ if (size != 1 && size != 2 && size != 4 && size != 8)
+ error (_("Refn doesn't support size %d"),
+ size * TARGET_CHAR_BIT);
+ access_memory (arch, expr, size * TARGET_CHAR_BIT);
}
break;