diff options
author | Tom Tromey <tom@tromey.com> | 2023-06-29 19:38:10 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-06-30 08:11:20 -0600 |
commit | 72723f78cc511d0ea209805bcde2d3b4ba11616c (patch) | |
tree | 5a92bf4959c14eb7a51c8a49c6e9741729b8c79d /gdb | |
parent | e507570754867e3b74c01b55386067c30651c776 (diff) | |
download | gdb-72723f78cc511d0ea209805bcde2d3b4ba11616c.zip gdb-72723f78cc511d0ea209805bcde2d3b4ba11616c.tar.gz gdb-72723f78cc511d0ea209805bcde2d3b4ba11616c.tar.bz2 |
Fix regressions caused by agent expression C++-ification
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.
Diffstat (limited to 'gdb')
-rw-r--r-- | gdb/ax-general.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/ax-general.c b/gdb/ax-general.c index 26a27a0..24101c6 100644 --- a/gdb/ax-general.c +++ b/gdb/ax-general.c @@ -41,11 +41,11 @@ static void generic_ext (struct agent_expr *x, enum agent_op op, int n); 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; } } |