aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/mem-break.c
diff options
context:
space:
mode:
authorYao Qi <yao@codesourcery.com>2013-01-18 06:40:58 +0000
committerYao Qi <yao@codesourcery.com>2013-01-18 06:40:58 +0000
commit5ae4861a11c9487e991607689ebabc2e0008a670 (patch)
treebf5e32a7baa077facd26ccb53b5f59f6996b65af /gdb/gdbserver/mem-break.c
parent257e7a09728bb1b846ff4e1a7587832b050d38b9 (diff)
downloadgdb-5ae4861a11c9487e991607689ebabc2e0008a670.zip
gdb-5ae4861a11c9487e991607689ebabc2e0008a670.tar.gz
gdb-5ae4861a11c9487e991607689ebabc2e0008a670.tar.bz2
gdb/gdbserver:
* ax.h (struct eval_agent_expr_context): New. (gdb_eval_agent_expr): Update declaration. * ax.c (gdb_eval_agent_expr): Remove argument REGCACHE and TFRAME. Add new argument CTX. * server.h (struct eval_agent_expr_context): Declare. (agent_mem_read, agent_tsv_read): Update declaration. (agent_mem_read_string): Likewise. * tracepoint.c (eval_tracepoint_agent_expr): Remove. (add_traceframe_block): Add new argument TPOINT. Increase TPOINT->traceframe_usage. (do_action_at_tracepoint): Call gdb_eval_agent_expr instead of eval_tracepoint_agent_expr. (condition_true_at_tracepoint): Likewise. (agent_mem_read): Remove argument TFRAME. Add argument CTX. (agent_mem_read_string, agent_tsv_read): Likewise. Callers update. gdb/testsuite: * gdb.trace/infotrace.exp: Check 'traceframe usage' in the output of 'info tracepoints'. * gdb.trace/disconnected-tracing.exp (disconnected_tracing): Likewise. * gdb.trace/tstatus.exp (run_trace_experiment): Likewise. * gdb.trace/disconnected-tracing.c (struct foo): New.
Diffstat (limited to 'gdb/gdbserver/mem-break.c')
-rw-r--r--gdb/gdbserver/mem-break.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/gdb/gdbserver/mem-break.c b/gdb/gdbserver/mem-break.c
index 6886ab8..aca7740 100644
--- a/gdb/gdbserver/mem-break.c
+++ b/gdb/gdbserver/mem-break.c
@@ -840,8 +840,7 @@ gdb_condition_true_at_breakpoint (CORE_ADDR where)
ULONGEST value = 0;
struct point_cond_list *cl;
int err = 0;
-
- struct regcache *regcache = get_thread_regcache (current_inferior, 1);
+ struct eval_agent_expr_context ctx;
if (bp == NULL)
return 0;
@@ -851,6 +850,10 @@ gdb_condition_true_at_breakpoint (CORE_ADDR where)
if (bp->cond_list == NULL)
return 1;
+ ctx.regcache = get_thread_regcache (current_inferior, 1);
+ ctx.tframe = NULL;
+ ctx.tpoint = NULL;
+
/* Evaluate each condition in the breakpoint's list of conditions.
Return true if any of the conditions evaluates to TRUE.
@@ -860,7 +863,7 @@ gdb_condition_true_at_breakpoint (CORE_ADDR where)
cl && !value && !err; cl = cl->next)
{
/* Evaluate the condition. */
- err = gdb_eval_agent_expr (regcache, NULL, cl->cond, &value);
+ err = gdb_eval_agent_expr (&ctx, cl->cond, &value);
}
if (err)
@@ -943,17 +946,20 @@ run_breakpoint_commands (CORE_ADDR where)
ULONGEST value = 0;
struct point_command_list *cl;
int err = 0;
-
- struct regcache *regcache = get_thread_regcache (current_inferior, 1);
+ struct eval_agent_expr_context ctx;
if (bp == NULL)
return;
+ ctx.regcache = get_thread_regcache (current_inferior, 1);
+ ctx.tframe = NULL;
+ ctx.tpoint = NULL;
+
for (cl = bp->command_list;
cl && !value && !err; cl = cl->next)
{
/* Run the command. */
- err = gdb_eval_agent_expr (regcache, NULL, cl->cmd, &value);
+ err = gdb_eval_agent_expr (&ctx, cl->cmd, &value);
/* If one command has a problem, stop digging the hole deeper. */
if (err)