[gdb/testsuite] Make inline-locals.c deterministic
When running testcase gdb.opt/inline-locals.exp on openSUSE Tumbleweed, I get:
...
(gdb) info locals^M
array = {0 <repeats 48 times>, 15775231, 0, 194, 0, -11497, 32767, 4199061, \
0, 0, 0, 0, 0, 4198992, 0, 4198432, 0}^M
(gdb) FAIL: gdb.opt/inline-locals.exp: info locals above bar 2
...
Fix this by:
- completely initializing array before printing any value
- updating the pattern to match "array = {0 <repeats 64 times>}"
Tested on x86_64-linux.
gdb/testsuite/ChangeLog:
2020-07-21 Tom de Vries <tdevries@suse.de>
* gdb.opt/inline-locals.c (init_array): New func.
(func1): Use init_array.
* gdb.opt/inline-locals.exp: Update pattern.
This commit is contained in:
parent
bd460ecb31
commit
f0f9e75a82
@ -1,3 +1,9 @@
|
||||
2020-07-21 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.opt/inline-locals.c (init_array): New func.
|
||||
(func1): Use init_array.
|
||||
* gdb.opt/inline-locals.exp: Update pattern.
|
||||
|
||||
2020-07-21 Tom de Vries <tdevries@suse.de>
|
||||
|
||||
* gdb.debuginfod/fetch_src_and_symbols.exp: Use save_vars for env
|
||||
|
||||
@ -29,9 +29,18 @@ volatile int *array_p;
|
||||
|
||||
void bar(void);
|
||||
|
||||
void
|
||||
init_array (int *array, int n)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < n; ++i)
|
||||
array[i] = 0;
|
||||
}
|
||||
|
||||
inline ATTR int func1(int arg1)
|
||||
{
|
||||
int array[64];
|
||||
init_array (array, 64);
|
||||
array_p = array;
|
||||
array[0] = result;
|
||||
array[1] = arg1;
|
||||
|
||||
@ -43,7 +43,7 @@ if { ! $no_frames } {
|
||||
"backtrace from bar 2"
|
||||
gdb_test "up" "#1 .*func1 .* at .*" "up from bar 2"
|
||||
gdb_test "info frame" ".*inlined into frame.*" "func1 inlined 2"
|
||||
set pass_re "array = {$decimal, \[^\r\n\]*}"
|
||||
set pass_re "array = \\{0 <repeats 64 times>\\}"
|
||||
set kfail_re [multi_line $pass_re \
|
||||
"array = {<optimized out> <repeats 64 times>}"]
|
||||
gdb_test_multiple "info locals" "info locals above bar 2" {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user