public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: "Sourceware to Gerrit sync (Code Review)" <gerrit@gnutoolchain-gerrit.osci.io>
To: Tom Tromey <tromey@sourceware.org>, gdb-patches@sourceware.org
Subject: [pushed] Remove tui_show_disassem
Date: Fri, 20 Dec 2019 16:20:00 -0000	[thread overview]
Message-ID: <20191220162010.52E51281DA@gnutoolchain-gerrit.osci.io> (raw)
In-Reply-To: <gerrit.1573774548000.I7ae7a3309f64a4a949c07a80c46e1664c7f12913@gnutoolchain-gerrit.osci.io>

Sourceware to Gerrit sync has submitted this change.

Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/636
......................................................................

Remove tui_show_disassem

tui_show_disassem is just a wrapper for the update_source_window
method, and it only has a single caller.  This removes the function
and inlines the logic into that caller.

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

	* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
	update_source_window directly.
	* tui/tui-disasm.h (tui_show_disassem): Don't declare.
	* tui/tui-disasm.c (tui_show_disassem): Remove.

Change-Id: I7ae7a3309f64a4a949c07a80c46e1664c7f12913
---
M gdb/ChangeLog
M gdb/tui/tui-disasm.c
M gdb/tui/tui-disasm.h
M gdb/tui/tui-winsource.c
4 files changed, 16 insertions(+), 19 deletions(-)


diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 0ef7b0c..15e8894 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,12 @@
 2019-12-20  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
+	update_source_window directly.
+	* tui/tui-disasm.h (tui_show_disassem): Don't declare.
+	* tui/tui-disasm.c (tui_show_disassem): Remove.
+
+2019-12-20  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-winsource.c
 	(tui_source_window_base::update_source_window_as_is): Don't switch focus.
 	* tui/tui-disasm.c (tui_show_disassem): Don't switch focus.
diff --git a/gdb/tui/tui-disasm.c b/gdb/tui/tui-disasm.c
index 11c8b30..c49369a 100644
--- a/gdb/tui/tui-disasm.c
+++ b/gdb/tui/tui-disasm.c
@@ -255,20 +255,6 @@
 }
 
 
-/* Function to display the disassembly window with disassembled code.  */
-void
-tui_show_disassem (struct gdbarch *gdbarch, CORE_ADDR start_addr)
-{
-  struct symtab *s = find_pc_line_symtab (start_addr);
-  struct tui_line_or_address val;
-
-  gdb_assert (TUI_DISASM_WIN != nullptr && TUI_DISASM_WIN->is_visible ());
-
-  val.loa = LOA_ADDRESS;
-  val.u.addr = start_addr;
-  TUI_DISASM_WIN->update_source_window (gdbarch, s, val);
-}
-
 void
 tui_get_begin_asm_address (struct gdbarch **gdbarch_p, CORE_ADDR *addr_p)
 {
diff --git a/gdb/tui/tui-disasm.h b/gdb/tui/tui-disasm.h
index 28f87c6..f5cc373 100644
--- a/gdb/tui/tui-disasm.h
+++ b/gdb/tui/tui-disasm.h
@@ -66,7 +66,6 @@
   bool addr_is_displayed (CORE_ADDR addr) const;
 };
 
-extern void tui_show_disassem (struct gdbarch *, CORE_ADDR);
 extern void tui_get_begin_asm_address (struct gdbarch **, CORE_ADDR *);
 
 #endif /* TUI_TUI_DISASM_H */
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 72fbd46..b149936 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -213,15 +213,18 @@
 {
   if (addr != 0)
     {
-      struct symtab_and_line sal;
+      struct symtab_and_line sal = find_pc_line (addr, 0);
       struct tui_line_or_address l;
       
       if (TUI_DISASM_WIN != nullptr)
-	tui_show_disassem (gdbarch, addr);
+	{
+	  l.loa = LOA_ADDRESS;
+	  l.u.addr = addr;
+	  TUI_DISASM_WIN->update_source_window (gdbarch, sal.symtab, l);
+	}
 
       if (TUI_SRC_WIN != nullptr)
 	{
-	  sal = find_pc_line (addr, 0);
 	  l.loa = LOA_LINE;
 	  l.u.line_no = sal.line;
 	  TUI_SRC_WIN->show_symtab_source (gdbarch, sal.symtab, l);
@@ -262,7 +265,9 @@
       if (tui_current_layout () == SRC_DISASSEM_COMMAND)
 	{
 	  find_line_pc (s, line, &pc);
-	  tui_show_disassem (gdbarch, pc);
+	  l.loa = LOA_ADDRESS;
+	  l.u.addr = pc;
+	  TUI_DISASM_WIN->update_source_window (gdbarch, s, l);
 	}
       break;
     }

-- 
Gerrit-Project: binutils-gdb
Gerrit-Branch: master
Gerrit-Change-Id: I7ae7a3309f64a4a949c07a80c46e1664c7f12913
Gerrit-Change-Number: 636
Gerrit-PatchSet: 3
Gerrit-Owner: Tom Tromey <tromey@sourceware.org>
Gerrit-MessageType: merged

  parent reply	other threads:[~2019-12-20 16:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-14 23:41 [review] " Tom Tromey (Code Review)
2019-12-12  2:35 ` [review v2] " Tom Tromey (Code Review)
2019-12-20 16:20 ` Sourceware to Gerrit sync (Code Review) [this message]
2019-12-20 16:20 ` [pushed] " Sourceware to Gerrit sync (Code Review)

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191220162010.52E51281DA@gnutoolchain-gerrit.osci.io \
    --to=gerrit@gnutoolchain-gerrit.osci.io \
    --cc=gdb-patches@sourceware.org \
    --cc=noreply@gnutoolchain-gerrit.osci.io \
    --cc=tromey@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).