Skip to content

Commit 0cfb98f

Browse files
authored
[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.
1 parent feb5a77 commit 0cfb98f

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lldb/source/API/SBFunction.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ SBAddress SBFunction::GetStartAddress() {
144144

145145
SBAddress addr;
146146
if (m_opaque_ptr)
147-
addr.SetAddress(m_opaque_ptr->GetAddressRange().GetBaseAddress());
147+
addr.SetAddress(m_opaque_ptr->GetAddress());
148148
return addr;
149149
}
150150

lldb/source/Core/FormatEntity.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ static bool DumpAddressOffsetFromFunction(Stream &s, const SymbolContext *sc,
450450

451451
if (sc) {
452452
if (sc->function) {
453-
func_addr = sc->function->GetAddressRange().GetBaseAddress();
453+
func_addr = sc->function->GetAddress();
454454
if (sc->block && !concrete_only) {
455455
// Check to make sure we aren't in an inline function. If we are, use
456456
// the inline block range that contains "format_addr" since blocks
@@ -468,7 +468,7 @@ static bool DumpAddressOffsetFromFunction(Stream &s, const SymbolContext *sc,
468468
if (func_addr.IsValid()) {
469469
const char *addr_offset_padding = no_padding ? "" : " ";
470470

471-
if (func_addr.GetSection() == format_addr.GetSection()) {
471+
if (func_addr.GetModule() == format_addr.GetModule()) {
472472
addr_t func_file_addr = func_addr.GetFileAddress();
473473
addr_t addr_file_addr = format_addr.GetFileAddress();
474474
if (addr_file_addr > func_file_addr ||

lldb/source/Core/SourceManager.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -435,9 +435,8 @@ SourceManager::GetDefaultFileAndLine() {
435435
for (const SymbolContext &sc : sc_list) {
436436
if (sc.function) {
437437
lldb_private::LineEntry line_entry;
438-
if (sc.function->GetAddressRange()
439-
.GetBaseAddress()
440-
.CalculateSymbolContextLineEntry(line_entry)) {
438+
if (sc.function->GetAddress().CalculateSymbolContextLineEntry(
439+
line_entry)) {
441440
SetDefaultFileAndLine(line_entry.file_sp, line_entry.line);
442441
return SupportFileAndLine(line_entry.file_sp, m_last_line);
443442
}

0 commit comments

Comments
 (0)