Skip to content

Commit 08de320

Browse files
authored
[lldb] Remove Function::GetAddressRange usage from the gui (#130991)
m_disassembly_range was used only to prune the list of breakpoints to those that are in the current function. This isn't really necessary, as the list is only used to highlight instructions with breakpoints on them, and an unpruned list works just as well for that. The shouldn't make things slower, since we still needed through iterate through all breakpoints to create the list, and I doubt anyone will notice the memory used to store the extra breakpoints.
1 parent 5952972 commit 08de320

File tree

1 file changed

+4
-22
lines changed

1 file changed

+4
-22
lines changed

lldb/source/Core/IOHandlerCursesGUI.cpp

Lines changed: 4 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6781,8 +6781,7 @@ class StatusBarWindowDelegate : public WindowDelegate {
67816781
class SourceFileWindowDelegate : public WindowDelegate {
67826782
public:
67836783
SourceFileWindowDelegate(Debugger &debugger)
6784-
: WindowDelegate(), m_debugger(debugger), m_sc(), m_file_sp(),
6785-
m_disassembly_sp(), m_disassembly_range(), m_title() {}
6784+
: WindowDelegate(), m_debugger(debugger) {}
67866785

67876786
~SourceFileWindowDelegate() override = default;
67886787

@@ -6939,12 +6938,8 @@ class SourceFileWindowDelegate : public WindowDelegate {
69396938
m_disassembly_scope = m_sc.function;
69406939
m_disassembly_sp = m_sc.function->GetInstructions(
69416940
exe_ctx, nullptr, !prefer_file_cache);
6942-
if (m_disassembly_sp) {
6941+
if (m_disassembly_sp)
69436942
set_selected_line_to_pc = true;
6944-
m_disassembly_range = m_sc.function->GetAddressRange();
6945-
} else {
6946-
m_disassembly_range.Clear();
6947-
}
69486943
} else {
69496944
set_selected_line_to_pc = context_changed;
69506945
}
@@ -6953,14 +6948,8 @@ class SourceFileWindowDelegate : public WindowDelegate {
69536948
m_disassembly_scope = m_sc.symbol;
69546949
m_disassembly_sp = m_sc.symbol->GetInstructions(
69556950
exe_ctx, nullptr, prefer_file_cache);
6956-
if (m_disassembly_sp) {
6951+
if (m_disassembly_sp)
69576952
set_selected_line_to_pc = true;
6958-
m_disassembly_range.GetBaseAddress() =
6959-
m_sc.symbol->GetAddress();
6960-
m_disassembly_range.SetByteSize(m_sc.symbol->GetByteSize());
6961-
} else {
6962-
m_disassembly_range.Clear();
6963-
}
69646953
} else {
69656954
set_selected_line_to_pc = context_changed;
69666955
}
@@ -7114,13 +7103,7 @@ class SourceFileWindowDelegate : public WindowDelegate {
71147103
++bp_loc_idx) {
71157104
BreakpointLocationSP bp_loc_sp =
71167105
bp_sp->GetLocationAtIndex(bp_loc_idx);
7117-
LineEntry bp_loc_line_entry;
7118-
const lldb::addr_t file_addr =
7119-
bp_loc_sp->GetAddress().GetFileAddress();
7120-
if (file_addr != LLDB_INVALID_ADDRESS) {
7121-
if (m_disassembly_range.ContainsFileAddress(file_addr))
7122-
bp_file_addrs.insert(file_addr);
7123-
}
7106+
bp_file_addrs.insert(bp_loc_sp->GetAddress().GetFileAddress());
71247107
}
71257108
}
71267109
}
@@ -7552,7 +7535,6 @@ class SourceFileWindowDelegate : public WindowDelegate {
75527535
SourceManager::FileSP m_file_sp;
75537536
SymbolContextScope *m_disassembly_scope = nullptr;
75547537
lldb::DisassemblerSP m_disassembly_sp;
7555-
AddressRange m_disassembly_range;
75567538
StreamString m_title;
75577539
lldb::user_id_t m_tid = LLDB_INVALID_THREAD_ID;
75587540
int m_line_width = 4;

0 commit comments

Comments
 (0)