aboutsummaryrefslogtreecommitdiff
path: root/gdb/ax-general.c
diff options
context:
space:
mode:
authorStan Shebs <shebs@codesourcery.com>2009-12-28 23:39:10 +0000
committerStan Shebs <shebs@codesourcery.com>2009-12-28 23:39:10 +0000
commitf61e138d9a5c10da22c01ef377034e66e6978fe6 (patch)
tree399c49505e3d1aa2e3f71937bd6f1034cf5c6acc /gdb/ax-general.c
parentae77ee9a7fe8e4b4e05bd65b4f9f2b8ca63a129d (diff)
downloadgdb-f61e138d9a5c10da22c01ef377034e66e6978fe6.zip
gdb-f61e138d9a5c10da22c01ef377034e66e6978fe6.tar.gz
gdb-f61e138d9a5c10da22c01ef377034e66e6978fe6.tar.bz2
2009-12-28 Stan Shebs <stan@codesourcery.com>
Add trace state variables. * ax.h (enum agent_op): Add getv, setv, and tracev. (ax_tsv): Declare. * ax-gdb.c: Include tracepoint.h. (gen_expr): Handle BINOP_ASSIGN, BINOP_ASSIGN_MODIFY, and OP_INTERNALVAR. (gen_expr_binop_rest): New function, split from gen_expr. * ax-general.c (ax_tsv): New function. (aop_map): Add new bytecodes. * tracepoint.h (struct trace_state_variable): New struct. (tsv_s): New typedef. (find_trace_state_variable): Declare. * tracepoint.c (tvariables): New global. (next_tsv_number): New global. (create_trace_state_variable): New function. (find_trace_state_variable): New function. (delete_trace_state_variable): New function. (trace_variable_command): New function. (delete_trace_variable_command): New function. (tvariables_info): New function. (trace_start_command): Download tsvs with initial values. (_initialize_tracepoint): Add new commands. * NEWS: Mention the addition of trace state variables. ==> doc/ChangeLog <== 2009-12-28 Stan Shebs <stan@codesourcery.com> * gdb.texinfo (Trace State Variables): New section. (Tracepoint Packets): Describe trace state variable packets. * agentexpr.texi (Bytecode Descriptions): Describe trace state variable bytecodes. ==> testsuite/ChangeLog <== 2009-12-28 Stan Shebs <stan@codesourcery.com> * gdb.trace/tsv.exp: New file. * gdb.base/completion.exp: Update ambiguous info output.
Diffstat (limited to 'gdb/ax-general.c')
-rw-r--r--gdb/ax-general.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/gdb/ax-general.c b/gdb/ax-general.c
index 65b5ba1..606e049 100644
--- a/gdb/ax-general.c
+++ b/gdb/ax-general.c
@@ -272,6 +272,22 @@ ax_reg (struct agent_expr *x, int reg)
x->buf[x->len + 2] = (reg) & 0xff;
x->len += 3;
}
+
+/* Assemble code to operate on a trace state variable. */
+
+void
+ax_tsv (struct agent_expr *x, enum agent_op op, int num)
+{
+ /* Make sure the tsv number is in range. */
+ if (num < 0 || num > 0xffff)
+ internal_error (__FILE__, __LINE__, _("ax-general.c (ax_tsv): variable number is %d, out of range"), num);
+
+ grow_expr (x, 3);
+ x->buf[x->len] = op;
+ x->buf[x->len + 1] = (num >> 8) & 0xff;
+ x->buf[x->len + 2] = (num) & 0xff;
+ x->len += 3;
+}
@@ -324,9 +340,9 @@ struct aop_map aop_map[] =
{"pop", 0, 0, 1, 0}, /* 0x29 */
{"zero_ext", 1, 0, 1, 1}, /* 0x2a */
{"swap", 0, 0, 2, 2}, /* 0x2b */
- {0, 0, 0, 0, 0}, /* 0x2c */
- {0, 0, 0, 0, 0}, /* 0x2d */
- {0, 0, 0, 0, 0}, /* 0x2e */
+ {"getv", 2, 0, 0, 1}, /* 0x2c */
+ {"setv", 2, 0, 0, 1}, /* 0x2d */
+ {"tracev", 2, 0, 0, 1}, /* 0x2e */
{0, 0, 0, 0, 0}, /* 0x2f */
{"trace16", 2, 0, 1, 1}, /* 0x30 */
};