This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH] Fix spurious FAILs with examine-backward.exp
- From: Andreas Arnez <arnez at linux dot vnet dot ibm dot com>
- To: gdb-patches at sourceware dot org
- Date: Mon, 20 Mar 2017 18:14:30 +0100
- Subject: [PATCH] Fix spurious FAILs with examine-backward.exp
- Authentication-results: sourceware.org; auth=none
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.
This patch assures that TestStrings is preceded by a string terminator.
gdb/testsuite/ChangeLog:
* gdb.base/examine-backward.c (Barrier): New character array
constant, to ensure that TestStrings is preceded by a string
terminator.
---
gdb/testsuite/gdb.base/examine-backward.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c
index 5e9162a..ab04eff 100644
--- a/gdb/testsuite/gdb.base/examine-backward.c
+++ b/gdb/testsuite/gdb.base/examine-backward.c
@@ -32,6 +32,10 @@ literals. The content of each array is the same as followings:
};
*/
+const char Barrier[] = {
+ 0x00,
+};
+
const char TestStrings[] = {
0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48,
0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,
--
2.5.0