aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
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/mi
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/mi')
-rw-r--r--gdb/mi/mi-out.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/gdb/mi/mi-out.c b/gdb/mi/mi-out.c
index eedc5f7..96a847e 100644
--- a/gdb/mi/mi-out.c
+++ b/gdb/mi/mi-out.c
@@ -27,6 +27,7 @@
#include "interps.h"
#include "ui-out.h"
#include "utils.h"
+#include "gdbsupport/gdb-checked-static-cast.h"
/* Mark beginning of a table. */
@@ -327,11 +328,7 @@ mi_out_new (const char *mi_version)
static mi_ui_out *
as_mi_ui_out (ui_out *uiout)
{
- mi_ui_out *mi_uiout = dynamic_cast<mi_ui_out *> (uiout);
-
- gdb_assert (mi_uiout != NULL);
-
- return mi_uiout;
+ return gdb::checked_static_cast<mi_ui_out *> (uiout);
}
int