X-Git-Url: https://git.cworth.org/git?a=blobdiff_plain;f=common%2Ftrace_parser.cpp;h=c70517e2461658cf18e8e6ca30c0d50b83c49c74;hb=656e70fcb18b2579e98ec3f4e6a55a89a9772b74;hp=095af670e2159f79299fdba9bc4e642cbb4ac5e4;hpb=677f59a10bf71b0bf1b73bfc9c1accbf719fafad;p=apitrace diff --git a/common/trace_parser.cpp b/common/trace_parser.cpp index 095af67..c70517e 100644 --- a/common/trace_parser.cpp +++ b/common/trace_parser.cpp @@ -187,8 +187,11 @@ Call *Parser::parse_call(Mode mode) { std::cerr << "\tLEAVE\n"; #endif call = parse_leave(mode); - adjust_call_flags(call); - return call; + if (call) { + adjust_call_flags(call); + return call; + } + break; default: std::cerr << "error: unknown event " << c << "\n"; exit(1); @@ -456,6 +459,14 @@ Call *Parser::parse_leave(Mode mode) { } } if (!call) { + /* This might happen on random access, when an asynchronous call is stranded + * between two frames. We won't return this call, but we still need to skip + * over its data. + */ + const FunctionSig sig = {0, NULL, 0, NULL}; + call = new Call(&sig, 0, 0); + parse_call_details(call, SCAN); + delete call; return NULL; }