aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui/tui-source.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-06-20 20:16:07 -0600
committerTom Tromey <tom@tromey.com>2019-06-25 07:48:45 -0600
commit3add462fff33beb0e6f1480d3853eb56d664b438 (patch)
tree2a2d4b09984d99584af176d3da3dee6fc143ed5c /gdb/tui/tui-source.c
parent489e9d8b7bb3337a7f4f902a03c176c22faeabc7 (diff)
downloadgdb-3add462fff33beb0e6f1480d3853eb56d664b438.zip
gdb-3add462fff33beb0e6f1480d3853eb56d664b438.tar.gz
gdb-3add462fff33beb0e6f1480d3853eb56d664b438.tar.bz2
Separate out locator window
This introduces a new subclass of tui_gen_win_info for the locator, letting us remove another element from union tui_which_element. gdb/ChangeLog 2019-06-25 Tom Tromey <tom@tromey.com> * tui/tui-wingeneral.c (tui_refresh_all): Update. * tui/tui-win.c (tui_resize_all, tui_adjust_win_heights) (tui_source_window_base::set_new_height): Update. * tui/tui-stack.c (tui_make_status_line): Change parameter type. Update. (tui_set_locator_fullname, tui_set_locator_info) (tui_show_frame_info): Update. * tui/tui-source.c (tui_set_source_content) (tui_source_is_displayed): Update. * tui/tui-layout.c (show_source_disasm_command, show_data) (show_source_or_disasm_and_command): Update. * tui/tui-disasm.c (tui_set_disassem_content) (tui_get_begin_asm_address): Update. * tui/tui-data.h (struct tui_locator_element): Remove. (union tui_which_element) <locator>: Remove. (struct tui_locator_window): New. (tui_locator_win_info_ptr): Change return type. * tui/tui-data.c (_locator): Change type. (tui_locator_win_info_ptr): Change return type. (init_content_element): Remove LOCATOR_WIN case. Add assert. (tui_alloc_content): Add assert.
Diffstat (limited to 'gdb/tui/tui-source.c')
-rw-r--r--gdb/tui/tui-source.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/gdb/tui/tui-source.c b/gdb/tui/tui-source.c
index 54e53cf..e1448db 100644
--- a/gdb/tui/tui-source.c
+++ b/gdb/tui/tui-source.c
@@ -157,7 +157,7 @@ tui_set_source_content (struct symtab *s,
else
{
int cur_line_no, cur_line;
- struct tui_gen_win_info *locator
+ struct tui_locator_window *locator
= tui_locator_win_info_ptr ();
struct tui_source_window_base *src
= (struct tui_source_window_base *) TUI_SRC_WIN;
@@ -194,12 +194,9 @@ tui_set_source_content (struct symtab *s,
element->which_element.source.line_or_addr.u.line_no =
cur_line_no;
element->which_element.source.is_exec_point =
- (filename_cmp (locator->content[0]
- ->which_element.locator.full_name,
+ (filename_cmp (locator->full_name,
symtab_to_fullname (s)) == 0
- && cur_line_no
- == locator->content[0]
- ->which_element.locator.line_no);
+ && cur_line_no == locator->line_no);
xfree (TUI_SRC_WIN->content[cur_line]
->which_element.source.line);
@@ -300,8 +297,7 @@ tui_source_is_displayed (const char *fullname)
{
return (TUI_SRC_WIN != NULL
&& TUI_SRC_WIN->content_in_use
- && (filename_cmp (tui_locator_win_info_ptr ()->content[0]
- ->which_element.locator.full_name,
+ && (filename_cmp (tui_locator_win_info_ptr ()->full_name,
fullname) == 0));
}