From 3bae94c0fb82d5eb9c36c926534fced6db198d82 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Thu, 16 May 2024 16:50:22 -0400 Subject: gdb: pass program space to get_current_source_symtab_and_line Make the current program space reference bubble up one level. Change-Id: I6ba6dc4a2cb188720cbb61b84ab5c954aac105c6 Approved-By: Tom Tromey Reviewed-By: Thiago Jung Bauermann --- gdb/tui/tui-disasm.c | 3 ++- gdb/tui/tui-hooks.c | 3 ++- gdb/tui/tui-source.c | 5 +++-- gdb/tui/tui-winsource.c | 10 +++++----- 4 files changed, 12 insertions(+), 9 deletions(-) (limited to 'gdb/tui') diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 2f25fed..53be866 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -393,7 +393,8 @@ tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) || have_partial_symbols (current_program_space)) { set_default_source_symtab_and_line (); - struct symtab_and_line sal = get_current_source_symtab_and_line (); + symtab_and_line sal + = get_current_source_symtab_and_line (current_program_space); if (sal.symtab != nullptr) find_line_pc (sal.symtab, sal.line, &addr); diff --git a/gdb/tui/tui-hooks.c b/gdb/tui/tui-hooks.c index e6673ab..25358d0 100644 --- a/gdb/tui/tui-hooks.c +++ b/gdb/tui/tui-hooks.c @@ -127,7 +127,8 @@ tui_refresh_frame_and_register_information () /* Make sure that the source window is displayed. */ tui_add_win_to_layout (SRC_WIN); - struct symtab_and_line sal = get_current_source_symtab_and_line (); + symtab_and_line sal + = get_current_source_symtab_and_line (current_program_space); tui_update_source_windows_with_line (sal); } } diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c index 444c0f7..ee64e41 100644 --- a/gdb/tui/tui-source.c +++ b/gdb/tui/tui-source.c @@ -136,7 +136,8 @@ tui_source_window::do_scroll_vertical (int num_to_scroll) if (!m_content.empty ()) { struct symtab *s; - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); struct gdbarch *arch = m_gdbarch; if (cursal.symtab == NULL) @@ -220,7 +221,7 @@ void tui_source_window::display_start_addr (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p) { - struct symtab_and_line cursal = get_current_source_symtab_and_line (); + symtab_and_line cursal = get_current_source_symtab_and_line (current_program_space); *gdbarch_p = m_gdbarch; find_line_pc (cursal.symtab, m_start_line_or_addr.u.line_no, addr_p); diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 80297e5..b08fca7 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -440,8 +440,8 @@ tui_source_window_base::rerender () if (!m_content.empty ()) { - struct symtab_and_line cursal - = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); if (m_start_line_or_addr.loa == LOA_LINE) cursal.line = m_start_line_or_addr.u.line_no; @@ -451,8 +451,8 @@ tui_source_window_base::rerender () } else if (deprecated_safe_get_selected_frame () != NULL) { - struct symtab_and_line cursal - = get_current_source_symtab_and_line (); + symtab_and_line cursal + = get_current_source_symtab_and_line (current_program_space); frame_info_ptr frame = deprecated_safe_get_selected_frame (); struct gdbarch *gdbarch = get_frame_arch (frame); @@ -492,7 +492,7 @@ tui_source_window_base::refill () if (this == tui_src_win ()) { - sal = get_current_source_symtab_and_line (); + sal = get_current_source_symtab_and_line (current_program_space); if (sal.symtab == NULL) { frame_info_ptr fi = deprecated_safe_get_selected_frame (); -- cgit v1.1