bfd/
[deliverable/binutils-gdb.git] / gdb / eval.c
index 4954e9fbaf16c24f5022dca0ecbd54d1657c8377..c385539c1a78deedc70df3459f5966030d9b8343 100644 (file)
@@ -1,7 +1,7 @@
 /* Evaluate expressions for GDB.
 
-   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994,
-   1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006
+   Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995,
+   1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2005, 2006, 2007
    Free Software Foundation, Inc.
 
    This file is part of GDB.
@@ -39,6 +39,7 @@
 #include "cp-support.h"
 #include "ui-out.h"
 #include "exceptions.h"
+#include "regcache.h"
 
 #include "gdb_assert.h"
 
@@ -500,8 +501,12 @@ evaluate_subexp_standard (struct type *expect_type,
     case OP_REGISTER:
       {
        int regno = longest_to_int (exp->elts[pc + 1].longconst);
-       struct value *val = value_of_register (regno, get_selected_frame (NULL));
+       struct value *val;
        (*pos) += 2;
+       if (noside == EVAL_AVOID_SIDE_EFFECTS)
+         val = value_zero (register_type (current_gdbarch, regno), not_lval);
+       else
+         val = value_of_register (regno, get_selected_frame (NULL));
        if (val == NULL)
          error (_("Value of register %s not available."),
                 frame_map_regnum_to_name (get_selected_frame (NULL), regno));
This page took 0.024667 seconds and 4 git commands to generate.