aboutsummaryrefslogtreecommitdiff
path: root/gdb/python
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2022-10-27 08:59:38 +0100
committerAndrew Burgess <aburgess@redhat.com>2022-11-18 11:21:37 +0000
commitf9f88aede3bb84efd088a59a5f6bccb3a6bb6516 (patch)
tree8460a59af9c8e78c340b0ba8afa160546dd45231 /gdb/python
parente86741b65ba9a614054241c0be45efb04484e320 (diff)
downloadgdb-f9f88aede3bb84efd088a59a5f6bccb3a6bb6516.zip
gdb-f9f88aede3bb84efd088a59a5f6bccb3a6bb6516.tar.gz
gdb-f9f88aede3bb84efd088a59a5f6bccb3a6bb6516.tar.bz2
gdb/testsuite: rewrite gdb.cp/call-method-register.exp with dwarf assembler
Convert the gdb.cp/call-method-register.exp test to make use of the DWARF assembler. The existing gdb.cp/call-method-register.exp test relies on a GCC extension - forcing a local variable into a particular named register. This means that the test will only work with Clang, and, as we have to name the register into which the variable will be placed, will only work for those targets where we've selected a suitable register, currently this is x86-64, i386, and ppc64. By switching to the DWARF assembler, the test will work with gcc and clang, and should work on most, if not all, architectures. The test creates a small structure, something that can fit within a register, and then tries to call a method on the structure from within GDB. This should fail because GDB can't take the address of the in register structure (for the `this` pointer). As the test is for a failure case, then we don't really care _which_ register the structure is in, and I take advantage of this for the DWARF assembler test, I just declare that the variable is in DW_OP_reg0, whatever that might be. I've tested the new test on x86-64, ppc, aarch64, and risc-v, and the test runs, and passes on all these architectures, which is already more than we used to cover. Additionally, on x86-64, I've tested with Clang and gcc, and the test runs and passed with both compilers. Reviewed-By: Lancelot SIX <lancelot.six@amd.com>
Diffstat (limited to 'gdb/python')
0 files changed, 0 insertions, 0 deletions