Patchwork [review] Remove some TUI asserts

login
register
mail settings
Submitter Simon Marchi (Code Review)
Date Nov. 14, 2019, 11:35 p.m.
Message ID <gerrit.1573774548000.I807e1e9bdb0cfa475e70375ceca3a5d4f2eb8d0b@gnutoolchain-gerrit.osci.io>
Download mbox | patch
Permalink /patch/35907/
State New
Headers show

Comments

Simon Marchi (Code Review) - Nov. 14, 2019, 11:35 p.m.
Change URL: https://gnutoolchain-gerrit.osci.io/r/c/binutils-gdb/+/633
......................................................................

Remove some TUI asserts

This removes a few asserts from the TUI.  These asserts aren't useful,
because they simply check an invariant that's already ensured by the
type system.

gdb/ChangeLog
2019-11-14  Tom Tromey  <tom@tromey.com>

	* tui/tui-winsource.c (tui_source_window_base::set_is_exec_point_at)
	(tui_source_window_base::update_breakpoint_info): Remove asserts.

Change-Id: I807e1e9bdb0cfa475e70375ceca3a5d4f2eb8d0b
---
M gdb/ChangeLog
M gdb/tui/tui-winsource.c
2 files changed, 5 insertions(+), 6 deletions(-)

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2bd3534..edb8cf0 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@ 
 2019-11-14  Tom Tromey  <tom@tromey.com>
 
+	* tui/tui-winsource.c (tui_source_window_base::set_is_exec_point_at)
+	(tui_source_window_base::update_breakpoint_info): Remove asserts.
+
+2019-11-14  Tom Tromey  <tom@tromey.com>
+
 	* tui/tui-winsource.c (tui_update_source_windows_with_addr): Call
 	tui_show_disassem.
 	* tui/tui-disasm.h (tui_show_disassem_and_update_source): Don't
diff --git a/gdb/tui/tui-winsource.c b/gdb/tui/tui-winsource.c
index 2cd4b65..8e1d61a 100644
--- a/gdb/tui/tui-winsource.c
+++ b/gdb/tui/tui-winsource.c
@@ -442,9 +442,6 @@ 
       struct tui_line_or_address content_loa =
 	content[i].line_or_addr;
 
-      gdb_assert (l.loa == LOA_ADDRESS || l.loa == LOA_LINE);
-      gdb_assert (content_loa.loa == LOA_LINE
-		  || content_loa.loa == LOA_ADDRESS);
       if (content_loa.loa == l.loa
 	  && ((l.loa == LOA_LINE && content_loa.u.line_no == l.u.line_no)
               || (l.loa == LOA_ADDRESS && content_loa.u.addr == l.u.addr)))
@@ -505,9 +502,6 @@ 
         {
 	  struct bp_location *loc;
 
-	  gdb_assert (line->line_or_addr.loa == LOA_LINE
-		      || line->line_or_addr.loa == LOA_ADDRESS);
-
 	  if (bp == being_deleted)
 	    return false;