Fix argument to compiled_cond, and add cases for compiled-condition.

This patch fixes the argument passed to compiled_cond.  It should be
regs buffer instead of tracepoint_hit_ctx.  Test case is added as
well for testing compiled-cond.

gdb/gdbserver/ChangeLog

2015-09-16  Wei-cheng Wang  <cole945@gmail.com>

	* tracepoint.c (eval_result_type): Change prototype.
	(condition_true_at_tracepoint): Fix argument to compiled_cond.

gdb/testsuite/ChangeLog

2015-09-16  Wei-cheng Wang  <cole945@gmail.com>

	* gdb.trace/ftrace.exp: (test_ftrace_condition) New function
	for testing bytecode compilation.
This commit is contained in:
Wei-cheng Wang
2015-09-16 16:20:51 +01:00
committed by Yao Qi
parent 1ed415e2b9
commit d78908cff5
4 changed files with 79 additions and 2 deletions

View File

@@ -695,7 +695,7 @@ enum tracepoint_type
struct tracepoint_hit_ctx;
typedef enum eval_result_type (*condfn) (struct tracepoint_hit_ctx *,
typedef enum eval_result_type (*condfn) (unsigned char *,
ULONGEST *);
/* The definition of a tracepoint. */
@@ -4907,7 +4907,10 @@ condition_true_at_tracepoint (struct tracepoint_hit_ctx *ctx,
used. */
#ifdef IN_PROCESS_AGENT
if (tpoint->compiled_cond)
err = ((condfn) (uintptr_t) (tpoint->compiled_cond)) (ctx, &value);
{
struct fast_tracepoint_ctx *fctx = (struct fast_tracepoint_ctx *) ctx;
err = ((condfn) (uintptr_t) (tpoint->compiled_cond)) (fctx->regs, &value);
}
else
#endif
{