aboutsummaryrefslogtreecommitdiff
path: root/gdb/tracepoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-06-17 12:52:11 -0600
committerTom Tromey <tom@tromey.com>2023-06-20 11:21:51 -0600
commita2bbca9fa5e4e488ccbb8dddfa1d78ed03bad083 (patch)
treec12c8156574115bef418da92a387529ef0edf206 /gdb/tracepoint.c
parent6f96f4854f1dcfa15c1ba87f76d868513bb14276 (diff)
downloadgdb-a2bbca9fa5e4e488ccbb8dddfa1d78ed03bad083.zip
gdb-a2bbca9fa5e4e488ccbb8dddfa1d78ed03bad083.tar.gz
gdb-a2bbca9fa5e4e488ccbb8dddfa1d78ed03bad083.tar.bz2
Use std::vector<bool> for agent_expr::reg_mask
agent_expr::reg_mask implements its own packed boolean vector. This patch replaces it with a std::vector<bool>, simplifying the code. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r--gdb/tracepoint.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c
index 335df99..2053804 100644
--- a/gdb/tracepoint.c
+++ b/gdb/tracepoint.c
@@ -835,19 +835,13 @@ collection_list::add_remote_register (unsigned int regno)
void
collection_list::add_ax_registers (struct agent_expr *aexpr)
{
- if (aexpr->reg_mask_len > 0)
+ for (int ndx1 = 0; ndx1 < aexpr->reg_mask.size (); ndx1++)
{
- for (int ndx1 = 0; ndx1 < aexpr->reg_mask_len; ndx1++)
+ QUIT; /* Allow user to bail out with ^C. */
+ if (aexpr->reg_mask[ndx1])
{
- QUIT; /* Allow user to bail out with ^C. */
- if (aexpr->reg_mask[ndx1] != 0)
- {
- /* Assume chars have 8 bits. */
- for (int ndx2 = 0; ndx2 < 8; ndx2++)
- if (aexpr->reg_mask[ndx1] & (1 << ndx2))
- /* It's used -- record it. */
- add_remote_register (ndx1 * 8 + ndx2);
- }
+ /* It's used -- record it. */
+ add_remote_register (ndx1);
}
}
}