diff options
author | Tom Tromey <tom@tromey.com> | 2019-11-12 17:59:06 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-12-20 09:15:53 -0700 |
commit | 88180c082424fd90e8a5967f8c84533f7cc6380f (patch) | |
tree | c63fb17cf9aca657506418734d4a9ab15746d297 /gdb | |
parent | 9f7540a5deb07875fb8e75de86857a9cae8bd30a (diff) | |
download | gdb-88180c082424fd90e8a5967f8c84533f7cc6380f.zip gdb-88180c082424fd90e8a5967f8c84533f7cc6380f.tar.gz gdb-88180c082424fd90e8a5967f8c84533f7cc6380f.tar.bz2 |
Simplify tui_update_source_windows_with_addr
After the previous changes, tui_update_source_windows_with_addr simply
updates each source-like window separately, passing the same data to
each. So, it can be simplified by using a loop instead.
gdb/ChangeLog
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui-winsource.c (tui_update_source_windows_with_addr):
Simplify.
Change-Id: Id2ba6b3145ec005dbed1b1115118bd1ef4efb842
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ChangeLog | 5 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.c | 17 |
2 files changed, 9 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index feb406b..77620d0 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2019-12-20 Tom Tromey <tom@tromey.com> + * tui/tui-winsource.c (tui_update_source_windows_with_addr): + Simplify. + +2019-12-20 Tom Tromey <tom@tromey.com> + * tui/tui-winsource.h (struct tui_source_window_base) <set_contents, update_source_window_as_is, update_source_window>: Take a sal, not a separate symtab and tui_line_or_address. diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index cad7dea..8f98904 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -206,21 +206,12 @@ tui_source_window_base::update_source_window_as_is void tui_update_source_windows_with_addr (struct gdbarch *gdbarch, CORE_ADDR addr) { + struct symtab_and_line sal {}; if (addr != 0) - { - struct symtab_and_line sal = find_pc_line (addr, 0); - - if (TUI_DISASM_WIN != nullptr) - TUI_DISASM_WIN->update_source_window (gdbarch, sal); + sal = find_pc_line (addr, 0); - if (TUI_SRC_WIN != nullptr) - TUI_SRC_WIN->update_source_window (gdbarch, sal); - } - else - { - for (struct tui_source_window_base *win_info : tui_source_windows ()) - win_info->erase_source_content (); - } + for (struct tui_source_window_base *win_info : tui_source_windows ()) + win_info->update_source_window (gdbarch, sal); } /* Function to ensure that the source and/or disassemly windows |