daily update
[deliverable/binutils-gdb.git] / gdb / dwarf2loc.c
index 285081e472fd56b9b952042242239def23329694..4c13307bb0e23a1d7f3b0971f7f18a50a7b029fd 100644 (file)
@@ -1076,6 +1076,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
   struct dwarf_expr_context *ctx;
   struct cleanup *old_chain;
   struct objfile *objfile = dwarf2_per_cu_objfile (per_cu);
+  volatile struct gdb_exception ex;
 
   if (byte_offset < 0)
     invalid_synthetic_pointer ();
@@ -1106,7 +1107,22 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
   ctx->get_tls_address = dwarf_expr_tls_address;
   ctx->dwarf_call = dwarf_expr_dwarf_call;
 
-  dwarf_expr_eval (ctx, data, size);
+  TRY_CATCH (ex, RETURN_MASK_ERROR)
+    {
+      dwarf_expr_eval (ctx, data, size);
+    }
+  if (ex.reason < 0)
+    {
+      if (ex.error == NOT_AVAILABLE_ERROR)
+       {
+         retval = allocate_value (type);
+         mark_value_bytes_unavailable (retval, 0, TYPE_LENGTH (type));
+         return retval;
+       }
+      else
+       throw_exception (ex);
+    }
+
   if (ctx->num_pieces > 0)
     {
       struct piece_closure *c;
@@ -1204,12 +1220,17 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame,
          }
          break;
 
+       case DWARF_VALUE_OPTIMIZED_OUT:
+         retval = allocate_value (type);
+         VALUE_LVAL (retval) = not_lval;
+         set_value_optimized_out (retval, 1);
+         break;
+
          /* DWARF_VALUE_IMPLICIT_POINTER was converted to a pieced
             operation by execute_stack_op.  */
        case DWARF_VALUE_IMPLICIT_POINTER:
          /* DWARF_VALUE_OPTIMIZED_OUT can't occur in this context --
             it can only be encountered when making a piece.  */
-       case DWARF_VALUE_OPTIMIZED_OUT:
        default:
          internal_error (__FILE__, __LINE__, _("invalid location type"));
        }
This page took 0.023618 seconds and 4 git commands to generate.