diff options
author | Luis Machado <luis.machado@linaro.org> | 2020-06-15 15:55:02 -0300 |
---|---|---|
committer | Luis Machado <luis.machado@linaro.org> | 2020-07-16 13:09:27 -0300 |
commit | 46195acfb8ca81c83522d3f1fb184eeeebf190c2 (patch) | |
tree | 7923e525d1806e3554e3f2dda5197106ac9d74e9 /gdb/testsuite/lib/gdb.exp | |
parent | 59bdb29c7e125832578c03bf0e964b1dbffc964c (diff) | |
download | binutils-gdb-users/luisgpm/aarch64-mte-v3.tar.gz |
Add memory tagging testcasesusers/luisgpm/aarch64-mte-v3
Add an AArch64-specific test and a more generic memory tagging test that
other architectures can run.
Even though architectures not supporting memory tagging can run the memory
tagging tests, the runtime check will make the tests bail out early, as it
would make no sense to proceed without proper support.
It is also tricky to do any further runtime tests for memory tagging, given
we'd need to deal with tags, and those are arch-specific. Therefore the
test in gdb.base is more of a smoke test.
If an architecture wants to implement memory tagging, then it makes sense to
have tests within gdb.arch instead.
gdb/testsuite/ChangeLog:
YYYY-MM-DD Luis Machado <luis.machado@linaro.org>
* gdb.arch/aarch64-mte.c: New file.
* gdb.arch/aarch64-mte.exp: New test.
* gdb.base/memtag.c: New file.
* gdb.base/memtag.exp: New test.
* lib/gdb.exp (supports_memtag): New function.
Diffstat (limited to 'gdb/testsuite/lib/gdb.exp')
-rw-r--r-- | gdb/testsuite/lib/gdb.exp | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp index 78dae17b0c7..54f31177e4e 100644 --- a/gdb/testsuite/lib/gdb.exp +++ b/gdb/testsuite/lib/gdb.exp @@ -2635,6 +2635,22 @@ proc supports_get_siginfo_type {} { } } +# Return 1 if memory tagging is supported at runtime, otherwise return 0. + +proc supports_memtag {} { + global gdb_prompt + + gdb_test_multiple "mtag check" "" { + -re "Memory tagging not supported or disabled by the current architecture\..*$gdb_prompt $" { + return 0 + } + -re "Argument required \\(address or pointer\\).*$gdb_prompt $" { + return 1 + } + } + return 0 +} + # Return 1 if the target supports hardware single stepping. proc can_hardware_single_step {} { |