aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2expr.c
diff options
context:
space:
mode:
authorTristan Gingold <gingold@adacore.com>2008-12-15 11:32:08 +0000
committerTristan Gingold <gingold@adacore.com>2008-12-15 11:32:08 +0000
commit9f3fe11c951a7f5963a1548c553a0d481299d6f5 (patch)
tree2e2d4370978007e04460b00b7720a0c40332b092 /gdb/dwarf2expr.c
parentf5938064bfeda7645f5e6c028b85a072ffff7f86 (diff)
downloadgdb-9f3fe11c951a7f5963a1548c553a0d481299d6f5.zip
gdb-9f3fe11c951a7f5963a1548c553a0d481299d6f5.tar.gz
gdb-9f3fe11c951a7f5963a1548c553a0d481299d6f5.tar.bz2
2008-12-15 Tristan Gingold <gingold@adacore.com>
* dwarf2expr.c (execute_stack_op): Handle DW_OP_swap.
Diffstat (limited to 'gdb/dwarf2expr.c')
-rw-r--r--gdb/dwarf2expr.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c
index 707c0de..de9cea8 100644
--- a/gdb/dwarf2expr.c
+++ b/gdb/dwarf2expr.c
@@ -514,6 +514,20 @@ execute_stack_op (struct dwarf_expr_context *ctx,
offset = *op_ptr++;
result = dwarf_expr_fetch (ctx, offset);
break;
+
+ case DW_OP_swap:
+ {
+ CORE_ADDR t1, t2;
+
+ if (ctx->stack_len < 2)
+ error (_("Not enough elements for DW_OP_swap. Need 2, have %d."),
+ ctx->stack_len);
+ t1 = ctx->stack[ctx->stack_len - 1];
+ t2 = ctx->stack[ctx->stack_len - 2];
+ ctx->stack[ctx->stack_len - 1] = t2;
+ ctx->stack[ctx->stack_len - 2] = t1;
+ goto no_push;
+ }
case DW_OP_over:
result = dwarf_expr_fetch (ctx, 1);