aboutsummaryrefslogtreecommitdiff
path: root/gdb/tui
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2022-08-17 11:47:17 -0600
committerTom Tromey <tromey@adacore.com>2022-09-12 14:25:06 -0600
commit5f48d886a9ce0b7d109a26c860adf66330ca65cf (patch)
tree27ac0194e55feb3eb8a4a1ea9541fa4cec0c6652 /gdb/tui
parent29a6701e530a4119d3c0d261da2b7b24034c9233 (diff)
downloadgdb-5f48d886a9ce0b7d109a26c860adf66330ca65cf.zip
gdb-5f48d886a9ce0b7d109a26c860adf66330ca65cf.tar.gz
gdb-5f48d886a9ce0b7d109a26c860adf66330ca65cf.tar.bz2
Use checked_static_cast in more places
I went through all the uses of dynamic_cast<> in gdb, looking for ones that could be replaced with checked_static_cast. This patch is the result. Regression tested on x86-64 Fedora 34.
Diffstat (limited to 'gdb/tui')
-rw-r--r--gdb/tui/tui-io.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c
index 0efaf69..a30000e 100644
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -45,6 +45,7 @@
#include "gdb_curses.h"
#include <map>
#include "pager.h"
+#include "gdbsupport/gdb-checked-static-cast.h"
/* This redefines CTRL if it is not already defined, so it must come
after terminal state releated include files like <term.h> and
@@ -832,8 +833,7 @@ tui_setup_io (int mode)
tui_old_stdout = gdb_stdout;
tui_old_stderr = gdb_stderr;
tui_old_stdlog = gdb_stdlog;
- tui_old_uiout = dynamic_cast<cli_ui_out *> (current_uiout);
- gdb_assert (tui_old_uiout != nullptr);
+ tui_old_uiout = gdb::checked_static_cast<cli_ui_out *> (current_uiout);
/* Reconfigure gdb output. */
gdb_stdout = tui_stdout;