aboutsummaryrefslogtreecommitdiff
path: root/etc
diff options
context:
space:
mode:
authorBruno Larsen <blarsen@redhat.com>2022-07-20 16:44:40 -0300
committerBruno Larsen <blarsen@redhat.com>2022-09-22 11:04:18 +0200
commit7e1cd467b5c12b719c764fe219c7f6736ccf8c31 (patch)
tree96d21c847275ab30c18fe3660ece2c2f276a89dd /etc
parent53d4a55bebf56c5ceb6bcf7ff43efd05043a0fc7 (diff)
downloadgdb-7e1cd467b5c12b719c764fe219c7f6736ccf8c31.zip
gdb-7e1cd467b5c12b719c764fe219c7f6736ccf8c31.tar.gz
gdb-7e1cd467b5c12b719c764fe219c7f6736ccf8c31.tar.bz2
gdb.base/skip.exp: Use finish to exit functions
gdb.base/skip.exp was making use of a fixed number of step commands to exit some functions. This caused some problems when using clang to test GDB, as GDB would need fewer steps to reach the desired spots. For instance, when testing in the section "step after disabling 3", the log looks like this: Breakpoint 4, main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32 32 x = baz ((bar (), foo ())); (gdb) step bar () at binutils-gdb/gdb/testsuite/gdb.base/skip1.c:21 21 return 1; (gdb) PASS: gdb.base/skip.exp: step after disabling 3: step 1 step foo () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:42 42 return 0; (gdb) PASS: gdb.base/skip.exp: step after disabling 3: step 2 step main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:34 34 test_skip_file_and_function (); (gdb) step test_skip_file_and_function () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:59 59 test_skip (); (gdb) FAIL: gdb.base/skip.exp: step after disabling 3: step 3 step test_skip () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:48 48 } (gdb) PASS: gdb.base/skip.exp: step after disabling 3: step 4 step test_skip_file_and_function () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:60 60 skip1_test_skip_file_and_function (); (gdb) FAIL: gdb.base/skip.exp: step after disabling 3: step 5 This shows that the feature is working but because the inferior lands in a different location, it registers as a failure. Seeing as along with this difference, there are also some differences that depend on gcc versions (where gdb might stop back at line 32 before entering foo), it would not be easy to test for this behavior using steps and analzing where the inferior stops at each point. On the other hand, using gdb_step_until is not feasible because we'd possibly gloss over stepping into baz and rendering the whole test useless. Instead, skip.exp now uses finish to leave functions, synchronizing through compilers and compiler versions. Some test names were also changed to be a bit more descriptive. The new log looks like this, independently of compiler used: Breakpoint 4, main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32 32 x = baz ((bar (), foo ())); (gdb) step bar () at binutils-gdb/gdb/testsuite/gdb.base/skip1.c:21 21 return 1; (gdb) PASS: gdb.base/skip.exp: step after disabling 3: step into bar finish Run till exit from #0 bar () at binutils-gdb/gdb/testsuite/gdb.base/skip1.c:21 main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32 32 x = baz ((bar (), foo ())); Value returned is $2 = 1 (gdb) PASS: gdb.base/skip.exp: step after disabling 3: return from bar step foo () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:42 42 return 0; (gdb) PASS: gdb.base/skip.exp: step after disabling 3: step into foo finish Run till exit from #0 foo () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:42 main () at binutils-gdb/gdb/testsuite/gdb.base/skip.c:32 32 x = baz ((bar (), foo ())); Value returned is $3 = 0 (gdb) PASS: gdb.base/skip.exp: step after disabling 3: Return from foo step 34 test_skip_file_and_function (); (gdb) PASS: gdb.base/skip.exp: step after disabling 3: step and skip baz
Diffstat (limited to 'etc')
0 files changed, 0 insertions, 0 deletions