Testing and gdbstub fixes:

- fix diff-out pass in check-tcg
   - ensure generation of fprem reference
   - fix gdb set_reg fallback
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEZoWumedRZ7yvyN81+9DbCVqeKkQFAl0lvNwACgkQ+9DbCVqe
 KkSEowgAjS68Nhp2uFDq1cqJlHpLfSX3Gym6BemkWE2yTaAKAjFTI0XN2RttUncx
 3eVYFOWXic8JBWtJDjQFy0aI96S4EvpFgP8teOPCIU4KNNuH33KaXMsOYvh7kKRB
 Bb/kMpGX9iYe3xpIEk5+7Lc8F6Sgg0nLD+JZhzFEMYGdfh5QV9ksoTsVMg8PNL98
 hIIbuEQhBCXieuV4obX2okpy6NOZ5H+WP0P1lnJh3qC81OiSn6QU840m3yOrVIL1
 mJAmFx7PN9sewA+Nvowe5BK6iOwBgw6uL6laB9xJGXknc3QSZdpVfhO7wVqfrBjn
 W9q4sakiluBvGOg/AyOIj9oMYwBbOg==
 =YdS6
 -----END PGP SIGNATURE-----

Merge remote-tracking branch 'remotes/stsquad/tags/pull-testing-and-gdbstub-100719-1' into staging

Testing and gdbstub fixes:

  - fix diff-out pass in check-tcg
  - ensure generation of fprem reference
  - fix gdb set_reg fallback

# gpg: Signature made Wed 10 Jul 2019 11:24:28 BST
# gpg:                using RSA key 6685AE99E75167BCAFC8DF35FBD0DB095A9E2A44
# gpg: Good signature from "Alex Bennée (Master Work Key) <alex.bennee@linaro.org>" [full]
# Primary key fingerprint: 6685 AE99 E751 67BC AFC8  DF35 FBD0 DB09 5A9E 2A44

* remotes/stsquad/tags/pull-testing-and-gdbstub-100719-1:
  gdbstub: revert to previous set_reg behaviour
  gdbstub: add some notes to the header comment
  tests/tcg: fix diff-out pass to properly report failure
  tests/tcg: fix up test-i386-fprem.ref generation

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
Peter Maydell 2019-07-11 10:03:42 +01:00
commit abd45ff039
3 changed files with 25 additions and 9 deletions

View File

@ -1,6 +1,10 @@
/*
* gdb server stub
*
* This implements a subset of the remote protocol as described in:
*
* https://sourceware.org/gdb/onlinedocs/gdb/Remote-Protocol.html
*
* Copyright (c) 2003-2005 Fabrice Bellard
*
* This library is free software; you can redistribute it and/or
@ -15,6 +19,8 @@
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, see <http://www.gnu.org/licenses/>.
*
* SPDX-License-Identifier: LGPL-2.0+
*/
#include "qemu/osdep.h"
@ -1667,12 +1673,23 @@ static void handle_remove_bp(GdbCmdContext *gdb_ctx, void *user_ctx)
put_packet(gdb_ctx->s, "E22");
}
/*
* handle_set/get_reg
*
* Older gdb are really dumb, and don't use 'G/g' if 'P/p' is available.
* This works, but can be very slow. Anything new enough to understand
* XML also knows how to use this properly. However to use this we
* need to define a local XML file as well as be talking to a
* reasonably modern gdb. Responding with an empty packet will cause
* the remote gdb to fallback to older methods.
*/
static void handle_set_reg(GdbCmdContext *gdb_ctx, void *user_ctx)
{
int reg_size;
if (!gdb_has_xml) {
put_packet(gdb_ctx->s, "E00");
put_packet(gdb_ctx->s, "");
return;
}
@ -1692,11 +1709,6 @@ static void handle_get_reg(GdbCmdContext *gdb_ctx, void *user_ctx)
{
int reg_size;
/*
* Older gdb are really dumb, and don't use 'g' if 'p' is avaialable.
* This works, but can be very slow. Anything new enough to
* understand XML also knows how to use this properly.
*/
if (!gdb_has_xml) {
put_packet(gdb_ctx->s, "");
return;

View File

@ -45,7 +45,11 @@ run-test = $(call quiet-command, timeout $(TIMEOUT) $2,"TEST",$3)
endif
# $1 = test name, $2 = reference
diff-out = $(call quiet-command, diff -u $1.out $2 | head -n 10,"DIFF","$1.out with $2")
# to work around the pipe squashing the status we only pipe the result if
# we know it failed and then force failure at the end.
diff-out = $(call quiet-command, diff -q $1.out $2 || \
(diff -u $1.out $2 | head -n 10 && false), \
"DIFF","$1.out with $2")
# $1 = test name, $2 = reason
skip-test = @printf " SKIPPED %s on $(TARGET_NAME) because %s\n" $1 $2

View File

@ -35,9 +35,9 @@ test-i386-fprem.ref: test-i386-fprem
$(call quiet-command, ./$< > $@,"GENREF","generating $@")
run-test-i386-fprem: TIMEOUT=60
run-test-i386-fprem: test-i386-fprem
run-test-i386-fprem: test-i386-fprem test-i386-fprem.ref
$(call run-test,test-i386-fprem, $(QEMU) $<,"$< on $(TARGET_NAME)")
$(call diff-out,test-i386-fprem, $(I386_SRC)/$<.ref)
$(call diff-out,test-i386-fprem, test-i386-fprem.ref)
else
run-test-i386-fprem: test-i386-fprem
$(call skip-test, $<, "SLOW")