Skip to content

Commit d0ec1d5

Browse files
committed
format
1 parent 0c7a7dc commit d0ec1d5

File tree

8 files changed

+49
-41
lines changed

8 files changed

+49
-41
lines changed

lldb/include/lldb/API/SBTarget.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -738,8 +738,10 @@ class LLDB_API SBTarget {
738738

739739
lldb::SBBreakpoint BreakpointCreateBySBAddress(SBAddress &address);
740740

741-
lldb::SBBreakpoint BreakpointCreateByFileAddress(const SBFileSpec &file_spec,
742-
addr_t file_addr, addr_t offset = 0, addr_t instructions_offset = 0);
741+
lldb::SBBreakpoint
742+
BreakpointCreateByFileAddress(const SBFileSpec &file_spec, addr_t file_addr,
743+
addr_t offset = 0,
744+
addr_t instructions_offset = 0);
743745

744746
/// Create a breakpoint using a scripted resolver.
745747
///

lldb/include/lldb/Breakpoint/BreakpointResolver.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ class BreakpointResolver : public Searcher {
4646
/// The breakpoint that owns this resolver.
4747
/// \param[in] resolverType
4848
/// The concrete breakpoint resolver type for this breakpoint.
49-
BreakpointResolver(const lldb::BreakpointSP &bkpt,
50-
unsigned char resolverType,
49+
BreakpointResolver(const lldb::BreakpointSP &bkpt, unsigned char resolverType,
5150
lldb::addr_t offset = 0,
5251
lldb::addr_t instructions_offset = 0);
5352

@@ -223,7 +222,8 @@ class BreakpointResolver : public Searcher {
223222
lldb::BreakpointWP m_breakpoint; // This is the breakpoint we add locations to.
224223
lldb::addr_t m_offset; // A random offset the user asked us to add to any
225224
// breakpoints we set.
226-
lldb::addr_t m_instructions_offset; // Number of instructions to add to the resolved breakpoint address.
225+
lldb::addr_t m_instructions_offset; // Number of instructions to add to the
226+
// resolved breakpoint address.
227227

228228
// Subclass identifier (for llvm isa/dyn_cast)
229229
const unsigned char SubclassID;

lldb/include/lldb/Breakpoint/BreakpointResolverAddress.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,8 @@ class BreakpointResolverAddress : public BreakpointResolver {
2828
const Address &addr,
2929
const FileSpec &module_spec);
3030

31-
BreakpointResolverAddress(const lldb::BreakpointSP &bkpt,
32-
const Address &addr,
33-
const FileSpec &module_spec,
34-
lldb::addr_t offset,
31+
BreakpointResolverAddress(const lldb::BreakpointSP &bkpt, const Address &addr,
32+
const FileSpec &module_spec, lldb::addr_t offset,
3533
lldb::addr_t instructions_offset);
3634

3735
~BreakpointResolverAddress() override = default;

lldb/include/lldb/Target/Target.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -725,12 +725,10 @@ class Target : public std::enable_shared_from_this<Target>,
725725
bool request_hardware);
726726

727727
// Use this to create a breakpoint from a file address and a module file spec
728-
lldb::BreakpointSP CreateAddressInModuleBreakpoint(lldb::addr_t file_addr,
729-
bool internal,
730-
const FileSpec &file_spec,
731-
bool request_hardware,
732-
lldb::addr_t offset = 0,
733-
lldb::addr_t instructions_offset = 0);
728+
lldb::BreakpointSP CreateAddressInModuleBreakpoint(
729+
lldb::addr_t file_addr, bool internal, const FileSpec &file_spec,
730+
bool request_hardware, lldb::addr_t offset = 0,
731+
lldb::addr_t instructions_offset = 0);
734732

735733
// Use this to create Address breakpoints:
736734
lldb::BreakpointSP CreateBreakpoint(const Address &addr, bool internal,

lldb/source/API/SBTarget.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -950,14 +950,19 @@ SBBreakpoint SBTarget::BreakpointCreateBySBAddress(SBAddress &sb_address) {
950950
return sb_bp;
951951
}
952952

953-
SBBreakpoint SBTarget::BreakpointCreateByFileAddress(const SBFileSpec &file_spec, addr_t file_addr, addr_t offset, addr_t instructions_offset) {
953+
SBBreakpoint
954+
SBTarget::BreakpointCreateByFileAddress(const SBFileSpec &file_spec,
955+
addr_t file_addr, addr_t offset,
956+
addr_t instructions_offset) {
954957
LLDB_INSTRUMENT_VA(this, file_spec, file_addr);
955958

956959
SBBreakpoint sb_bp;
957960
if (TargetSP target_sp = GetSP()) {
958961
std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
959962
const bool hardware = false;
960-
sb_bp = target_sp->CreateAddressInModuleBreakpoint(file_addr, false, *file_spec.get(), hardware, offset, instructions_offset);
963+
sb_bp = target_sp->CreateAddressInModuleBreakpoint(
964+
file_addr, false, *file_spec.get(), hardware, offset,
965+
instructions_offset);
961966
}
962967

963968
return sb_bp;
@@ -1969,8 +1974,8 @@ lldb::SBInstructionList SBTarget::ReadInstructions(lldb::SBAddress base_addr,
19691974

19701975
if (TargetSP target_sp = GetSP()) {
19711976
if (Address *addr_ptr = base_addr.get()) {
1972-
sb_instructions.SetDisassembler(target_sp->ReadInstructions(
1973-
*addr_ptr, count, flavor_string));
1977+
sb_instructions.SetDisassembler(
1978+
target_sp->ReadInstructions(*addr_ptr, count, flavor_string));
19741979
}
19751980
}
19761981

lldb/source/Breakpoint/BreakpointResolver.cpp

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ const char *BreakpointResolver::g_ty_to_name[] = {"FileAndLine", "Address",
4343

4444
const char *BreakpointResolver::g_option_names[static_cast<uint32_t>(
4545
BreakpointResolver::OptionNames::LastOptionName)] = {
46-
"AddressOffset", "Exact", "FileName", "Inlines", "Language",
47-
"LineNumber", "Column", "ModuleName", "NameMask", "Offset",
48-
"PythonClass", "Regex", "ScriptArgs", "SectionName", "SearchDepth",
46+
"AddressOffset", "Exact", "FileName",
47+
"Inlines", "Language", "LineNumber",
48+
"Column", "ModuleName", "NameMask",
49+
"Offset", "PythonClass", "Regex",
50+
"ScriptArgs", "SectionName", "SearchDepth",
4951
"SkipPrologue", "SymbolNames", "InstructionsOffset"};
5052

5153
const char *BreakpointResolver::ResolverTyToName(enum ResolverTy type) {
@@ -68,7 +70,8 @@ BreakpointResolver::BreakpointResolver(const BreakpointSP &bkpt,
6870
const unsigned char resolverTy,
6971
lldb::addr_t offset,
7072
lldb::addr_t instructions_offset)
71-
: m_breakpoint(bkpt), m_offset(offset), m_instructions_offset(instructions_offset), SubclassID(resolverTy) {}
73+
: m_breakpoint(bkpt), m_offset(offset),
74+
m_instructions_offset(instructions_offset), SubclassID(resolverTy) {}
7275

7376
BreakpointResolver::~BreakpointResolver() = default;
7477

@@ -368,7 +371,8 @@ BreakpointLocationSP BreakpointResolver::AddLocation(Address loc_addr,
368371
bool *new_location) {
369372
if (m_instructions_offset != 0) {
370373
Target &target = GetBreakpoint()->GetTarget();
371-
const DisassemblerSP instructions = target.ReadInstructions(loc_addr, m_instructions_offset);
374+
const DisassemblerSP instructions =
375+
target.ReadInstructions(loc_addr, m_instructions_offset);
372376
loc_addr.Slide(instructions->GetInstructionList().GetTotalByteSize());
373377
}
374378

lldb/source/Breakpoint/BreakpointResolverAddress.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ BreakpointResolverAddress::BreakpointResolverAddress(const BreakpointSP &bkpt,
3131
m_addr(addr), m_resolved_addr(LLDB_INVALID_ADDRESS) {}
3232

3333
BreakpointResolverAddress::BreakpointResolverAddress(
34-
const BreakpointSP &bkpt, const Address &addr, const FileSpec &module_spec, lldb::addr_t offset, lldb::addr_t instructions_offset)
35-
: BreakpointResolver(bkpt, BreakpointResolver::AddressResolver, offset, instructions_offset),
34+
const BreakpointSP &bkpt, const Address &addr, const FileSpec &module_spec,
35+
lldb::addr_t offset, lldb::addr_t instructions_offset)
36+
: BreakpointResolver(bkpt, BreakpointResolver::AddressResolver, offset,
37+
instructions_offset),
3638
m_addr(addr), m_resolved_addr(LLDB_INVALID_ADDRESS),
3739
m_module_filespec(module_spec) {}
3840

lldb/source/Target/Target.cpp

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -565,12 +565,10 @@ BreakpointSP Target::CreateBreakpoint(const Address &addr, bool internal,
565565
return CreateBreakpoint(filter_sp, resolver_sp, internal, hardware, false);
566566
}
567567

568-
lldb::BreakpointSP
569-
Target::CreateAddressInModuleBreakpoint(lldb::addr_t file_addr, bool internal,
570-
const FileSpec &file_spec,
571-
bool request_hardware,
572-
lldb::addr_t offset,
573-
lldb::addr_t instructions_offset) {
568+
lldb::BreakpointSP Target::CreateAddressInModuleBreakpoint(
569+
lldb::addr_t file_addr, bool internal, const FileSpec &file_spec,
570+
bool request_hardware, lldb::addr_t offset,
571+
lldb::addr_t instructions_offset) {
574572
SearchFilterSP filter_sp(
575573
new SearchFilterForUnconstrainedSearches(shared_from_this()));
576574
BreakpointResolverSP resolver_sp(new BreakpointResolverAddress(
@@ -2993,33 +2991,34 @@ lldb::addr_t Target::GetBreakableLoadAddress(lldb::addr_t addr) {
29932991
return arch_plugin ? arch_plugin->GetBreakableLoadAddress(addr, *this) : addr;
29942992
}
29952993

2996-
lldb::DisassemblerSP Target::ReadInstructions(const Address &start_addr, uint32_t count,
2997-
const char *flavor_string) {
2994+
lldb::DisassemblerSP Target::ReadInstructions(const Address &start_addr,
2995+
uint32_t count,
2996+
const char *flavor_string) {
29982997
if (!m_process_sp)
29992998
return lldb::DisassemblerSP();
30002999

30013000
DataBufferHeap data(GetArchitecture().GetMaximumOpcodeByteSize() * count, 0);
30023001
bool force_live_memory = true;
30033002
lldb_private::Status error;
30043003
lldb::addr_t load_addr = LLDB_INVALID_ADDRESS;
3005-
const size_t bytes_read = ReadMemory(start_addr, data.GetBytes(), data.GetByteSize(),
3006-
error, force_live_memory, &load_addr);
3004+
const size_t bytes_read =
3005+
ReadMemory(start_addr, data.GetBytes(), data.GetByteSize(), error,
3006+
force_live_memory, &load_addr);
30073007

30083008
const bool data_from_file = load_addr == LLDB_INVALID_ADDRESS;
30093009
if (!flavor_string || flavor_string[0] == '\0') {
30103010
// FIXME - we don't have the mechanism in place to do per-architecture
30113011
// settings. But since we know that for now we only support flavors on
30123012
// x86 & x86_64,
3013-
const llvm::Triple::ArchType arch =
3014-
GetArchitecture().GetTriple().getArch();
3013+
const llvm::Triple::ArchType arch = GetArchitecture().GetTriple().getArch();
30153014
if (arch == llvm::Triple::x86 || arch == llvm::Triple::x86_64)
30163015
flavor_string = GetDisassemblyFlavor();
30173016
}
30183017

30193018
return Disassembler::DisassembleBytes(
3020-
GetArchitecture(), nullptr, flavor_string,
3021-
GetDisassemblyCPU(), GetDisassemblyFeatures(),
3022-
start_addr, data.GetBytes(), bytes_read, count, data_from_file);
3019+
GetArchitecture(), nullptr, flavor_string, GetDisassemblyCPU(),
3020+
GetDisassemblyFeatures(), start_addr, data.GetBytes(), bytes_read, count,
3021+
data_from_file);
30233022
}
30243023

30253024
SourceManager &Target::GetSourceManager() {

0 commit comments

Comments
 (0)