Identify remote fork event support
[deliverable/binutils-gdb.git] / gdb / value.c
index cb56849eee68bad403151fff3e4a7b238406f19c..86d7d0029d2d680887e4b06cda7b3763b4362b5e 100644 (file)
@@ -1704,6 +1704,27 @@ value_copy (struct value *arg)
   return val;
 }
 
+/* Return a "const" and/or "volatile" qualified version of the value V.
+   If CNST is true, then the returned value will be qualified with
+   "const".
+   if VOLTL is true, then the returned value will be qualified with
+   "volatile".  */
+
+struct value *
+make_cv_value (int cnst, int voltl, struct value *v)
+{
+  struct type *val_type = value_type (v);
+  struct type *enclosing_type = value_enclosing_type (v);
+  struct value *cv_val = value_copy (v);
+
+  deprecated_set_value_type (cv_val,
+                            make_cv_type (cnst, voltl, val_type, NULL));
+  set_value_enclosing_type (cv_val,
+                           make_cv_type (cnst, voltl, enclosing_type, NULL));
+
+  return cv_val;
+}
+
 /* Return a version of ARG that is non-lvalue.  */
 
 struct value *
@@ -2600,6 +2621,18 @@ value_of_xmethod (struct xmethod_worker *worker)
   return worker->value;
 }
 
+/* Return the type of the result of TYPE_CODE_XMETHOD value METHOD.  */
+
+struct type *
+result_type_of_xmethod (struct value *method, int argc, struct value **argv)
+{
+  gdb_assert (TYPE_CODE (value_type (method)) == TYPE_CODE_XMETHOD
+             && method->lval == lval_xcallable && argc > 0);
+
+  return get_xmethod_result_type (method->location.xm_worker,
+                                 argv[0], argv + 1, argc - 1);
+}
+
 /* Call the xmethod corresponding to the TYPE_CODE_XMETHOD value METHOD.  */
 
 struct value *
@@ -3497,7 +3530,7 @@ value_from_contents_and_address (struct type *type,
                                 const gdb_byte *valaddr,
                                 CORE_ADDR address)
 {
-  struct type *resolved_type = resolve_dynamic_type (type, address);
+  struct type *resolved_type = resolve_dynamic_type (type, valaddr, address);
   struct type *resolved_type_no_typedef = check_typedef (resolved_type);
   struct value *v;
 
This page took 0.025224 seconds and 4 git commands to generate.