diff options
author | Tom Tromey <tromey@adacore.com> | 2023-09-15 11:56:35 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-19 08:14:00 -0600 |
commit | bcafd1c19e628d831cf3eb20229c42ad9db4b29c (patch) | |
tree | a58aa837bc4a621d4881054379da7ad2ce9df5a2 /gdb/python | |
parent | 093da43d2adb4497dfec8afbb4eeaf2425668fdd (diff) | |
download | gdb-bcafd1c19e628d831cf3eb20229c42ad9db4b29c.zip gdb-bcafd1c19e628d831cf3eb20229c42ad9db4b29c.tar.gz gdb-bcafd1c19e628d831cf3eb20229c42ad9db4b29c.tar.bz2 |
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>
Diffstat (limited to 'gdb/python')
-rw-r--r-- | gdb/python/py-breakpoint.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c index cb06451..71182cc 100644 --- a/gdb/python/py-breakpoint.c +++ b/gdb/python/py-breakpoint.c @@ -549,14 +549,13 @@ bppy_get_expression (PyObject *self, void *closure) { const char *str; gdbpy_breakpoint_object *obj = (gdbpy_breakpoint_object *) self; - struct watchpoint *wp; BPPY_REQUIRE_VALID (obj); if (!is_watchpoint (obj->bp)) Py_RETURN_NONE; - wp = (struct watchpoint *) obj->bp; + watchpoint *wp = gdb::checked_static_cast<watchpoint *> (obj->bp); str = wp->exp_string.get (); if (! str) |