diff options
author | Tom Tromey <tromey@adacore.com> | 2023-09-15 12:05:57 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2023-09-19 08:14:00 -0600 |
commit | 01bccc56af0f590c5ff64c24dea17fa3098572d7 (patch) | |
tree | 074de314632fb602e0055b1173a2756c90a1d617 /gdb/remote.c | |
parent | bcafd1c19e628d831cf3eb20229c42ad9db4b29c (diff) | |
download | fsf-binutils-gdb-01bccc56af0f590c5ff64c24dea17fa3098572d7.zip fsf-binutils-gdb-01bccc56af0f590c5ff64c24dea17fa3098572d7.tar.gz fsf-binutils-gdb-01bccc56af0f590c5ff64c24dea17fa3098572d7.tar.bz2 |
Use gdb::checked_static_cast for tracepoints
This replaces some casts to 'tracepoint *' with checked_static_cast.
Some functions are changed to accept a 'tracepoint *' now, for better
type safety.
Approved-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/remote.c')
-rw-r--r-- | gdb/remote.c | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/gdb/remote.c b/gdb/remote.c index ba81c5b..9bb4f1d 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -911,7 +911,7 @@ public: int get_trace_status (struct trace_status *ts) override; - void get_tracepoint_status (struct breakpoint *tp, struct uploaded_tp *utp) + void get_tracepoint_status (tracepoint *tp, struct uploaded_tp *utp) override; void trace_stop () override; @@ -13256,7 +13256,7 @@ remote_target::download_tracepoint (struct bp_location *loc) std::vector<std::string> stepping_actions; char *pkt; struct breakpoint *b = loc->owner; - struct tracepoint *t = (struct tracepoint *) b; + tracepoint *t = gdb::checked_static_cast<tracepoint *> (b); struct remote_state *rs = get_remote_state (); int ret; const char *err_msg = _("Tracepoint packet too large for target."); @@ -13675,12 +13675,11 @@ remote_target::get_trace_status (struct trace_status *ts) } void -remote_target::get_tracepoint_status (struct breakpoint *bp, +remote_target::get_tracepoint_status (tracepoint *tp, struct uploaded_tp *utp) { struct remote_state *rs = get_remote_state (); char *reply; - struct tracepoint *tp = (struct tracepoint *) bp; size_t size = get_remote_packet_size (); if (tp) @@ -13700,7 +13699,7 @@ remote_target::get_tracepoint_status (struct breakpoint *bp, if (reply && *reply) { if (*reply == 'V') - parse_tracepoint_status (reply + 1, bp, utp); + parse_tracepoint_status (reply + 1, tp, utp); } } } @@ -13715,7 +13714,7 @@ remote_target::get_tracepoint_status (struct breakpoint *bp, if (reply && *reply) { if (*reply == 'V') - parse_tracepoint_status (reply + 1, bp, utp); + parse_tracepoint_status (reply + 1, tp, utp); } } } |