X-Git-Url: https://git.cworth.org/git?p=apitrace;a=blobdiff_plain;f=common%2Ftrace_parser.cpp;h=c70517e2461658cf18e8e6ca30c0d50b83c49c74;hp=095af670e2159f79299fdba9bc4e642cbb4ac5e4;hb=caa8428eb4c4292d3ea53405d4dc9c3c3f21f10a;hpb=4cf9606b3c75478fe7b8258d89b504f854e1de21 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; }