File tree Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Expand file tree Collapse file tree 2 files changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -2199,7 +2199,8 @@ class CommandObjectTraceDumpFunctionCalls : public CommandObjectParsed {
2199
2199
llvm::Optional<StreamFile> out_file;
2200
2200
if (m_options.m_output_file ) {
2201
2201
out_file.emplace (m_options.m_output_file ->GetPath ().c_str (),
2202
- File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate);
2202
+ File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate |
2203
+ File::eOpenOptionTruncate);
2203
2204
}
2204
2205
2205
2206
m_options.m_dumper_options .forwards = true ;
@@ -2395,7 +2396,8 @@ class CommandObjectTraceDumpInstructions : public CommandObjectParsed {
2395
2396
llvm::Optional<StreamFile> out_file;
2396
2397
if (m_options.m_output_file ) {
2397
2398
out_file.emplace (m_options.m_output_file ->GetPath ().c_str (),
2398
- File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate);
2399
+ File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate |
2400
+ File::eOpenOptionTruncate);
2399
2401
}
2400
2402
2401
2403
if (m_options.m_continue && !m_last_id) {
Original file line number Diff line number Diff line change @@ -799,9 +799,14 @@ static TraceDumper::FunctionCall &AppendInstructionToFunctionCallForest(
799
799
}
800
800
// Now we are in a different symbol. Let's see if this is a return or a
801
801
// call
802
- switch (last_function_call->GetLastTracedSegment ()
803
- .GetLastInstructionSymbolInfo ()
804
- .instruction ->GetControlFlowKind (&exe_ctx)) {
802
+ const InstructionSP &insn = last_function_call->GetLastTracedSegment ()
803
+ .GetLastInstructionSymbolInfo ()
804
+ .instruction ;
805
+ InstructionControlFlowKind insn_kind =
806
+ insn ? insn->GetControlFlowKind (&exe_ctx)
807
+ : eInstructionControlFlowKindOther;
808
+
809
+ switch (insn_kind) {
805
810
case lldb::eInstructionControlFlowKindCall:
806
811
case lldb::eInstructionControlFlowKindFarCall: {
807
812
// This is a regular call
You can’t perform that action at this time.
0 commit comments