diff options
author | José Fonseca <jfonseca@vmware.com> | 2010-11-24 16:19:49 +0000 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2010-11-24 16:19:49 +0000 |
commit | dce84c4cbc8176d627c5e7801c2acbd0e2027b86 (patch) | |
tree | bb97cb67a97266294bb95d7740254c6db7a082ef /trace_parser.hpp | |
parent | e02bb2a85616d0ff25f65a7a84be9d4e0bbaafec (diff) |
Refer args by index.
Argument names are not very reliable.
Diffstat (limited to 'trace_parser.hpp')
-rw-r--r-- | trace_parser.hpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/trace_parser.hpp b/trace_parser.hpp index 2c55037..97dcf65 100644 --- a/trace_parser.hpp +++ b/trace_parser.hpp @@ -86,7 +86,7 @@ public: case Trace::CALL_END: return call; case Trace::CALL_ARG: - call->args.push_back(parse_arg()); + parse_arg(call); break; case Trace::CALL_RET: call->ret = parse_value(); @@ -102,10 +102,14 @@ public: } while(true); } - Arg parse_arg(void) { + void parse_arg(Call *call) { + unsigned index = read_uint(); std::string name = read_string(); Value *value = parse_value(); - return Arg(name, value); + if (index >= call->args.size()) { + call->args.resize(index + 1); + } + call->args[index] = Arg(name, value); } Value *parse_value(void) { |