summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Fonseca <jose.r.fonseca@gmail.com>2011-09-24 15:04:08 +0100
committerJosé Fonseca <jose.r.fonseca@gmail.com>2011-09-24 15:04:08 +0100
commit07bb055d977040d022c05962b45f2349bc0c8c2b (patch)
tree19a0f2caf43191e8871a7f7a36184e40fd4e820a
parent892cad6f24175221d2e7bdf3c7fe6c34b64ee50a (diff)
Attempt to retrace incomplete calls.
-rw-r--r--common/trace_parser.cpp8
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;
}