diff options
author | José Fonseca <jose.r.fonseca@gmail.com> | 2011-09-24 15:04:08 +0100 |
---|---|---|
committer | José Fonseca <jose.r.fonseca@gmail.com> | 2011-09-24 15:04:08 +0100 |
commit | 07bb055d977040d022c05962b45f2349bc0c8c2b (patch) | |
tree | 19a0f2caf43191e8871a7f7a36184e40fd4e820a | |
parent | 892cad6f24175221d2e7bdf3c7fe6c34b64ee50a (diff) |
Attempt to retrace incomplete calls.
-rw-r--r-- | common/trace_parser.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/common/trace_parser.cpp b/common/trace_parser.cpp index d7b20d2..a728577 100644 --- a/common/trace_parser.cpp +++ b/common/trace_parser.cpp @@ -179,9 +179,11 @@ Call *Parser::parse_call(Mode mode) { std::cerr << "error: unknown event " << c << "\n"; exit(1); case -1: - for (CallList::iterator it = calls.begin(); it != calls.end(); ++it) { - std::cerr << "warning: incomplete call " << (*it)->name() << "\n"; - std::cerr << **it << "\n"; + if (!calls.empty()) { + Call *call = calls.front(); + std::cerr << call->no << ": warning: incomplete call " << call->name() << "\n"; + calls.pop_front(); + return call; } return NULL; } |