llvm::Optional<StreamFile> out_file;
if (m_options.m_output_file) {
out_file.emplace(m_options.m_output_file->GetPath().c_str(),
- File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate);
+ File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate |
+ File::eOpenOptionTruncate);
}
m_options.m_dumper_options.forwards = true;
llvm::Optional<StreamFile> out_file;
if (m_options.m_output_file) {
out_file.emplace(m_options.m_output_file->GetPath().c_str(),
- File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate);
+ File::eOpenOptionWriteOnly | File::eOpenOptionCanCreate |
+ File::eOpenOptionTruncate);
}
if (m_options.m_continue && !m_last_id) {
}
// Now we are in a different symbol. Let's see if this is a return or a
// call
- switch (last_function_call->GetLastTracedSegment()
- .GetLastInstructionSymbolInfo()
- .instruction->GetControlFlowKind(&exe_ctx)) {
+ const InstructionSP &insn = last_function_call->GetLastTracedSegment()
+ .GetLastInstructionSymbolInfo()
+ .instruction;
+ InstructionControlFlowKind insn_kind =
+ insn ? insn->GetControlFlowKind(&exe_ctx)
+ : eInstructionControlFlowKindOther;
+
+ switch (insn_kind) {
case lldb::eInstructionControlFlowKindCall:
case lldb::eInstructionControlFlowKindFarCall: {
// This is a regular call