/* To make sense of this file, you should read doc/agentexpr.texi.
Then look at the types and enums in ax-gdb.h. For the code itself,
/* To make sense of this file, you should read doc/agentexpr.texi.
Then look at the types and enums in ax-gdb.h. For the code itself,
struct axs_value *value,
struct axs_value *value1,
struct axs_value *value2);
struct axs_value *value,
struct axs_value *value1,
struct axs_value *value2);
/* Push the address of the variable. */
ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
/* Push the address of the variable. */
ax_const_l (ax, BMSYMBOL_VALUE_ADDRESS (msym));
gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
const struct type *curtype, char *name)
{
gen_maybe_namespace_elt (struct agent_expr *ax, struct axs_value *value,
const struct type *curtype, char *name)
{
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
}
else
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
}
else
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
gen_expr (exp, pc, ax, &value3);
gen_usual_unary (ax, &value3);
ax_label (ax, end, ax->len);
gen_expr (exp, pc, ax, &value3);
gen_usual_unary (ax, &value3);
ax_label (ax, end, ax->len);
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
if (TYPE_CODE (value->type) == TYPE_CODE_ERROR)
gen_msym_var_ref (ax, value, (*pc)[2].msymbol, (*pc)[1].objfile);
if (TYPE_CODE (value->type) == TYPE_CODE_ERROR)
internal_error (__FILE__, __LINE__,
_("Register $%s not available"), name);
/* No support for tracing user registers yet. */
internal_error (__FILE__, __LINE__,
_("Register $%s not available"), name);
/* No support for tracing user registers yet. */
error (_("'%s' is a user-register; "
"GDB cannot yet trace user-register contents."),
name);
error (_("'%s' is a user-register; "
"GDB cannot yet trace user-register contents."),
name);
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
if (value->optimized_out)
error (_("`%s' has been optimized out, cannot use"),
gen_printf (CORE_ADDR scope, struct gdbarch *gdbarch,
CORE_ADDR function, LONGEST channel,
const char *format, int fmtlen,
gen_printf (CORE_ADDR scope, struct gdbarch *gdbarch,
CORE_ADDR function, LONGEST channel,
const char *format, int fmtlen,
int nargs, struct expression **exprs)
{
agent_expr_up ax (new agent_expr (gdbarch, scope));
int nargs, struct expression **exprs)
{
agent_expr_up ax (new agent_expr (gdbarch, scope));
{
/* We don't deal with overlay debugging at the moment. We need to
think more carefully about this. If you copy this code into
{
/* We don't deal with overlay debugging at the moment. We need to
think more carefully about this. If you copy this code into
- exp = skip_spaces (exp);
-
- event_location_up location = new_linespec_location (&exp);
+ event_location_up location
+ = new_linespec_location (&exp, symbol_name_match_type::WILD);
decode_line_full (location.get (), DECODE_LINE_FUNFIRSTLINE, NULL,
decode_line_full (location.get (), DECODE_LINE_FUNFIRSTLINE, NULL,
/* We don't deal with overlay debugging at the moment. We need to
think more carefully about this. If you copy this code into
/* We don't deal with overlay debugging at the moment. We need to
think more carefully about this. If you copy this code into
while (*cmdrest != '\0')
{
const char *cmd1;
cmd1 = cmdrest;
expression_up expr = parse_exp_1 (&cmd1, 0, (struct block *) 0, 1);
while (*cmdrest != '\0')
{
const char *cmd1;
cmd1 = cmdrest;
expression_up expr = parse_exp_1 (&cmd1, 0, (struct block *) 0, 1);
agent_expr_up agent = gen_printf (get_frame_pc (fi), get_current_arch (),
0, 0,
format_start, format_end - format_start,
agent_expr_up agent = gen_printf (get_frame_pc (fi), get_current_arch (),
0, 0,
format_start, format_end - format_start,
ax_reqs (agent.get ());
ax_print (gdb_stdout, agent.get ());
/* It would be nice to call ax_reqs here to gather some general info
about the expression, and then print out the result. */
ax_reqs (agent.get ());
ax_print (gdb_stdout, agent.get ());
/* It would be nice to call ax_reqs here to gather some general info
about the expression, and then print out the result. */
add_cmd ("agent", class_maintenance, agent_command,
_("\
Translate an expression into remote agent bytecode for tracing.\n\
add_cmd ("agent", class_maintenance, agent_command,
_("\
Translate an expression into remote agent bytecode for tracing.\n\
If -at is given, generate remote agent bytecode for this location.\n\
If not, generate remote agent bytecode for current frame pc address."),
&maintenancelist);
If -at is given, generate remote agent bytecode for this location.\n\
If not, generate remote agent bytecode for current frame pc address."),
&maintenancelist);
add_cmd ("agent-eval", class_maintenance, agent_eval_command,
_("\
Translate an expression into remote agent bytecode for evaluation.\n\
add_cmd ("agent-eval", class_maintenance, agent_eval_command,
_("\
Translate an expression into remote agent bytecode for evaluation.\n\
If -at is given, generate remote agent bytecode for this location.\n\
If not, generate remote agent bytecode for current frame pc address."),
&maintenancelist);
If -at is given, generate remote agent bytecode for this location.\n\
If not, generate remote agent bytecode for current frame pc address."),
&maintenancelist);