gdb/testsuite: change gdb.base/nodebug.exp to not fail with clang
authorBruno Larsen <blarsen@redhat.com>
Wed, 20 Jul 2022 19:44:30 +0000 (16:44 -0300)
committerBruno Larsen <blarsen@redhat.com>
Mon, 12 Sep 2022 12:06:51 +0000 (14:06 +0200)
commite33020494502d0879c418d69d5a2fd6f6453863a
treebf5cd4ddb3a1d0e754f02b813392edc3a5c2643e
parent825a844fdcfd4532cddde14d7bb38f1f981fa9fe
gdb/testsuite: change gdb.base/nodebug.exp to not fail with clang

Clang organizes the variables differently to gcc in the original version
of this code, leading to the following differences when testing
p (int*) &dataglobal + 1

gcc:
$16 = (int *) 0x404034 <datalocal>

clang:
$16 = (int *) 0x404034 <dataglobal8>

However, since the important part of this test doesn't seem to be which
symbol is linked, but rather if GDB is correctly increasing the
address. This test was changed to actually measure address changes,
instead of assuming the ordering and naming of symbols.

Co-Authored-By: Andrew Burgess <aburgess@redhat.com>
gdb/testsuite/gdb.base/nodebug.exp