* dwarf2expr.c (execute_stack_op) <DW_OP_GNU_uninit>: Fix typo in
[deliverable/binutils-gdb.git] / gdb / dwarf2expr.c
index 707c0de3e16a1641d3e3aae88bc38ec7720104bb..e2e106ba849020c1a6f9705fddb346f4366074c7 100644 (file)
@@ -1,6 +1,6 @@
 /* DWARF 2 Expression Evaluator.
 
-   Copyright (C) 2001, 2002, 2003, 2005, 2007, 2008
+   Copyright (C) 2001, 2002, 2003, 2005, 2007, 2008, 2009
    Free Software Foundation, Inc.
 
    Contributed by Daniel Berlin (dan@dberlin.org)
@@ -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);
@@ -732,7 +746,7 @@ execute_stack_op (struct dwarf_expr_context *ctx,
 
        case DW_OP_GNU_uninit:
          if (op_ptr != op_end)
-           error (_("DWARF-2 expression error: DW_OP_GNU_unint must always "
+           error (_("DWARF-2 expression error: DW_OP_GNU_uninit must always "
                   "be the very last op."));
 
          ctx->initialized = 0;
This page took 0.025577 seconds and 4 git commands to generate.