-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[lldb] s/GetAddressRange().GetBaseAddress()/GetAddress() #125847
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Three more cases where it's obvious that the code is looking for the address of the function entry point.
@@ -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()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
.. because two parts of the function can be in different sections.
@llvm/pr-subscribers-lldb Author: Pavel Labath (labath) ChangesThree more cases where it's obvious that the code is looking for the address of the function entry point. Full diff: https://github.com/llvm/llvm-project/pull/125847.diff 3 Files Affected:
diff --git a/lldb/source/API/SBFunction.cpp b/lldb/source/API/SBFunction.cpp
index d07594c2e8c010..19861f6af3645e 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 fb7043ac74b8dd..7fe22994d7f7ee 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 27a9edeef4249e..d63d42de14e801 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);
}
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM.
Three more cases where it's obvious that the code is looking for the address of the function entry point.
Three more cases where it's obvious that the code is looking for the address of the function entry point.