mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2025-01-06 12:09:26 +08:00
d5bcff0343
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.
13 lines
147 B
C
13 lines
147 B
C
/* Simple shared library */
|
|
|
|
int multiply(int a, int b)
|
|
{
|
|
return a * b;
|
|
}
|
|
|
|
int square(int num)
|
|
{
|
|
int res = multiply(num, num);
|
|
return res;
|
|
}
|