[Lldb-commits] [lldb] [lldb][API] Make SB-API functions const if possible. (PR #172687)

Ebuka Ezike via lldb-commits lldb-commits at lists.llvm.org
Thu Dec 18 13:12:50 PST 2025


================
@@ -202,12 +202,12 @@ SymbolType SBSymbol::GetType() {
   return eSymbolTypeInvalid;
 }
 
-uint32_t SBSymbol::GetID() {
+uint32_t SBSymbol::GetID() const {
   LLDB_INSTRUMENT_VA(this);
 
   if (m_opaque_ptr)
     return m_opaque_ptr->GetID();
-  return 0;
+  return UINT32_MAX;
----------------
da-viper wrote:

Because the `SBSymbol ID` can be zero. see

passed to the `ParseSymbollambda` 
https://github.com/llvm/llvm-project/blob/759fb0a224e85c01fffcd42b1e71a4bea6fc757e/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp#L4312-L4323

-----------
and set in the lambda.
https://github.com/llvm/llvm-project/blob/759fb0a224e85c01fffcd42b1e71a4bea6fc757e/lldb/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp#L4276-L4278


https://github.com/llvm/llvm-project/pull/172687


More information about the lldb-commits mailing list