diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 018104c219..2386c0a181 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2017-03-20 Andreas Arnez + + * gdb.base/examine-backward.c (Barrier): New character array + constant, to ensure that TestStrings is preceded by a string + terminator. + 2017-03-16 Andreas Arnez * lib/dwarf.exp: Add support for DW_OP_implicit_pointer. diff --git a/gdb/testsuite/gdb.base/examine-backward.c b/gdb/testsuite/gdb.base/examine-backward.c index 5e9162a293..462089d14e 100644 --- a/gdb/testsuite/gdb.base/examine-backward.c +++ b/gdb/testsuite/gdb.base/examine-backward.c @@ -32,6 +32,14 @@ literals. The content of each array is the same as followings: }; */ +/* This is here just to ensure we have a null character before + TestStrings, to avoid showing garbage when we look for strings + backwards from TestStrings. */ + +const char Barrier[] = { + 0x00, +}; + const char TestStrings[] = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x46, 0x47, 0x48, 0x49, 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50,