aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-06-17 12:56:54 -0600
committerTom Tromey <tom@tromey.com>2023-06-20 11:21:51 -0600
commitda25448d52654475792c8d05485d97205ba938ab (patch)
treeaecbb3137e104018eb96376b68942982af4bbd0a
parentb0b5ba6b7f2ac377842fe39a8d684282b865db40 (diff)
downloadgdb-da25448d52654475792c8d05485d97205ba938ab.zip
gdb-da25448d52654475792c8d05485d97205ba938ab.tar.gz
gdb-da25448d52654475792c8d05485d97205ba938ab.tar.bz2
Use bool for agent_expr::tracing
This changese agent_expr::tracing to have type bool, allowing inline initialization and cleaning up the code a little. Reviewed-by: John Baldwin <jhb@FreeBSD.org>
-rw-r--r--gdb/ax-gdb.c10
-rw-r--r--gdb/ax.h7
2 files changed, 8 insertions, 9 deletions
diff --git a/gdb/ax-gdb.c b/gdb/ax-gdb.c
index b0bde62..55450bd 100644
--- a/gdb/ax-gdb.c
+++ b/gdb/ax-gdb.c
@@ -2335,7 +2335,7 @@ gen_trace_for_var (CORE_ADDR scope, struct gdbarch *gdbarch,
agent_expr_up ax (new agent_expr (gdbarch, scope));
struct axs_value value;
- ax->tracing = 1;
+ ax->tracing = true;
ax->trace_string = trace_string;
gen_var_ref (ax.get (), &value, var);
@@ -2368,7 +2368,7 @@ gen_trace_for_expr (CORE_ADDR scope, struct expression *expr,
agent_expr_up ax (new agent_expr (expr->gdbarch, scope));
struct axs_value value;
- ax->tracing = 1;
+ ax->tracing = true;
ax->trace_string = trace_string;
value.optimized_out = 0;
expr->op->generate_ax (expr, ax.get (), &value);
@@ -2395,7 +2395,7 @@ gen_eval_for_expr (CORE_ADDR scope, struct expression *expr)
agent_expr_up ax (new agent_expr (expr->gdbarch, scope));
struct axs_value value;
- ax->tracing = 0;
+ ax->tracing = false;
value.optimized_out = 0;
expr->op->generate_ax (expr, ax.get (), &value);
@@ -2414,7 +2414,7 @@ gen_trace_for_return_address (CORE_ADDR scope, struct gdbarch *gdbarch,
agent_expr_up ax (new agent_expr (gdbarch, scope));
struct axs_value value;
- ax->tracing = 1;
+ ax->tracing = true;
ax->trace_string = trace_string;
gdbarch_gen_return_address (gdbarch, ax.get (), &value, scope);
@@ -2443,7 +2443,7 @@ gen_printf (CORE_ADDR scope, struct gdbarch *gdbarch,
int tem;
/* We're computing values, not doing side effects. */
- ax->tracing = 0;
+ ax->tracing = false;
/* Evaluate and push the args on the stack in reverse order,
for simplicity of collecting them on the target side. */
diff --git a/gdb/ax.h b/gdb/ax.h
index 67ad314..0e82ed9 100644
--- a/gdb/ax.h
+++ b/gdb/ax.h
@@ -83,8 +83,7 @@ struct agent_expr
/* Construct an empty agent expression. */
agent_expr (struct gdbarch *gdbarch, CORE_ADDR scope)
: gdbarch (gdbarch),
- scope (scope),
- tracing (0)
+ scope (scope)
{ }
/* The bytes of the expression. */
@@ -132,10 +131,10 @@ struct agent_expr
be available when the user later tries to evaluate the expression
in GDB.
- Setting the flag 'tracing' to non-zero enables the code that
+ Setting the flag 'tracing' to true enables the code that
emits the trace bytecodes at the appropriate points. */
- unsigned int tracing : 1;
+ bool tracing = false;
/* This indicates that pointers to chars should get an added
tracenz bytecode to record nonzero bytes, up to a length that