Change tui_update_locator_fullname to take a symtab
authorTom Tromey <tom@tromey.com>
Tue, 12 Nov 2019 23:28:40 +0000 (16:28 -0700)
committerTom Tromey <tom@tromey.com>
Fri, 20 Dec 2019 16:15:48 +0000 (09:15 -0700)
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

gdb/ChangeLog
gdb/tui/tui-disasm.c
gdb/tui/tui-stack.c
gdb/tui/tui-stack.h
gdb/tui/tui-winsource.c
gdb/tui/tui.c

index 1b838b91894578a3a1011352f62aa2b6d97e41d6..5a79f6ae32696eeab2d3743a7723edaab81a134d 100644 (file)
@@ -1,3 +1,13 @@
+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:
index 9819cb9ecaf1f6cafd112a6e7cd26e470afdd8a9..18e281e27566419e4e0aa9e0fe580e1c8406cf7a 100644 (file)
@@ -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);
     }
 }
 
index 078f81992aba7ab46b7afe5247dd706f6e17c450..7803b9538ccc3c4be240b5b735698ac400a5dcad 100644 (file)
@@ -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);
 }
 
index 27af5d2fe1ab42060e309e1b400d6aed857d568f..97e6956029e73b30bd0605031ec2af27f8ecac19 100644 (file)
@@ -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 *);
 
index 6653709e7cbe626f4b8d074bdcc7a470ae2701f6..938a0af312887d559dd6a3015d83424ab9bfc749 100644 (file)
@@ -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);
        }
     }
 }
index dc0d22fd66dae4c9e20b65453d2c36fcab20d999..8bffb30b44f4f98e45ea312fc3ee9930c8ef4ee9 100644 (file)
@@ -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
This page took 0.032706 seconds and 4 git commands to generate.