mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-02 10:49:22 +00:00
[lldb][trace] Fix some minor bugs in the call tree
- We weren't truncating the output files - We weren't considering the case in which we couldn't disassembly an instruction.
This commit is contained in:
parent
6e85b8807f
commit
1e58e3e1e9
@ -2199,7 +2199,8 @@ protected:
|
||||
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;
|
||||
@ -2395,7 +2396,8 @@ protected:
|
||||
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) {
|
||||
|
@ -799,9 +799,14 @@ static TraceDumper::FunctionCall &AppendInstructionToFunctionCallForest(
|
||||
}
|
||||
// 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
|
||||
|
Loading…
Reference in New Issue
Block a user