diff options
author | Bruno Larsen <blarsen@redhat.com> | 2022-09-13 18:47:05 +0200 |
---|---|---|
committer | Bruno Larsen <blarsen@redhat.com> | 2022-09-22 11:04:17 +0200 |
commit | d5bcff0343ae1a4a8be76fd8646b22f20f9ed94a (patch) | |
tree | 702c108dd57867bdc3c3c3870fdd7607000bef1b /gdb/testsuite/gdb.base/skip-solib-lib.c | |
parent | 07bb02de7232c7d0974007296540d9887532b952 (diff) | |
download | gdb-d5bcff0343ae1a4a8be76fd8646b22f20f9ed94a.zip gdb-d5bcff0343ae1a4a8be76fd8646b22f20f9ed94a.tar.gz gdb-d5bcff0343ae1a4a8be76fd8646b22f20f9ed94a.tar.bz2 |
Change gdb.base/skip-solib.exp deal with lack of epilogue information
When running gdb.base/skip-solib.exp, the backtrace tests could fail with
compilers that associated epilogue instructions with the last statement
line of the function, instead of associating it with the closing brace,
despite the feature being fully functional. As an example, when testing
skipping the function square, the testsuite would show
Breakpoint 1, main () at (...)/binutils-gdb/gdb/testsuite/gdb.base/skip-solib-main.c:5
5 return square(0);
(gdb) step
0x00007ffff7cef560 in __libc_start_call_main () from /lib64/libc.so.6
(gdb) PASS: gdb.base/skip-solib.exp: ignoring solib file: step
bt
#0 0x00007ffff7cef560 in __libc_start_call_main () from /lib64/libc.so.6
#1 0x00007ffff7cef60c in __libc_start_main_impl () from /lib64/libc.so.6
#2 0x0000000000401065 in _start ()
(gdb) FAIL: gdb.base/skip-solib.exp: ignoring solib file: bt
Which means that the feature is working, the testsuite is just
mis-identifying it. To avoid this problem, the skipped function calls
have been sent to a line before `return`, so epilogues won't factor in.
Diffstat (limited to 'gdb/testsuite/gdb.base/skip-solib-lib.c')
-rw-r--r-- | gdb/testsuite/gdb.base/skip-solib-lib.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/testsuite/gdb.base/skip-solib-lib.c b/gdb/testsuite/gdb.base/skip-solib-lib.c index b2c4d86..341f144 100644 --- a/gdb/testsuite/gdb.base/skip-solib-lib.c +++ b/gdb/testsuite/gdb.base/skip-solib-lib.c @@ -7,5 +7,6 @@ int multiply(int a, int b) int square(int num) { - return multiply(num, num); + int res = multiply(num, num); + return res; } |