87 for (i = n - 1; i >= 0; i--)
89 x->
buf[x->
len + i] = val & 0xff;
106 error (
_(
"GDB bug: ax-general.c (read_const): incomplete constant"));
108 for (i = 0; i < n; i++)
109 accum = (accum << 8) | x->
buf[o + i];
136 if (depth < 0 || depth > 255)
137 error (
_(
"GDB bug: ax-general.c (ax_pick): stack depth out of range"));
149 if (n < 0 || n > 255)
150 error (
_(
"GDB bug: ax-general.c (generic_ext): bit count out of range"));
152 if (
sizeof (
LONGEST) * 8 > 255)
153 error (
_(
"GDB bug: ax-general.c (generic_ext): " 154 "opcode has inadequate range"));
183 if (n < 0 || n > 255)
184 error (
_(
"GDB bug: ax-general.c (ax_trace_quick): " 185 "size out of range for trace_quick"));
188 x->
buf[x->
len++] = aop_trace_quick;
204 x->
buf[x->
len + 1] = 0xff;
205 x->
buf[x->
len + 2] = 0xff;
219 if (target < 0 || target >= 0xffff)
220 error (
_(
"GDB bug: ax-general.c (ax_label): label target out of range"));
222 x->
buf[patch] = (target >> 8) & 0xff;
223 x->
buf[patch + 1] = target & 0xff;
233 {aop_const8, aop_const16, aop_const32, aop_const64};
245 if (-lim <= l && l <= lim - 1)
257 if (l < 0 &&
size < 64)
266 error (
_(
"GDB bug: ax-general.c (ax_const_d): " 267 "floating point not supported yet"));
280 error (
_(
"'%s' is a pseudo-register; " 281 "GDB cannot yet trace its contents."),
284 error (
_(
"Trace '%s' failed."),
294 error (
_(
"GDB bug: ax-general.c (ax_reg): " 295 "register number out of range"));
310 if (num < 0 || num > 0xffff)
312 _(
"ax-general.c (ax_tsv): variable " 313 "number is %d, out of range"), num);
317 x->
buf[x->
len + 1] = (num >> 8) & 0xff;
318 x->
buf[x->
len + 2] = (num) & 0xff;
333 if (slen < 0 || slen > 0xffff)
335 _(
"ax-general.c (ax_string): string " 336 "length is %d, out of allowed range"), slen);
339 x->
buf[x->
len++] = ((slen + 1) >> 8) & 0xff;
340 x->
buf[x->
len++] = (slen + 1) & 0xff;
341 for (i = 0; i < slen; ++i)
342 x->
buf[x->
len++] = str[i];
354 #define DEFOP(NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED, VALUE) \ 355 , { # NAME, SIZE, DATA_SIZE, CONSUMED, PRODUCED } 377 error (
_(
"GDB bug: ax-general.c (ax_print): opcode map out of sync"));
379 for (i = 0; i < x->
len;)
406 else if (op == aop_printf)
413 slen = slen * 256 + x->
buf[i++];
415 &(x->
buf[i]), nargs);
431 error (
_(
"'%s' is a pseudo-register; " 432 "GDB cannot yet trace its contents."),
435 error (
_(
"Trace '%s' failed."),
451 int new_len = byte + 1;
452 unsigned char *new_reg_mask
475 char *targets = (
char *) alloca (ax->
len * sizeof (targets[0]));
479 char *boundary = (
char *) alloca (ax->
len * sizeof (boundary[0]));
484 int *heights = (
int *) alloca (ax->
len * sizeof (heights[0]));
489 memset (targets, 0, ax->
len * sizeof (targets[0]));
490 memset (boundary, 0, ax->
len * sizeof (boundary[0]));
496 for (i = 0; i < ax->
len; i += 1 + op->
op_size)
521 if (targets[i] && (heights[i] != height))
531 if (height < ax->min_height)
544 || aop_if_goto == op -
aop_map)
547 if (target < 0 || target >= ax->
len)
555 if (targets[target] || boundary[target])
557 if (heights[target] != height)
566 heights[target] = height;
580 height = heights[i + 3];
593 for (i = 0; i < ax->
len; i++)
594 if (targets[i] && !boundary[i])
const char * user_reg_map_regnum_to_name(struct gdbarch *gdbarch, int regnum)
int ax_goto(struct agent_expr *x, enum agent_op op)
void ax_reqs(struct agent_expr *ax)
void ax_reg_mask(struct agent_expr *ax, int reg)
void * memset(T *s, int c, size_t n)=delete
void internal_error(const char *file, int line, const char *fmt,...)
void ax_const_d(struct agent_expr *x, LONGEST d)
static void generic_ext(struct agent_expr *x, enum agent_op op, int n)
void ax_reg(struct agent_expr *x, int reg)
int gdbarch_num_regs(struct gdbarch *gdbarch)
agent_expr(struct gdbarch *gdbarch, CORE_ADDR scope)
void ax_tsv(struct agent_expr *x, enum agent_op op, int num)
const char * paddress(struct gdbarch *gdbarch, CORE_ADDR addr)
static LONGEST read_const(struct agent_expr *x, int o, int n)
void fprintf_filtered(struct ui_file *stream, const char *format,...)
static void grow_expr(struct agent_expr *x, int n)
void fputs_filtered(const char *linebuffer, struct ui_file *stream)
void ax_ext(struct agent_expr *x, int n)
void ax_string(struct agent_expr *x, const char *str, int slen)
void ax_label(struct agent_expr *x, int patch, int target)
void ax_simple(struct agent_expr *x, enum agent_op op)
#define XRESIZEVEC(T, P, N)
int gdbarch_ax_pseudo_register_push_stack_p(struct gdbarch *gdbarch)
PTR xrealloc(PTR ptr, size_t size)
void ax_print(struct ui_file *f, struct agent_expr *x)
void print_longest(struct ui_file *stream, int format, int use_c_format, LONGEST val_long)
int gdbarch_ax_pseudo_register_push_stack(struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
static void append_const(struct agent_expr *x, LONGEST val, int n)
void ax_trace_quick(struct agent_expr *x, int n)
void ax_const_l(struct agent_expr *x, LONGEST l)
void ax_pick(struct agent_expr *x, int depth)
int gdbarch_ax_pseudo_register_collect_p(struct gdbarch *gdbarch)
void ax_zero_ext(struct agent_expr *x, int n)
int gdbarch_ax_pseudo_register_collect(struct gdbarch *gdbarch, struct agent_expr *ax, int reg)
void error(const char *fmt,...)
void ax_raw_byte(struct agent_expr *x, gdb_byte byte)
int gdbarch_remote_register_number(struct gdbarch *gdbarch, int regno)