Use gdb::checked_static_cast for watchpoints

This replaces some casts to 'watchpoint *' with checked_static_cast.
In one spot, an unnecessary block is also removed.

Approved-By: Simon Marchi <simon.marchi@efficios.com>
This commit is contained in:
Tom Tromey
2023-09-15 11:56:35 -06:00
parent 093da43d2a
commit bcafd1c19e
3 changed files with 146 additions and 153 deletions

View File

@@ -890,12 +890,11 @@ gdbscm_breakpoint_expression (SCM self)
{
breakpoint_smob *bp_smob
= bpscm_get_valid_breakpoint_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
struct watchpoint *wp;
if (!is_watchpoint (bp_smob->bp))
return SCM_BOOL_F;
wp = (struct watchpoint *) bp_smob->bp;
watchpoint *wp = gdb::checked_static_cast<watchpoint *> (bp_smob->bp);
const char *str = wp->exp_string.get ();
if (! str)