diff options
author | Tom Tromey <tom@tromey.com> | 2019-11-12 16:28:40 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2019-12-20 09:15:48 -0700 |
commit | c1b167d76ec06c02f1aaa176c3dcfb1b4d8cee0c (patch) | |
tree | 44a58ed8b9a1b3e08fc77d456e5cdf20bf187597 | |
parent | 364d710448e607e4ae9cb338583179dd6e734f0b (diff) | |
download | binutils-gdb-c1b167d76ec06c02f1aaa176c3dcfb1b4d8cee0c.tar.gz |
Change tui_update_locator_fullname to take a symtab
This changes tui_update_locator_fullname to take a symtab. This
somewhat consolidates the "??" handling.
gdb/ChangeLog
2019-12-20 Tom Tromey <tom@tromey.com>
* tui/tui.c (tui_show_source): Update.
* tui/tui-winsource.c (tui_display_main): Update.
* tui/tui-stack.h (tui_update_locator_fullname): Change parameter
to symtab.
* tui/tui-stack.c (tui_update_locator_fullname): Change parameter
to symtab.
* tui/tui-disasm.c (tui_show_disassem_and_update_source): Update.
Change-Id: Ic61749517b44ac68561d829ff81f16976b830dec
-rw-r--r-- | gdb/ChangeLog | 10 | ||||
-rw-r--r-- | gdb/tui/tui-disasm.c | 8 | ||||
-rw-r--r-- | gdb/tui/tui-stack.c | 7 | ||||
-rw-r--r-- | gdb/tui/tui-stack.h | 2 | ||||
-rw-r--r-- | gdb/tui/tui-winsource.c | 5 | ||||
-rw-r--r-- | gdb/tui/tui.c | 2 |
6 files changed, 21 insertions, 13 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1b838b91894..5a79f6ae326 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,15 @@ 2019-12-20 Tom Tromey <tom@tromey.com> + * tui/tui.c (tui_show_source): Update. + * tui/tui-winsource.c (tui_display_main): Update. + * tui/tui-stack.h (tui_update_locator_fullname): Change parameter + to symtab. + * tui/tui-stack.c (tui_update_locator_fullname): Change parameter + to symtab. + * tui/tui-disasm.c (tui_show_disassem_and_update_source): Update. + +2019-12-20 Tom Tromey <tom@tromey.com> + PR tui/23619: * tui/tui-io.c (tui_rl_saved_prompt): Remove. (tui_redisplay_readline): Use rl_display_prompt. diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c index 9819cb9ecaf..18e281e2756 100644 --- a/gdb/tui/tui-disasm.c +++ b/gdb/tui/tui-disasm.c @@ -297,12 +297,8 @@ tui_show_disassem_and_update_source (struct gdbarch *gdbarch, val.u.line_no = sal.line; TUI_SRC_WIN->update_source_window (gdbarch, sal.symtab, val); if (sal.symtab) - { - set_current_source_symtab_and_line (sal); - tui_update_locator_fullname (symtab_to_fullname (sal.symtab)); - } - else - tui_update_locator_fullname ("?"); + set_current_source_symtab_and_line (sal); + tui_update_locator_fullname (sal.symtab); } } diff --git a/gdb/tui/tui-stack.c b/gdb/tui/tui-stack.c index 078f81992ab..7803b9538cc 100644 --- a/gdb/tui/tui-stack.c +++ b/gdb/tui/tui-stack.c @@ -288,10 +288,15 @@ tui_locator_window::set_locator_info (struct gdbarch *gdbarch_in, /* Update only the full_name portion of the locator. */ void -tui_update_locator_fullname (const char *fullname) +tui_update_locator_fullname (struct symtab *symtab) { struct tui_locator_window *locator = tui_locator_win_info_ptr (); + const char *fullname; + if (symtab != nullptr) + fullname = symtab_to_fullname (symtab); + else + fullname = "??"; locator->set_locator_fullname (fullname); } diff --git a/gdb/tui/tui-stack.h b/gdb/tui/tui-stack.h index 27af5d2fe1a..97e6956029e 100644 --- a/gdb/tui/tui-stack.h +++ b/gdb/tui/tui-stack.h @@ -77,7 +77,7 @@ private: std::string make_status_line () const; }; -extern void tui_update_locator_fullname (const char *); +extern void tui_update_locator_fullname (struct symtab *symtab); extern void tui_show_locator_content (void); extern int tui_show_frame_info (struct frame_info *); diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c index 6653709e7cb..938a0af3128 100644 --- a/gdb/tui/tui-winsource.c +++ b/gdb/tui/tui-winsource.c @@ -57,10 +57,7 @@ tui_display_main () tui_update_source_windows_with_addr (gdbarch, addr); s = find_pc_line_symtab (addr); - if (s != NULL) - tui_update_locator_fullname (symtab_to_fullname (s)); - else - tui_update_locator_fullname ("??"); + tui_update_locator_fullname (s); } } } diff --git a/gdb/tui/tui.c b/gdb/tui/tui.c index dc0d22fd66d..8bffb30b44f 100644 --- a/gdb/tui/tui.c +++ b/gdb/tui/tui.c @@ -635,7 +635,7 @@ tui_show_source (const char *fullname, int line) tui_add_win_to_layout (SRC_WIN); tui_update_source_windows_with_line (cursal.symtab, line); - tui_update_locator_fullname (fullname); + tui_update_locator_fullname (cursal.symtab); } void |