diff options
author | José Fonseca <jfonseca@vmware.com> | 2014-06-20 14:13:13 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2014-06-24 16:30:34 +0100 |
commit | 87c34803377fad1634dfd60a5e48c30a5d2ef4aa (patch) | |
tree | 664e7db7ee0dd1b3808921c0d346d23201b4e90f | |
parent | 66b7bcc2be115fb1528b6bdf75798e60cc59721f (diff) |
cli/pickle: Pass argument names.
-rw-r--r-- | cli/cli_pickle.cpp | 7 | ||||
-rwxr-xr-x | scripts/tracediff.py | 10 | ||||
-rwxr-xr-x | scripts/unpickle.py | 2 |
3 files changed, 14 insertions, 5 deletions
diff --git a/cli/cli_pickle.cpp b/cli/cli_pickle.cpp index 8ea507be..e7f51ff9 100644 --- a/cli/cli_pickle.cpp +++ b/cli/cli_pickle.cpp @@ -172,11 +172,18 @@ public: writer.beginList(); for (unsigned i = 0; i < call->args.size(); ++i) { + writer.beginTuple(2); + if (i < call->sig->num_args) { + writer.writeString(call->sig->arg_names[i]); + } else { + writer.writeNone(); + } if (call->args[i].value) { _visit(call->args[i].value); } else { writer.writeNone(); } + writer.endTuple(2); } writer.endList(); diff --git a/scripts/tracediff.py b/scripts/tracediff.py index 22a26265..ed61e39d 100755 --- a/scripts/tracediff.py +++ b/scripts/tracediff.py @@ -341,14 +341,16 @@ class PythonDiffer(Differ): for j in xrange(numArgs): self.highlighter.write(sep) try: - a_arg = a_call.args[j] + a_argName, a_argVal = a_call.args[j] except IndexError: pass try: - b_arg = b_call.args[j] + b_argName, b_argVal = b_call.args[j] except IndexError: pass - self.replace_value(a_arg, b_arg) + self.replace_value(a_argName, b_argName) + self.highlighter.write(' = ') + self.replace_value(a_argVal, b_argVal) sep = ', ' self.highlighter.write(')') if a_call.ret is not None or b_call.ret is not None: @@ -449,7 +451,7 @@ class PythonDiffer(Differ): self.highlighter.bold(True) self.highlighter.write(call.functionName) self.highlighter.bold(False) - self.highlighter.write('(' + ', '.join(itertools.imap(self.dumper.visit, call.args)) + ')') + self.highlighter.write('(' + self.dumper.visitItems(call.args) + ')') if call.ret is not None: self.highlighter.write(' = ' + self.dumper.visit(call.ret)) self.highlighter.normal() diff --git a/scripts/unpickle.py b/scripts/unpickle.py index 1932497e..b6c76d10 100755 --- a/scripts/unpickle.py +++ b/scripts/unpickle.py @@ -208,7 +208,7 @@ class Call: if self.no is not None: s = str(self.no) + ' ' + s dumper = Dumper() - s += '(' + ', '.join(itertools.imap(dumper.visit, self.args)) + ')' + s += '(' + dumper.visitItems(self.args) + ')' if self.ret is not None: s += ' = ' s += dumper.visit(self.ret) |