gdb/gdbserver:

2011-11-05  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (gdb_collect): Loop over tracepoints of same
	address as TPOINT's.

gdb/testsuite:

2011-11-05  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/trace-break.exp: Add test on setting two
	fast tracepoints at the same address.
This commit is contained in:
Yao Qi
2011-11-05 13:16:23 +00:00
parent 23714b1114
commit a59306a3db
4 changed files with 52 additions and 27 deletions

View File

@ -1,3 +1,8 @@
2011-11-05 Yao Qi <yao@codesourcery.com>
* tracepoint.c (gdb_collect): Loop over tracepoints of same
address as TPOINT's.
2011-11-02 Stan Shebs <stan@codesourcery.com> 2011-11-02 Stan Shebs <stan@codesourcery.com>
* tracepoint.c (agent_mem_read_string): New function. * tracepoint.c (agent_mem_read_string): New function.

View File

@ -5480,14 +5480,9 @@ gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
if (!tracing) if (!tracing)
return; return;
if (!tpoint->enabled)
return;
ctx.base.type = fast_tracepoint; ctx.base.type = fast_tracepoint;
ctx.regs = regs; ctx.regs = regs;
ctx.regcache_initted = 0; ctx.regcache_initted = 0;
ctx.tpoint = tpoint;
/* Wrap the regblock in a register cache (in the stack, we don't /* Wrap the regblock in a register cache (in the stack, we don't
want to malloc here). */ want to malloc here). */
ctx.regspace = alloca (register_cache_size ()); ctx.regspace = alloca (register_cache_size ());
@ -5497,13 +5492,25 @@ gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
return; return;
} }
for (ctx.tpoint = tpoint;
ctx.tpoint != NULL && ctx.tpoint->address == tpoint->address;
ctx.tpoint = ctx.tpoint->next)
{
if (!ctx.tpoint->enabled)
continue;
/* Multiple tracepoints of different types, such as fast tracepoint and
static tracepoint, can be set at the same address. */
if (ctx.tpoint->type != tpoint->type)
continue;
/* Test the condition if present, and collect if true. */ /* Test the condition if present, and collect if true. */
if (tpoint->cond == NULL if (ctx.tpoint->cond == NULL
|| condition_true_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, || condition_true_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx,
tpoint)) ctx.tpoint))
{ {
collect_data_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx, collect_data_at_tracepoint ((struct tracepoint_hit_ctx *) &ctx,
tpoint->address, tpoint); ctx.tpoint->address, ctx.tpoint);
/* Note that this will cause original insns to be written back /* Note that this will cause original insns to be written back
to where we jumped from, but that's OK because we're jumping to where we jumped from, but that's OK because we're jumping
@ -5512,7 +5519,10 @@ gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
if (stopping_tracepoint if (stopping_tracepoint
|| trace_buffer_is_full || trace_buffer_is_full
|| expr_eval_result != expr_eval_no_error) || expr_eval_result != expr_eval_no_error)
{
stop_tracing (); stop_tracing ();
break;
}
} }
else else
{ {
@ -5520,7 +5530,11 @@ gdb_collect (struct tracepoint *tpoint, unsigned char *regs)
way we would stop tracing is if there was an error during way we would stop tracing is if there was an error during
condition expression evaluation. */ condition expression evaluation. */
if (expr_eval_result != expr_eval_no_error) if (expr_eval_result != expr_eval_no_error)
{
stop_tracing (); stop_tracing ();
break;
}
}
} }
} }

View File

@ -1,3 +1,8 @@
2011-11-05 Yao Qi <yao@codesourcery.com>
* gdb.trace/trace-break.exp: Add test on setting two
fast tracepoints at the same address.
2011-11-03 Jan Kratochvil <jan.kratochvil@redhat.com> 2011-11-03 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.base/commands.exp (cmd1 error): Fix false ERROR with gdbserver. * gdb.base/commands.exp (cmd1 error): Fix false ERROR with gdbserver.

View File

@ -234,6 +234,7 @@ if { [gdb_test "info sharedlibrary" ".*libinproctrace\.so.*" "IPA loaded"] != 0
break_trace_same_addr_1 "ftrace" ${break_always_inserted} break_trace_same_addr_1 "ftrace" ${break_always_inserted}
break_trace_same_addr_2 "trace" "ftrace" ${break_always_inserted} break_trace_same_addr_2 "trace" "ftrace" ${break_always_inserted}
break_trace_same_addr_2 "ftrace" "trace" ${break_always_inserted} break_trace_same_addr_2 "ftrace" "trace" ${break_always_inserted}
break_trace_same_addr_2 "ftrace" "ftrace" ${break_always_inserted}
break_trace_same_addr_3 "ftrace" ${break_always_inserted} break_trace_same_addr_3 "ftrace" ${break_always_inserted}
break_trace_same_addr_4 "ftrace" ${break_always_inserted} break_trace_same_addr_4 "ftrace" ${break_always_inserted}
} }