Use start_line_or_addr in TUI windows
authorTom Tromey <tom@tromey.com>
Wed, 13 Nov 2019 00:40:33 +0000 (17:40 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 20 Dec 2019 16:15:52 +0000 (09:15 -0700)
A few spots in the TUI source and disassembly windows referred to
content[0], where start_line_or_addr is equivalent.  This patch makes
this substitution.

gdb/ChangeLog
2019-12-20  Tom Tromey  <tom@tromey.com>

* tui/tui-winsource.c (tui_source_window_base::refill): Use
start_line_or_addr.
* tui/tui-source.c (tui_source_window::do_scroll_vertical): Use
start_line_or_addr.
* tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Use
start_line_or_addr.

Change-Id: I1fa807321cd7ad88b3cc5e41cc50f4d4e2d46271

gdb/ChangeLog
gdb/tui/tui-disasm.c
gdb/tui/tui-source.c
gdb/tui/tui-winsource.c

index 2994728395ba63efcb876e76fb6da2e1ca779896..fef0cfcc1f41b7d83d6bccd95a37b14c0ef66e5f 100644 (file)
@@ -1,3 +1,12 @@
+2019-12-20  Tom Tromey  <tom@tromey.com>
+
+       * tui/tui-winsource.c (tui_source_window_base::refill): Use
+       start_line_or_addr.
+       * tui/tui-source.c (tui_source_window::do_scroll_vertical): Use
+       start_line_or_addr.
+       * tui/tui-disasm.c (tui_disasm_window::do_scroll_vertical): Use
+       start_line_or_addr.
+
 2019-12-20  Tom Tromey  <tom@tromey.com>
 
        * tui/tui-winsource.h (struct tui_source_window_base)
index 080253c8279df02e76397a3108a00d798ec52da9..8a46bbab0354279b3c37d46cc267b82b41c04339 100644 (file)
@@ -325,7 +325,7 @@ tui_disasm_window::do_scroll_vertical (int num_to_scroll)
       CORE_ADDR pc;
       struct tui_line_or_address val;
 
-      pc = content[0].line_or_addr.u.addr;
+      pc = start_line_or_addr.u.addr;
       if (num_to_scroll >= 0)
        num_to_scroll++;
       else
index 78afc62ec6ebdba7da20923c708bb4dc7d836bb3..113195da3cb39991b6eebc1b3190e05095481075 100644 (file)
@@ -147,14 +147,14 @@ tui_source_window::do_scroll_vertical (int num_to_scroll)
        s = cursal.symtab;
 
       l.loa = LOA_LINE;
-      l.u.line_no = content[0].line_or_addr.u.line_no
+      l.u.line_no = start_line_or_addr.u.line_no
        + num_to_scroll;
       const std::vector<off_t> *offsets;
       if (g_source_cache.get_line_charpos (s, &offsets)
          && l.u.line_no > offsets->size ())
        /* line = s->nlines - win_info->content_size + 1; */
        /* elz: fix for dts 23398.  */
-       l.u.line_no = content[0].line_or_addr.u.line_no;
+       l.u.line_no = start_line_or_addr.u.line_no;
       if (l.u.line_no <= 0)
        l.u.line_no = 1;
 
index fad8d7ba11ec86c7ca2c60b28095870449054bef..708c2fe5d7ff087ed32cf28023a90c265f9070dd 100644 (file)
@@ -413,7 +413,7 @@ tui_source_window_base::refill ()
           : cursal.symtab);
     }
 
-  update_source_window_as_is (gdbarch, s, content[0].line_or_addr);
+  update_source_window_as_is (gdbarch, s, start_line_or_addr);
 }
 
 /* Scroll the source forward or backward horizontally.  */