diff options
author | Tom de Vries <tdevries@suse.de> | 2023-11-21 13:15:29 +0100 |
---|---|---|
committer | Tom de Vries <tdevries@suse.de> | 2023-11-21 13:15:29 +0100 |
commit | 42ffc15774fc791f2ac9a719e81589c8e91bdb98 (patch) | |
tree | 082b00b3287c477e42dda74ed69dc58afbfa5ed9 /gdbserver/linux-aarch64-tdesc.cc | |
parent | cc1cc4061bcfb71d99b4e000c0dd0fdd9907a043 (diff) | |
download | gdb-42ffc15774fc791f2ac9a719e81589c8e91bdb98.zip gdb-42ffc15774fc791f2ac9a719e81589c8e91bdb98.tar.gz gdb-42ffc15774fc791f2ac9a719e81589c8e91bdb98.tar.bz2 |
[gdb/testsuite] Fix spurious FAILs with examine-backward.exp, again
Commit 59a561480d5 ("Fix spurious FAILs with examine-backward.exp") describes
the problem that:
...
The test case examine-backward.exp issues the command "x/-s" after the end
of the first string in TestStrings, but without making sure that this
string is preceded by a string terminator. Thus GDB may spuriously print
some random characters from before that string, and then the test fails.
...
The commit fixes the problem by adding a Barrier variable before the TestStrings
variable:
...
+const char Barrier[] = { 0x0 };
const char TestStrings[] = {
...
There is however no guarantee that Barrier is placed immediately before
TestStrings.
Before recent commit 169fe7ab54b ("Change gdb.base/examine-backwards.exp for
AIX.") on x86_64-linux, I see:
...
0000000000400660 R Barrier
0000000000400680 R TestStrings
...
So while the Barrier variable is the first before the TestStrings variable,
it's not immediately preceding TestStrings.
After commit 169fe7ab54b:
...
0000000000402259 B Barrier
0000000000402020 D TestStrings
...
they're not even in the same section anymore.
Fix this reliably by adding the zero in the array itself:
...
char TestStringsBase[] = {
0x0,
...
};
char *TestStrings = &TestStringsBase[1];
...
and do likewise for TestStringsH and TestStringsW.
Tested on x86_64-linux.
PR testsuite/31064
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31064
Diffstat (limited to 'gdbserver/linux-aarch64-tdesc.cc')
0 files changed, 0 insertions, 0 deletions