Simon pointed out that my agent expression C++-ification patches
caused a regression with the native-gdbserver target board. The bug
is that append_const is supposed to write in big-endian order, but I
switched this by mistake.
static void
append_const (struct agent_expr *x, LONGEST val, int n)
{
- int i;
-
- for (i = n - 1; i >= 0; i--)
+ size_t len = x->buf.size ();
+ x->buf.resize (len + n);
+ for (int i = n - 1; i >= 0; i--)
{
- x->buf.push_back (val & 0xff);
+ x->buf[len + i] = val & 0xff;
val >>= 8;
}
}