aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-winsource.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-11-12 17:19:59 -0700
committerTom Tromey <tom@tromey.com>2019-12-20 09:15:51 -0700
commit855f89b3da22a2673b177b2ab99f49974c1ed0e7 (patch)
treec0bad500c5be42b2d396834ef81357d0887c63cf /gdb/tui/tui-winsource.c
parentd4669c0fc75ad5ad2e99748f9307b5038955f9d3 (diff)
downloadgdb-855f89b3da22a2673b177b2ab99f49974c1ed0e7.zip
gdb-855f89b3da22a2673b177b2ab99f49974c1ed0e7.tar.gz
gdb-855f89b3da22a2673b177b2ab99f49974c1ed0e7.tar.bz2
Remove tui_show_disassem
tui_show_disassem is just a wrapper for the update_source_window method, and it only has a single caller. This removes the function and inlines the logic into that caller. gdb/ChangeLog 2019-12-20 Tom Tromey <tom@tromey.com> * tui/tui-winsource.c (tui_update_source_windows_with_addr): Call update_source_window directly. * tui/tui-disasm.h (tui_show_disassem): Don't declare. * tui/tui-disasm.c (tui_show_disassem): Remove. Change-Id: I7ae7a3309f64a4a949c07a80c46e1664c7f12913
Diffstat (limited to 'gdb/tui/tui-winsource.c')
-rw-r--r--gdb/tui/tui-winsource.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 72fbd46..b149936 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -213,15 +213,18 @@ tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr)
{
if (addr != 0)
{
- struct symtab_and_line sal;
+ struct symtab_and_line sal = find_pc_line (addr, 0);
struct tui_line_or_address l;
if (TUI_DISASM_WIN != nullptr)
- tui_show_disassem (gdbarch, addr);
+ {
+ l.loa = LOA_ADDRESS;
+ l.u.addr = addr;
+ TUI_DISASM_WIN->update_source_window (gdbarch, sal.symtab, l);
+ }
if (TUI_SRC_WIN != nullptr)
{
- sal = find_pc_line (addr, 0);
l.loa = LOA_LINE;
l.u.line_no = sal.line;
TUI_SRC_WIN->show_symtab_source (gdbarch, sal.symtab, l);
@@ -262,7 +265,9 @@ tui_update_source_windows_with_line (struct symtab *s, int line)
if (tui_current_layout () == SRC_DISASSEM_COMMAND)
{
find_line_pc (s, line, &pc);
- tui_show_disassem (gdbarch, pc);
+ l.loa = LOA_ADDRESS;
+ l.u.addr = pc;
+ TUI_DISASM_WIN->update_source_window (gdbarch, s, l);
}
break;
}