Pass tracepoint to 'add_traceframe_block'.

Hi,
After this patch, the tracepoint object is passed to
'add_traceframe_block' so that the 'traceframe_usage' of this
tracepoint can be updated correctly.  A test to check the
output of 'info tracepoint' for traceframe_usage per tracepoint is
added.  We'll get fail if only the test patch is applied.  The rest of
the patch fixes the fails.

FAIL: gdb.trace/infotrace.exp: 2.6: info tracepoints (trace buffer usage)
FAIL: gdb.trace/disconnected-tracing.exp: trace: fourth info tracepoints

The tracepoint object is passed through the agent expression
evaluation.  In order to reduce the number of arguments passed to
agent expression evaluation, a new struct 'eval_agent_expr_context' is
created, wrapping regcache, traceframe and tracepoint.

Regression tested on x86_64-linux with native and gdbserver.  Is it
OK?

Note that after this patch, GDB will get the correct value of
hit_count and traceframe_usage by means of command 'tstatus', so
tracepoint 'hit count' should appear in the output of 'info
tracepoints'.  gdb.trace/tstatus.exp is updated in this patch to check
'hit count' and 'traceframe usage' unconditionally.

gdb/gdbserver:

2012-12-20  Yao Qi  <yao@codesourcery.com>

	* 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:

2012-12-20  Yao Qi  <yao@codesourcery.com>

	* gdb.trace/infotrace.exp: Check 'traceframe usage' in the
	output of 'info tracepoints'.
	* gdb.trace/disconnected-tracing.exp (disconnected_tracing):
	Likewise.
	* gdb.trace/disconnected-tracing.c (struct foo): New.
	* gdb.trace/tstatus.exp (run_trace_experiment): Likewise..
Cleanup pending notifications when inferior stops.

This patch pushes the handling to notifications a little bit earlier,
from to resume inferior to inferior just stopped.

gdb:

2012-12-24  Yao Qi  <yao@codesourcery.com>

	* remote-notif.c (remote_async_get_pending_events_handler):
	Don't assert on 'non_stop' is true.
	(remote_notif_mark_async_event_token): New.
	* remote-notif.h (remote_notif_mark_async_event_token):
	Declare.
	* remote.c (remote_resume): Don't call remote_notif_process.
	(remote_wait_as): Call remote_notif_process here instead.
new async remote notification "Point".

Hi,
This patch adds a new async remote notification "Point" about
creation, deletion, and modification of breakpoint and tracepoint in
the remote stub.  When the 'hit_count' or 'traceframe_usage' is
updated, the remote stub will send notification "%Point:modified:XXX"
to GDB, about which tracepoint is modified.

gdb:

2012-12-24  Yao Qi  <yao@codesourcery.com>

	* Makefile.in (REMOTE_OBS): Append remote-notif-point.o.
	(SFILES): Append remote-notif-point.c.
	* remote-notif.c (notifs): Add element 'notif_client_point'.
	* remote-notif-point.c: New.
	* tracepoint.c (find_matching_tracepoint_location): Remove
	'static'.
	* tracepoint.h (find_matching_tracepoint_location): Declare.

gdb/gdbserver:

2012-12-24  Yao Qi  <yao@codesourcery.com>

	* notif.c (notifs): Add element 'notif_point'.
	* notif.h (notif_point): Declare.
	* tracepoint.c (enum notif_point_event_type): New.
	(struct notif_point_event): New.
	(notif_point_write): New.
	(notif_point): New.
	(tracepoint_changed): New.
	(add_traceframe_block): Call tracepoint_changed.
	(collect_data_at_tracepoint): Likewise.
point created notification.

When GDB gets notification %Point:created:, and starts to ack it, GDB
can start the sequence of rsp packets to get autoload breakpoints.

gdb/gdbserver:

2012-12-24  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (enum notif_point_event_type): New POINT_CREATED.
	(notif_point_write): Handle POINT_CREATED.
gdb:

2012-12-24  Yao Qi  <yao@codesourcery.com>

	* remote-notif-point.c (enum NOTIF_POINT_TYPE): New POINT_CREATED.
	(remote_notif_point_parse): Handle notificaiton on point created.
	(remote_notif_point_ack): Handle POINT_CREATED.
Don't queue events until it is replied.

This patch is used to avoid "duplicated" events in gdbserver side.

gdb/gdbserver:

2012-12-18  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (struct tracepoint):
	(add_tracepoint):
	(notif_point_write):
	(struct notif_server notif_point =):
emit point notification on trace stopped.

gdb/gdbserver:

2012-12-24  Yao Qi  <yao@codesourcery.com>

	* tracepoint.c (stop_tracing): Call notif_push.