[Lldb-commits] [lldb] 0cfb98f - [lldb] s/GetAddressRange().GetBaseAddress()/GetAddress() (#125847)

via lldb-commits lldb-commits at lists.llvm.org
Thu Feb 6 00:17:53 PST 2025


Author: Pavel Labath
Date: 2025-02-06T09:17:50+01:00
New Revision: 0cfb98f871b6bc82691b5aa85b20703de1621875

URL: https://github.com/llvm/llvm-project/commit/0cfb98f871b6bc82691b5aa85b20703de1621875
DIFF: https://github.com/llvm/llvm-project/commit/0cfb98f871b6bc82691b5aa85b20703de1621875.diff

LOG: [lldb] s/GetAddressRange().GetBaseAddress()/GetAddress() (#125847)

Three more cases where it's obvious that the code is looking for the
address of the function entry point.

Added: 
    

Modified: 
    lldb/source/API/SBFunction.cpp
    lldb/source/Core/FormatEntity.cpp
    lldb/source/Core/SourceManager.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp
index d07594c2e8c0105..19861f6af3645e4 100644
--- a/lldb/source/API/SBFunction.cpp
+++ b/lldb/source/API/SBFunction.cpp
@@ -144,7 +144,7 @@ SBAddress SBFunction::GetStartAddress() {
 
   SBAddress addr;
   if (m_opaque_ptr)
-    addr.SetAddress(m_opaque_ptr->GetAddressRange().GetBaseAddress());
+    addr.SetAddress(m_opaque_ptr->GetAddress());
   return addr;
 }
 

diff  --git a/lldb/source/Core/FormatEntity.cpp b/lldb/source/Core/FormatEntity.cpp
index fb7043ac74b8ddc..7fe22994d7f7ee5 100644
--- a/lldb/source/Core/FormatEntity.cpp
+++ b/lldb/source/Core/FormatEntity.cpp
@@ -450,7 +450,7 @@ static bool DumpAddressOffsetFromFunction(Stream &s, const SymbolContext *sc,
 
     if (sc) {
       if (sc->function) {
-        func_addr = sc->function->GetAddressRange().GetBaseAddress();
+        func_addr = sc->function->GetAddress();
         if (sc->block && !concrete_only) {
           // Check to make sure we aren't in an inline function. If we are, use
           // the inline block range that contains "format_addr" since blocks
@@ -468,7 +468,7 @@ static bool DumpAddressOffsetFromFunction(Stream &s, const SymbolContext *sc,
     if (func_addr.IsValid()) {
       const char *addr_offset_padding = no_padding ? "" : " ";
 
-      if (func_addr.GetSection() == format_addr.GetSection()) {
+      if (func_addr.GetModule() == format_addr.GetModule()) {
         addr_t func_file_addr = func_addr.GetFileAddress();
         addr_t addr_file_addr = format_addr.GetFileAddress();
         if (addr_file_addr > func_file_addr ||

diff  --git a/lldb/source/Core/SourceManager.cpp b/lldb/source/Core/SourceManager.cpp
index 27a9edeef4249e0..d63d42de14e8019 100644
--- a/lldb/source/Core/SourceManager.cpp
+++ b/lldb/source/Core/SourceManager.cpp
@@ -435,9 +435,8 @@ SourceManager::GetDefaultFileAndLine() {
         for (const SymbolContext &sc : sc_list) {
           if (sc.function) {
             lldb_private::LineEntry line_entry;
-            if (sc.function->GetAddressRange()
-                    .GetBaseAddress()
-                    .CalculateSymbolContextLineEntry(line_entry)) {
+            if (sc.function->GetAddress().CalculateSymbolContextLineEntry(
+                    line_entry)) {
               SetDefaultFileAndLine(line_entry.file_sp, line_entry.line);
               return SupportFileAndLine(line_entry.file_sp, m_last_line);
             }


        


More information about the lldb-commits mailing list