2012-02-24 Luis Machado <lgustavo@codesourcery>

* server.h: Include tracepoint.h.
	(agent_mem_read, agent_get_trace_state_variable_value,
	agent_set_trace_state_variable_value,
	agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
	get_set_tsv_func_addr): New prototypes.

	* ax.h: New include file.
	* ax.c: New source file.

	* tracepoint.c: Include ax.h.
	(gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
	agent_expr, eval_result_type): Move to ax.h.
	(parse_agent_expr): Rename to ...
	(gdb_parse_agent_expr): ... this, make it non-static and move
	to ax.h.
	(unparse_agent_expr) Rename to ...
	(gdb_unparse_agent_expr): ... this, make it non-static and move
	to ax.h.
	(eval_agent_expr): Rename to ...
	(eval_tracepoint_agent_expr): ... this.
	(agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
	forward declarations.
	(add_tracepoint_action): Call gdb_parse_agent_expr (...).
	(agent_get_trace_state_variable_value): New function.
	(agent_set_trace_state_variable_value): New function.
	(cmd_qtdp): Call gdb_parse_agent_expr (...).
	(response_tracepoint): Call gdb_unparse_agent_expr (...).
	(do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
	(condition_true_at_tracepoint): Likewise.
	(parse_agent_expr): Rename to ...
	(gdb_parse_agent_expr): ... this and move to ax.c.
	(unparse_agent_expr): Rename to ...
	(gdb_unparse_agent_expr): ... this and move to ax.c.
	(gdb_agent_op_name): Move to ax.c.
	(eval_agent_expr): Rename to ...
	(gdb_eval_agent_expr): ... this, use regcache passed as parameter
	and move to ax.c.
	(eval_tracepoint_agent_expr): New function.
	(agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
	non-static.
	(current_insn_ptr, emit_error, struct bytecode_address): Move to
	ax.c.
	(emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
	emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
	emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
	emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
	emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
	emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
	emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
	emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
	(get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
	(compile_bytecodes): Remove forward declaration.
	(is_goto_target): Move to ax.c.
	(compile_bytecodes): Move to ax.c and call
	agent_get_trace_state_variable_value (...) and
	agent_set_trace_state_variable_value (...).

	* Makefile.in: Update ax.c and IPA dependencies.
This commit is contained in:
Luis Machado 2012-02-24 15:13:37 +00:00
parent b775012e84
commit 5e1dc49674
4 changed files with 145 additions and 1199 deletions

View File

@ -1,3 +1,64 @@
2012-02-24 Luis Machado <lgustavo@codesourcery>
* server.h: Include tracepoint.h.
(agent_mem_read, agent_get_trace_state_variable_value,
agent_set_trace_state_variable_value,
agent_tsv_read, agent_mem_read_string, get_get_tsv_func_addr,
get_set_tsv_func_addr): New prototypes.
* ax.h: New include file.
* ax.c: New source file.
* tracepoint.c: Include ax.h.
(gdb_agent_op, gdb_agent_op_names, gdb_agent_op_sizes,
agent_expr, eval_result_type): Move to ax.h.
(parse_agent_expr): Rename to ...
(gdb_parse_agent_expr): ... this, make it non-static and move
to ax.h.
(unparse_agent_expr) Rename to ...
(gdb_unparse_agent_expr): ... this, make it non-static and move
to ax.h.
(eval_agent_expr): Rename to ...
(eval_tracepoint_agent_expr): ... this.
(agent_mem_read, agent_mem_read_string, agent_tsv_read): Remove
forward declarations.
(add_tracepoint_action): Call gdb_parse_agent_expr (...).
(agent_get_trace_state_variable_value): New function.
(agent_set_trace_state_variable_value): New function.
(cmd_qtdp): Call gdb_parse_agent_expr (...).
(response_tracepoint): Call gdb_unparse_agent_expr (...).
(do_action_at_tracepoint): Call eval_tracepoint_agent_expr (...).
(condition_true_at_tracepoint): Likewise.
(parse_agent_expr): Rename to ...
(gdb_parse_agent_expr): ... this and move to ax.c.
(unparse_agent_expr): Rename to ...
(gdb_unparse_agent_expr): ... this and move to ax.c.
(gdb_agent_op_name): Move to ax.c.
(eval_agent_expr): Rename to ...
(gdb_eval_agent_expr): ... this, use regcache passed as parameter
and move to ax.c.
(eval_tracepoint_agent_expr): New function.
(agent_mem_read, agent_mem_read_string, agent_tsv_read): Make
non-static.
(current_insn_ptr, emit_error, struct bytecode_address): Move to
ax.c.
(emit_prologue, emit_epilogue, emit_add, emit_sub, emit_mul, emit_lsh,
emit_rsh_signed, emit_rsh_unsigned, emit_ext, emit_log_not,
emit_bit_and, emit_bit_or, emit_bit_xor, emit_bit_not, emit_equal,
emit_less_signed, emit_less_unsigned, emit_ref, emit_if_goto,
emit_goto, write_goto_address, emit_const, emit_reg, emit_pop,
emit_stack, emit_zero_ext, emit_swap, emit_stack_adjust,
emit_int_call_1, emit_void_call_2, emit_eq_goto, emit_ne_goto,
emit_lt_goto, emit_ge_goto, emit_gt_goto, emit_le_goto): Move to ax.c.
(get_get_tsv_func_addr, get_set_tsv_func_addr): New functions.
(compile_bytecodes): Remove forward declaration.
(is_goto_target): Move to ax.c.
(compile_bytecodes): Move to ax.c and call
agent_get_trace_state_variable_value (...) and
agent_set_trace_state_variable_value (...).
* Makefile.in: Update ax.c and IPA dependencies.
2012-02-24 Pedro Alves <palves@redhat.com>
* tracepoint.c (cmd_bigqtbuffer): Rename as ...

View File

@ -134,7 +134,7 @@ LIBOBJS = @LIBOBJS@
SOURCES = $(SFILES)
TAGFILES = $(SOURCES) ${HFILES} ${ALLPARAM} ${POSSLIBS}
OBS = inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
OBS = ax.o inferiors.o regcache.o remote-utils.o server.o signals.o target.o \
utils.o version.o \
mem-break.o hostio.o event-loop.o tracepoint.o \
xml-utils.o common-utils.o ptid.o buffer.o \
@ -237,7 +237,7 @@ gdbreplay$(EXEEXT): $(GDBREPLAY_OBS)
${CC-LD} $(INTERNAL_CFLAGS) $(INTERNAL_LDFLAGS) -o gdbreplay$(EXEEXT) $(GDBREPLAY_OBS) \
$(XM_CLIBS)
IPA_OBJS=tracepoint-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o ${IPA_DEPFILES}
IPA_OBJS=ax-ipa.o tracepoint-ipa.o utils-ipa.o regcache-ipa.o remote-utils-ipa.o common-utils-ipa.o ${IPA_DEPFILES}
IPA_LIB=libinproctrace.so
@ -336,6 +336,7 @@ regcache_h = $(srcdir)/regcache.h
signals_def = $(srcdir)/../../include/gdb/signals.def
signals_h = $(srcdir)/../../include/gdb/signals.h $(signals_def)
ptid_h = $(srcdir)/../common/ptid.h
ax_h = $(srcdir)/ax.h
linux_osdata_h = $(srcdir)/../common/linux-osdata.h
server_h = $(srcdir)/server.h $(regcache_h) config.h $(srcdir)/target.h \
$(srcdir)/mem-break.h $(srcdir)/../common/gdb_signals.h \
@ -368,7 +369,9 @@ IPAGENT_CFLAGS = $(CPPFLAGS) $(INTERNAL_CFLAGS) $(UST_CFLAGS) \
-fvisibility=hidden
# In-process agent object rules
tracepoint-ipa.o: tracepoint.c $(server_h) $(srcdir)/../common/ax.def
ax-ipa.o: ax.c $(server_h) $(ax_h) $(srcdir)/../common/ax.def
$(CC) -c $(IPAGENT_CFLAGS) $< -o ax-ipa.o
tracepoint-ipa.o: tracepoint.c $(server_h) ${ax_h}
$(CC) -c $(IPAGENT_CFLAGS) $< -o tracepoint-ipa.o
utils-ipa.o: utils.c $(server_h)
$(CC) -c $(IPAGENT_CFLAGS) $< -o utils-ipa.o
@ -387,11 +390,12 @@ linux-amd64-ipa.o: linux-amd64-ipa.c $(server_h)
amd64-linux-ipa.o : amd64-linux.c $(regdef_h)
$(CC) -c $(IPAGENT_CFLAGS) $< -o amd64-linux-ipa.o
ax.o: ax.c $(server_h) $(ax_h) $(srcdir)/../common/ax.def
event-loop.o: event-loop.c $(server_h)
hostio.o: hostio.c $(server_h)
hostio-errno.o: hostio-errno.c $(server_h)
inferiors.o: inferiors.c $(server_h)
mem-break.o: mem-break.c $(server_h)
mem-break.o: mem-break.c $(server_h) $(ax_h)
proc-service.o: proc-service.c $(server_h) $(gdb_proc_service_h)
regcache.o: regcache.c $(server_h) $(regdef_h)
remote-utils.o: remote-utils.c terminal.h $(server_h)
@ -399,7 +403,7 @@ server.o: server.c $(server_h)
target.o: target.c $(server_h)
thread-db.o: thread-db.c $(server_h) $(linux_low_h) $(gdb_proc_service_h) \
$(gdb_thread_db_h)
tracepoint.o: tracepoint.c $(server_h) $(srcdir)/../common/ax.def
tracepoint.o: tracepoint.c $(server_h) $(ax_h)
utils.o: utils.c $(server_h)
gdbreplay.o: gdbreplay.c config.h
dll.o: dll.c $(server_h)

View File

@ -102,6 +102,12 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap);
#define _(String) (String)
#endif
#ifdef IN_PROCESS_AGENT
# define PROG "ipa"
#else
# define PROG "gdbserver"
#endif
/* A type used for binary buffers. */
typedef unsigned char gdb_byte;
@ -511,6 +517,26 @@ int claim_trampoline_space (ULONGEST used, CORE_ADDR *trampoline);
int have_fast_tracepoint_trampoline_buffer (char *msgbuf);
#endif
struct traceframe;
/* Do memory copies for bytecodes. */
/* Do the recording of memory blocks for actions and bytecodes. */
int agent_mem_read (struct traceframe *tframe,
unsigned char *to, CORE_ADDR from,
ULONGEST len);
LONGEST agent_get_trace_state_variable_value (int num);
void agent_set_trace_state_variable_value (int num, LONGEST val);
/* Record the value of a trace state variable. */
int agent_tsv_read (struct traceframe *tframe, int n);
int agent_mem_read_string (struct traceframe *tframe,
unsigned char *to,
CORE_ADDR from,
ULONGEST len);
/* Bytecode compilation function vector. */
struct emit_ops
@ -566,6 +592,12 @@ struct emit_ops
/* Returns the address of the get_raw_reg function in the IPA. */
CORE_ADDR get_raw_reg_func_addr (void);
/* Returns the address of the get_trace_state_variable_value
function in the IPA. */
CORE_ADDR get_get_tsv_func_addr (void);
/* Returns the address of the set_trace_state_variable_value
function in the IPA. */
CORE_ADDR get_set_tsv_func_addr (void);
CORE_ADDR current_insn_ptr;
int emit_error;

File diff suppressed because it is too large Load Diff