Skip to content

Commit 556eb90

Browse files
authored
[lldb][API] Make SB-API functions const if possible. (llvm#172687)
Only applied to functions that were added after 22.x tag.
1 parent 6004389 commit 556eb90

File tree

13 files changed

+19
-19
lines changed

13 files changed

+19
-19
lines changed

lldb/include/lldb/API/SBDebugger.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ class LLDB_API SBDebugger {
360360
const char *arch);
361361

362362
/// Find a target with the specified unique ID.
363-
lldb::SBTarget FindTargetByGloballyUniqueID(lldb::user_id_t id);
363+
lldb::SBTarget FindTargetByGloballyUniqueID(lldb::user_id_t id) const;
364364

365365
/// Get the number of targets in the debugger.
366366
uint32_t GetNumTargets();

lldb/include/lldb/API/SBModuleSpec.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class LLDB_API SBModuleSpec {
8787

8888
bool GetDescription(lldb::SBStream &description);
8989

90-
lldb::SBTarget GetTarget();
90+
lldb::SBTarget GetTarget() const;
9191

9292
/// Set the target to be used when resolving a module.
9393
///

lldb/include/lldb/API/SBSaveCoreOptions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ class LLDB_API SBSaveCoreOptions {
8484
///
8585
/// \return
8686
/// The set process, or an invalid SBProcess if no process is set.
87-
SBProcess GetProcess();
87+
SBProcess GetProcess() const;
8888

8989
/// Add a thread to save in the core file.
9090
///
@@ -132,7 +132,7 @@ class LLDB_API SBSaveCoreOptions {
132132
/// \returns
133133
/// An unsorted copy of all memory regions to save. If no process or style
134134
/// is specified an empty collection will be returned.
135-
SBMemoryRegionInfoList GetMemoryRegionsToSave();
135+
SBMemoryRegionInfoList GetMemoryRegionsToSave() const;
136136

137137
/// Get the current total number of bytes the core is expected to have
138138
/// excluding the overhead of the core file format. Requires a Process and

lldb/include/lldb/API/SBSymbol.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class LLDB_API SBSymbol {
9191
///
9292
/// \returns
9393
/// Returns the ID of this symbol.
94-
uint32_t GetID();
94+
uint32_t GetID() const;
9595

9696
bool operator==(const lldb::SBSymbol &rhs) const;
9797

@@ -108,7 +108,7 @@ class LLDB_API SBSymbol {
108108
bool IsSynthetic();
109109

110110
/// Returns true if the symbol is a debug symbol.
111-
bool IsDebug();
111+
bool IsDebug() const;
112112

113113
/// Get the string representation of a symbol type.
114114
static const char *GetTypeAsString(lldb::SymbolType symbol_type);

lldb/include/lldb/API/SBTarget.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ class LLDB_API SBTarget {
338338
/// \return
339339
/// A lldb::SBModule object that represents the found module, or an
340340
/// invalid SBModule object if no module was found.
341-
lldb::SBModule FindModule(const lldb::SBModuleSpec &module_spec);
341+
lldb::SBModule FindModule(const lldb::SBModuleSpec &module_spec) const;
342342

343343
/// Find compile units related to *this target and passed source
344344
/// file.
@@ -359,7 +359,7 @@ class LLDB_API SBTarget {
359359

360360
const char *GetTriple();
361361

362-
const char *GetArchName();
362+
const char *GetArchName() const;
363363

364364
const char *GetABIName();
365365

lldb/include/lldb/API/SBThread.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ class LLDB_API SBThread {
186186

187187
lldb::SBFrame GetFrameAtIndex(uint32_t idx);
188188

189-
lldb::SBFrameList GetFrames();
189+
lldb::SBFrameList GetFrames() const;
190190

191191
lldb::SBFrame GetSelectedFrame();
192192

lldb/include/lldb/Symbol/SaveCoreOptions.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class SaveCoreOptions {
3737
const std::optional<lldb_private::FileSpec> GetOutputFile() const;
3838

3939
Status SetProcess(lldb::ProcessSP process_sp);
40-
lldb::ProcessSP GetProcess() { return m_process_sp; }
40+
lldb::ProcessSP GetProcess() const { return m_process_sp; }
4141

4242
Status AddThread(lldb::ThreadSP thread_sp);
4343
bool RemoveThread(lldb::ThreadSP thread_sp);

lldb/source/API/SBDebugger.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -937,7 +937,7 @@ uint32_t SBDebugger::GetIndexOfTarget(lldb::SBTarget target) {
937937
return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP());
938938
}
939939

940-
SBTarget SBDebugger::FindTargetByGloballyUniqueID(lldb::user_id_t id) {
940+
SBTarget SBDebugger::FindTargetByGloballyUniqueID(lldb::user_id_t id) const {
941941
LLDB_INSTRUMENT_VA(this, id);
942942
SBTarget sb_target;
943943
if (m_opaque_sp) {

lldb/source/API/SBModuleSpec.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ void SBModuleSpec::SetObjectSize(uint64_t object_size) {
175175
m_opaque_up->SetObjectSize(object_size);
176176
}
177177

178-
SBTarget SBModuleSpec::GetTarget() {
178+
SBTarget SBModuleSpec::GetTarget() const {
179179
LLDB_INSTRUMENT_VA(this);
180180

181181
return SBTarget(m_opaque_up->GetTargetSP());

lldb/source/API/SBSaveCoreOptions.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ SBError SBSaveCoreOptions::SetProcess(lldb::SBProcess process) {
8181
return m_opaque_up->SetProcess(process.GetSP());
8282
}
8383

84-
SBProcess SBSaveCoreOptions::GetProcess() {
84+
SBProcess SBSaveCoreOptions::GetProcess() const {
8585
LLDB_INSTRUMENT_VA(this);
8686
return SBProcess(m_opaque_up->GetProcess());
8787
}
@@ -133,7 +133,7 @@ uint64_t SBSaveCoreOptions::GetCurrentSizeInBytes(SBError &error) {
133133
return *expected_bytes;
134134
}
135135

136-
lldb::SBMemoryRegionInfoList SBSaveCoreOptions::GetMemoryRegionsToSave() {
136+
lldb::SBMemoryRegionInfoList SBSaveCoreOptions::GetMemoryRegionsToSave() const {
137137
LLDB_INSTRUMENT_VA(this);
138138
llvm::Expected<lldb_private::CoreFileMemoryRanges> memory_ranges =
139139
m_opaque_up->GetMemoryRegionsToSave();

0 commit comments

Comments
 (0)