Skip to content

Commit 6ca4bb6

Browse files
Formatting changes.
1 parent 3d19b02 commit 6ca4bb6

File tree

6 files changed

+39
-45
lines changed

6 files changed

+39
-45
lines changed

lldb/include/lldb/Core/Disassembler.h

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ class Instruction {
170170

171171
virtual bool IsAuthenticated() = 0;
172172

173-
bool CanSetBreakpoint ();
173+
bool CanSetBreakpoint();
174174

175175
virtual size_t Decode(const Disassembler &disassembler,
176176
const DataExtractor &data,
@@ -283,7 +283,7 @@ std::function<bool(const Instruction::Operand &)> FetchImmOp(int64_t &imm);
283283

284284
std::function<bool(const Instruction::Operand &)>
285285
MatchOpType(Instruction::Operand::Type type);
286-
}
286+
} // namespace OperandMatchers
287287

288288
class InstructionList {
289289
public:
@@ -315,20 +315,19 @@ class InstructionList {
315315
/// @param[in] ignore_calls
316316
/// It true, then fine the first branch instruction that isn't
317317
/// a function call (a branch that calls and returns to the next
318-
/// instruction). If false, find the instruction index of any
318+
/// instruction). If false, find the instruction index of any
319319
/// branch in the list.
320-
///
320+
///
321321
/// @param[out] found_calls
322-
/// If non-null, this will be set to true if any calls were found in
322+
/// If non-null, this will be set to true if any calls were found in
323323
/// extending the range.
324-
///
324+
///
325325
/// @return
326326
/// The instruction index of the first branch that is at or past
327-
/// \a start. Returns UINT32_MAX if no matching branches are
327+
/// \a start. Returns UINT32_MAX if no matching branches are
328328
/// found.
329329
//------------------------------------------------------------------
330-
uint32_t GetIndexOfNextBranchInstruction(uint32_t start,
331-
bool ignore_calls,
330+
uint32_t GetIndexOfNextBranchInstruction(uint32_t start, bool ignore_calls,
332331
bool *found_calls) const;
333332

334333
uint32_t GetIndexOfInstructionAtLoadAddress(lldb::addr_t load_addr,
@@ -447,7 +446,8 @@ class Disassembler : public std::enable_shared_from_this<Disassembler>,
447446
Stream &strm, bool enable_rich_annotations = false);
448447

449448
static bool Disassemble(Debugger &debugger, const ArchSpec &arch,
450-
StackFrame &frame, Stream &strm, bool enable_rich_annotations = false);
449+
StackFrame &frame, Stream &strm,
450+
bool enable_rich_annotations = false);
451451

452452
// Constructors and Destructors
453453
Disassembler(const ArchSpec &arch, const char *flavor);

lldb/include/lldb/Target/StackFrame.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,6 @@ class StackFrame : public ExecutionContextScope,
323323
/// C string with the assembly instructions for this function.
324324
const char *Disassemble(bool enable_rich_annotations = false);
325325

326-
327326
/// Print a description of this frame using the provided frame format.
328327
///
329328
/// \param[out] strm

lldb/source/Commands/CommandObjectDisassemble.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,8 @@ void CommandObjectDisassemble::DoExecute(Args &command,
555555
cpu_string, features_string, m_exe_ctx, cur_range.GetBaseAddress(),
556556
limit, m_options.show_mixed,
557557
m_options.show_mixed ? m_options.num_lines_context : 0, options,
558-
result.GetOutputStream(), /*enable_rich_annotations=*/m_options.enable_rich_annotations)) {
558+
result.GetOutputStream(),
559+
/*enable_rich_annotations=*/m_options.enable_rich_annotations)) {
559560
result.SetStatus(eReturnStatusSuccessFinishResult);
560561
} else {
561562
if (m_options.symbol_containing_addr != LLDB_INVALID_ADDRESS) {

lldb/source/Core/Disassembler.cpp

Lines changed: 11 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -168,15 +168,12 @@ Disassembler::DisassembleBytes(const ArchSpec &arch, const char *plugin_name,
168168
return disasm_sp;
169169
}
170170

171-
bool Disassembler::Disassemble(Debugger &debugger, const ArchSpec &arch,
172-
const char *plugin_name, const char *flavor,
173-
const char *cpu, const char *features,
174-
const ExecutionContext &exe_ctx,
175-
const Address &address, Limit limit,
176-
bool mixed_source_and_assembly,
177-
uint32_t num_mixed_context_lines,
178-
uint32_t options, Stream &strm,
179-
bool enable_rich_annotations) {
171+
bool Disassembler::Disassemble(
172+
Debugger &debugger, const ArchSpec &arch, const char *plugin_name,
173+
const char *flavor, const char *cpu, const char *features,
174+
const ExecutionContext &exe_ctx, const Address &address, Limit limit,
175+
bool mixed_source_and_assembly, uint32_t num_mixed_context_lines,
176+
uint32_t options, Stream &strm, bool enable_rich_annotations) {
180177
if (!exe_ctx.GetTargetPtr())
181178
return false;
182179

@@ -191,10 +188,10 @@ bool Disassembler::Disassemble(Debugger &debugger, const ArchSpec &arch,
191188
if (bytes_disassembled == 0)
192189
return false;
193190

194-
disasm_sp->PrintInstructions(debugger, arch, exe_ctx,
195-
mixed_source_and_assembly,
196-
num_mixed_context_lines, options, strm,
197-
/*enable_rich_annotations=*/enable_rich_annotations);
191+
disasm_sp->PrintInstructions(
192+
debugger, arch, exe_ctx, mixed_source_and_assembly,
193+
num_mixed_context_lines, options, strm,
194+
/*enable_rich_annotations=*/enable_rich_annotations);
198195
return true;
199196
}
200197

@@ -548,8 +545,7 @@ void Disassembler::PrintInstructions(Debugger &debugger, const ArchSpec &arch,
548545
(options & eOptionShowControlFlowKind) != 0;
549546
inst->Dump(&strm, max_opcode_byte_size, true, show_bytes,
550547
show_control_flow_kind, &exe_ctx, &sc, &prev_sc, nullptr,
551-
address_text_size,
552-
enable_rich_annotations);
548+
address_text_size, enable_rich_annotations);
553549
strm.EOL();
554550
} else {
555551
break;

lldb/source/Target/StackFrame.cpp

Lines changed: 15 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -273,11 +273,9 @@ const char *StackFrame::Disassemble(bool enable_rich_annotations) {
273273

274274
ExecutionContext exe_ctx(shared_from_this());
275275
if (Target *target = exe_ctx.GetTargetPtr()) {
276-
Disassembler::Disassemble(target->GetDebugger(),
277-
target->GetArchitecture(),
278-
*this,
279-
m_disassembly,
280-
/*enable_rich_annotations=*/enable_rich_annotations);
276+
Disassembler::Disassemble(
277+
target->GetDebugger(), target->GetArchitecture(), *this, m_disassembly,
278+
/*enable_rich_annotations=*/enable_rich_annotations);
281279
}
282280

283281
return m_disassembly.Empty() ? nullptr : m_disassembly.GetData();
@@ -445,10 +443,10 @@ VariableList *StackFrame::GetVariableList(bool get_file_globals,
445443
const bool get_child_variables = true;
446444
const bool can_create = true;
447445
const bool stop_if_child_block_is_inlined_function = true;
448-
frame_block->AppendBlockVariables(can_create, get_child_variables,
449-
stop_if_child_block_is_inlined_function,
450-
[](Variable *v) { return true; },
451-
m_variable_list_sp.get());
446+
frame_block->AppendBlockVariables(
447+
can_create, get_child_variables,
448+
stop_if_child_block_is_inlined_function,
449+
[](Variable *v) { return true; }, m_variable_list_sp.get());
452450
}
453451
}
454452

@@ -1232,10 +1230,12 @@ StackFrame::GetValueObjectForFrameVariable(const VariableSP &variable_sp,
12321230
VariableList *var_list = GetVariableList(true, nullptr);
12331231
if (var_list) {
12341232
// Make sure the variable is a frame variable
1235-
const uint32_t var_idx = var_list->FindIndexForVariable(variable_sp.get());
1233+
const uint32_t var_idx =
1234+
var_list->FindIndexForVariable(variable_sp.get());
12361235
const uint32_t num_variables = var_list->GetSize();
12371236
if (var_idx < num_variables) {
1238-
valobj_sp = m_variable_list_value_objects.GetValueObjectAtIndex(var_idx);
1237+
valobj_sp =
1238+
m_variable_list_value_objects.GetValueObjectAtIndex(var_idx);
12391239
if (!valobj_sp) {
12401240
if (m_variable_list_value_objects.GetSize() < num_variables)
12411241
m_variable_list_value_objects.Resize(num_variables);
@@ -1769,11 +1769,9 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
17691769

17701770
if (clobbered_reg_matcher(operands[0])) {
17711771
origin_operand = &operands[1];
1772-
}
1773-
else if (clobbered_reg_matcher(operands[1])) {
1772+
} else if (clobbered_reg_matcher(operands[1])) {
17741773
origin_operand = &operands[0];
1775-
}
1776-
else {
1774+
} else {
17771775
continue;
17781776
}
17791777

@@ -1799,8 +1797,7 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
17991797
if (!source_path) {
18001798
continue;
18011799
}
1802-
source_path =
1803-
GetValueForDereferincingOffset(frame, source_path, offset);
1800+
source_path = GetValueForDereferincingOffset(frame, source_path, offset);
18041801
}
18051802

18061803
if (source_path) {
@@ -1810,7 +1807,7 @@ lldb::ValueObjectSP DoGuessValueAt(StackFrame &frame, ConstString reg,
18101807

18111808
return ValueObjectSP();
18121809
}
1813-
}
1810+
} // namespace
18141811

18151812
lldb::ValueObjectSP StackFrame::GuessValueForRegisterAndOffset(ConstString reg,
18161813
int64_t offset) {

lldb/test/API/functionalities/rich-disassembler/TestRichDisassembler.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
from lldbsuite.test.decorators import *
33
import lldb
44

5+
56
class TestRichDisassembler(TestBase):
67
def test_d_original_example_O1(self):
78
"""

0 commit comments

Comments
 (0)