aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax.h
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/ax.h
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/ax.h')
-rw-r--r--gdb/ax.h15
1 files changed, 5 insertions, 10 deletions
diff --git a/gdb/ax.h b/gdb/ax.h
index 608af4c..b0eb20d 100644
--- a/gdb/ax.h
+++ b/gdb/ax.h
@@ -110,14 +110,10 @@ struct agent_expr
int max_data_size;
/* Bit vector of registers needed. Register R is needed iff
-
- reg_mask[R / 8] & (1 << (R % 8))
-
- is non-zero. Note! You may not assume that this bitmask is long
- enough to hold bits for all the registers of the machine; the
- agent expression code has no idea how many registers the machine
- has. However, the bitmask is reg_mask_len bytes long, so the
- valid register numbers run from 0 to reg_mask_len * 8 - 1.
+ reg_mask[R] is non-zero. Note! You may not assume that this
+ bitmask is long enough to hold bits for all the registers of
+ the machine; the agent expression code has no idea how many
+ registers the machine has.
Also note that this mask may contain registers that are needed
for the original collection expression to work, but that are
@@ -126,8 +122,7 @@ struct agent_expr
compiler sets the mask bit and skips generating a bytecode whose
result is going to be discarded anyway.
*/
- int reg_mask_len;
- unsigned char *reg_mask;
+ std::vector<bool> reg_mask;
/* For the data tracing facility, we need to insert `trace' bytecodes
before each data fetch; this records all the memory that the