aboutsummaryrefslogtreecommitdiff
path: root/tests/guest-debug
AgeCommit message (Collapse)AuthorFilesLines
2023-05-18gdbstub: add test for untimely stop-reply packetsMatheus Tavares Bernardino1-4/+12
In the previous commit, we modified gdbstub.c to only send stop-reply packets as a response to GDB commands that accept it. Now, let's add a test for this intended behavior. Running this test before the fix from the previous commit fails as QEMU sends a stop-reply packet asynchronously, when GDB was in fact waiting an ACK. Signed-off-by: Matheus Tavares Bernardino <quic_mathbern@quicinc.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com> Message-Id: <a30d93b9a8d66e9d9294354cfa2fc3af35f00202.1683214375.git.quic_mathbern@quicinc.com>
2022-04-20tests/guest-debug: better handle gdb crashesAlex Bennée1-5/+6
There are a number of GDB's on various distros which fail fairly hard when attempting to talk to a cross-arch guest. The previous attempt to catch this was incorrect as the shell will deliver signals as 128+n. Fix the detection and while we are it improve the logging we dump into the test output. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reported-by: Gautam Agrawal <gautamnagrawal@gmail.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20220419091020.3008144-26-alex.bennee@linaro.org>
2021-02-25chardev: do not use short form boolean options in non-QemuOpts character ↵Paolo Bonzini1-4/+4
device descriptions Options such as "-gdb" or "-serial" accept a part-QemuOpts part-parsed-by-hand character device description. Do not use short form boolean options in the QemuOpts part. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-01-18gdbstub: implement a softmmu based testAlex Bennée1-9/+27
This adds a new tests that allows us to test softmmu only features including watchpoints. To do achieve this we need to: - add _exit: labels to the boot codes - write a memory.py test case - plumb the test case into the build system - tweak the run_test script to: - re-direct output when asked - use socket based connection for all tests - add a small pause before connection Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Message-Id: <20210108224256.2321-6-alex.bennee@linaro.org>
2021-01-18test/guest-debug: echo QEMU command as wellAlex Bennée1-0/+1
This helps with debugging. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20210108224256.2321-3-alex.bennee@linaro.org>
2020-05-15tests/guest-debug: catch hanging guestsAlex Bennée1-0/+6
If gdb never actually connected with the guest we need to catch that and clean-up after ourselves. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20200513175134.19619-2-alex.bennee@linaro.org>
2020-05-06tests/guest-debug: use the unix socket for linux-user testsAlex Bennée1-2/+11
Now we have support for debugging over a unix socket for linux-user lets use it in our test harness. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20200430190122.4592-8-alex.bennee@linaro.org>
2020-05-06tests/tcg: better trap gdb failuresAlex Bennée1-1/+18
It seems older and non-multiarach aware GDBs might not fail gracefully when faced with something they don't know. For example when faced with a target XML for s390x the Ubuntu 18.04 gdb will generate an internal fault and prompt for a core dump. Work around this by invoking GDB in a more batch orientated way and then trying to filter out between test failures and gdb failures. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20200430190122.4592-4-alex.bennee@linaro.org>
2020-03-17tests/guest-debug: add a simple test runnerAlex Bennée1-0/+57
The test runners job is to start QEMU with guest debug enabled and then spawn a gdb process running a test script that exercises the functionality it wants to test. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Tested-by: Philippe Mathieu-Daudé <philmd@redhat.com> Message-Id: <20200316172155.971-23-alex.bennee@linaro.org>
2020-02-07drop "from __future__ import print_function"Paolo Bonzini1-1/+0
This is only needed for Python 2, which we do not support anymore. Cc: Philippe Mathieu-Daudé <philmd@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com> Acked-by: Alex Bennée <alex.bennee@linaro.org> Acked-by: Markus Armbruster <armbru@redhat.com> Message-Id: <20200204160604.19883-1-pbonzini@redhat.com> Signed-off-by: Philippe Mathieu-Daudé <philmd@redhat.com>
2018-11-13tests/guest-debug: fix scoping of failcountAlex Bennée1-0/+1
You should declare you are using a global version of a variable before you attempt to modify it in a function. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Reviewed-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-id: 20181109152119.9242-5-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
2018-10-26tests: Fix typos in comments and help message (found by codespell)Stefan Weil1-1/+1
Fix also a grammar issue. Signed-off-by: Stefan Weil <sw@weilnetz.de> Reviewed-by: Alex Bennée <alex.bennee@linaro.org> Message-Id: <20180713054755.23323-1-sw@weilnetz.de> Signed-off-by: Laurent Vivier <laurent@vivier.eu>
2018-06-08python: futurize -f libfuturize.fixes.fix_print_with_importEduardo Habkost1-0/+1
Change all Python code to use print as a function. This is necessary for Python 3 compatibility. Done using: $ py=$( (g grep -l -E '^#!.*python';find -name '*.py' -printf '%P\n';) | \ sort -u | grep -v README.sh4) $ futurize -w -f libfuturize.fixes.fix_print_with_import $py Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com> Acked-by: Fam Zheng <famz@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com> Message-Id: <20180608122952.2009-2-ehabkost@redhat.com> [ehabkost: fixup tests/docker/docker.py] Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
2015-12-17tests/guest-debug: introduce basic gdbstub testsAlex Bennée1-0/+176
The aim of these tests is to combine with an appropriate kernel image (with symbol-file vmlinux) and check it behaves as it should. Given a kernel it checks: - single step - software breakpoint - hardware breakpoint - access, read and write watchpoints On success it returns 0 to the calling process. I've not plumbed this into the "make check" logic though as we need a solution for providing non-host binaries to the tests. However the test is structured to work with pretty much any Linux kernel image as it uses the basic kernel_init code which is common across architectures. Signed-off-by: Alex Bennée <alex.bennee@linaro.org> Message-id: 1449599553-24713-7-git-send-email-alex.bennee@linaro.org Signed-off-by: Peter Maydell <peter.maydell@linaro.org>