[0/4] Use checked_static_cast for breakpoint casts

Message ID 20230915-watchpoint-casts-v1-0-a4ff35c9644e@adacore.com
Headers
Series Use checked_static_cast for breakpoint casts |

Message

Tom Tromey Sept. 15, 2023, 6:36 p.m. UTC
  While reviewing a patch, I noticed some unchecked casts to watchpoint.
This series replaces all the unchecked breakpoint casts I could find
with checked casts.

Regression tested on x86-64 Fedora 36.

---
Tom Tromey (4):
      Use gdb::checked_static_cast for watchpoints
      Use gdb::checked_static_cast for tracepoints
      Use gdb::checked_static_cast for code_breakpoint
      Use gdb::checked_static_cast for catchpoints

 gdb/ada-lang.c             |   3 +-
 gdb/break-catch-sig.c      |   8 +-
 gdb/break-catch-syscall.c  |   4 +-
 gdb/breakpoint.c           | 337 +++++++++++++++++++++++----------------------
 gdb/elfread.c              |   2 +-
 gdb/guile/scm-breakpoint.c |   2 +-
 gdb/mi/mi-cmd-break.c      |  10 +-
 gdb/python/py-breakpoint.c |   2 +-
 gdb/remote.c               |  11 +-
 gdb/target-debug.h         |   2 +
 gdb/target-delegates.c     |  16 +--
 gdb/target.c               |   2 +-
 gdb/target.h               |   4 +-
 gdb/tracefile-tfile.c      |   4 +-
 gdb/tracepoint.c           |  28 ++--
 gdb/tracepoint.h           |   4 +-
 16 files changed, 232 insertions(+), 207 deletions(-)
---
base-commit: 0e0edacca5f34621f85e93a22ee31c6810b5941c
change-id: 20230915-watchpoint-casts-d43c55a7b13e

Best regards,
  

Comments

Simon Marchi Sept. 18, 2023, 12:45 a.m. UTC | #1
On 2023-09-15 14:36, Tom Tromey via Gdb-patches wrote:
> While reviewing a patch, I noticed some unchecked casts to watchpoint.
> This series replaces all the unchecked breakpoint casts I could find
> with checked casts.
> 
> Regression tested on x86-64 Fedora 36.

I sent a minor comment on patch 1.  Getting rid of the struct keyword
when possible might allow avoid line wrapping in a bunch of places.
But otherwise:

Approved-By: Simon Marchi <simon.marchi@efficios.com>

Simon