aboutsummaryrefslogtreecommitdiff
path: root/value.c
diff options
context:
space:
mode:
authorPetr Machata <pmachata@redhat.com>2012-05-04 14:18:35 +0200
committerPetr Machata <pmachata@redhat.com>2012-08-29 19:03:16 +0200
commit2fb192b7bb49b659343f6dec89931168de00660c (patch)
tree0273a88265b2fbc099f2a8b23d81e913a51d4888 /value.c
parentac147e92ee3e79817d98f9b94f9363a2e063789c (diff)
downloadltrace-2fb192b7bb49b659343f6dec89931168de00660c.tar.gz
Add interface value_pass_by_reference, use in x86_64 back end
Diffstat (limited to 'value.c')
-rw-r--r--value.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/value.c b/value.c
index d06de32..62466f2 100644
--- a/value.c
+++ b/value.c
@@ -433,3 +433,23 @@ value_is_zero(struct value *val, struct value_dict *arguments)
}
return zero;
}
+
+int
+value_pass_by_reference(struct value *value)
+{
+ assert(value != NULL);
+ assert(value->type->type == ARGTYPE_STRUCT);
+
+ struct arg_type_info *new_info = calloc(sizeof(*new_info), 1);
+ if (new_info == NULL)
+ return -1;
+
+ int own;
+ struct arg_type_info *orig;
+ value_take_type(value, &orig, &own);
+ type_init_pointer(new_info, orig, own);
+ new_info->lens = orig->lens;
+ value_set_type(value, new_info, 1);
+
+ return 0;
+}