aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.base/step-indirect-call-thunk.exp
AgeCommit message (Collapse)AuthorFilesLines
2024-01-12Update copyright year range in header of all files managed by GDBAndrew Burgess1-1/+1
This commit is the result of the following actions: - Running gdb/copyright.py to update all of the copyright headers to include 2024, - Manually updating a few files the copyright.py script told me to update, these files had copyright headers embedded within the file, - Regenerating gdbsupport/Makefile.in to refresh it's copyright date, - Using grep to find other files that still mentioned 2023. If these files were updated last year from 2022 to 2023 then I've updated them this year to 2024. I'm sure I've probably missed some dates. Feel free to fix them up as you spot them.
2023-03-10More uses of require with istargetTom Tromey1-3/+1
I found a few more spots that check istarget that can be switched to use 'require'.
2023-01-01Update copyright year range in header of all files managed by GDBJoel Brobecker1-1/+1
This commit is the result of running the gdb/copyright.py script, which automated the update of the copyright year range for all source files managed by the GDB project to be updated to include year 2023.
2022-07-18[gdb/testsuite] Fix regression in step-indirect-call-thunk.exp with gcc 7Tom de Vries1-1/+5
Since commit 43127ae5714 ("Fix gdb.base/step-indirect-call-thunk.exp") I run into: ... gdb compile failed, gcc: error: unrecognized command line option \ '-fcf-protection=none'; did you mean '-flto-partition=none'? UNTESTED: gdb.base/step-indirect-call-thunk.exp: failed to prepare ... The problem is that -fcf-protection is supported starting gcc 8, but I'm using system gcc 7.5.0. Fix this by only adding -fcf-protection=none for gcc 8 and later. Tested on x86_64-linux, with gcc 7.5.0, 8.2.1 and 12.1.1.
2022-07-13Fix gdb.base/step-indirect-call-thunk.expCarl Love1-1/+5
Due to recent changes in the default value of -fcf-protection for gcc, the test gdb.base/step-indirect-call-thunk.exp fails on Intel X86-64 with the error: Executing on host: gcc -fno-stack-protector -fdiagnostics-color=never -mindirect-branch=thunk -mfunction-return=thunk -c -g -o /.../gdb/testsuite/outputs/gdb.base/step-indirect-call-thunk/step-indirect-call-thunk0.o /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c (timeout = 300) builtin_spawn -ignore SIGHUP gcc -fno-stack-protector -fdiagnostics-color=never -mindirect-branch=thunk -mfunction-return=thunk -c -g -o /.../gdb/testsuite/outputs/gdb.base/step-indirect-call-thunk/step-indirect-call-thunk0.o /.../binutils-gdb-current/gdb/testsuite/gdb.base/step-indirect-call-thunk.c /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c: In function 'inc': /.../gdb/testsuite/gdb.base/step-indirect-call-thunk.c: 22:1: error: '-mindirect-branch' and '-fcf-protection' are not compatible 22 | { /* inc.1 */ As stated in the error message the default "-fcf-protection" and "-mindirect-branch' are in compatible. The fcf-protection argument needs to be "-fcf-protection=none" for the test to compile on Intel. The gcc command line "-mindirect-branch' is an Intel specific and will give an error on other platforms. A check for X86 is added so the test will only run on X86 platforms. The patch has been tested and verified on Power 10 and Intel X86-64 systems with no regressions.
2022-01-01Automatic Copyright Year update after running gdb/copyright.pyJoel Brobecker1-1/+1
This commit brings all the changes made by running gdb/copyright.py as per GDB's Start of New Year Procedure. For the avoidance of doubt, all changes in this commits were performed by the script.
2021-11-02[gdb/testsuite] Fix stepi test-cases with unix/-m32/-fPIE/-pieTom de Vries1-1/+4
When running test-case gdb.base/step-indirect-call-thunk.exp with target board unix/-m32/-fPIE/-pie, I run into: ... (gdb) stepi^M 0x5655552e 22 { /* inc.1 */^M (gdb) stepi^M 0x56555530 22 { /* inc.1 */^M (gdb) stepi^M 0x565555f7 in __x86.get_pc_thunk.ax ()^M (gdb) FAIL: gdb.base/step-indirect-call-thunk.exp: stepi into return thunk ... In contrast, with unix/-m32 we have instead: ... (gdb) stepi^M 0x08048407 22 { /* inc.1 */^M (gdb) stepi^M 23 return x + 1; /* inc.2 */^M (gdb) stepi^M 0x0804840c 23 return x + 1; /* inc.2 */^M (gdb) stepi^M 24 } /* inc.3 */^M (gdb) stepi^M 0x08048410 24 } /* inc.3 */^M (gdb) stepi^M 0x0804848f in __x86_return_thunk ()^M (gdb) PASS: gdb.base/step-indirect-call-thunk.exp: stepi into return thunk ... The test-case doesn't expect to run into __x86.get_pc_thunk.ax, which is a PIC helper function for x86_64-linux. Fix this by insn-stepping through it. Likewise in a few other test-cases. Tested on x86_64-linux.
2021-09-30gdb/testsuite: make runto_main not pass no-message to runtoSimon Marchi1-1/+0
As follow-up to this discussion: https://sourceware.org/pipermail/gdb-patches/2020-August/171385.html ... make runto_main not pass no-message to runto. This means that if we fail to run to main, for some reason, we'll emit a FAIL. This is the behavior we want the majority of (if not all) the time. Without this, we rely on tests logging a failure if runto_main fails, otherwise. They do so in a very inconsisteny mannet, sometimes using "fail", "unsupported" or "untested". The messages also vary widly. This patch removes all these messages as well. Also, remove a few "fail" where we call runto (and not runto_main). by default (without an explicit no-message argument), runto prints a failure already. In two places, gdb.multi/multi-re-run.exp and gdb.python/py-pp-registration.exp, remove "message" passed to runto. This removes a few PASSes that we don't care about (but FAILs will still be printed if we fail to run to where we want to). This aligns their behavior with the rest of the testsuite. Change-Id: Ib763c98c5f4fb6898886b635210d7c34bd4b9023
2021-01-01Update copyright year range in all GDB filesJoel Brobecker1-1/+1
This commits the result of running gdb/copyright.py as per our Start of New Year procedure... gdb/ChangeLog Update copyright year range in copyright header of all GDB files.
2020-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
gdb/ChangeLog: Update copyright year range in all GDB files.
2019-01-01Update copyright year range in all GDB files.Joel Brobecker1-1/+1
This commit applies all changes made after running the gdb/copyright.py script. Note that one file was flagged by the script, due to an invalid copyright header (gdb/unittests/basic_string_view/element_access/char/empty.cc). As the file was copied from GCC's libstdc++-v3 testsuite, this commit leaves this file untouched for the time being; a patch to fix the header was sent to gcc-patches first. gdb/ChangeLog: Update copyright year range in all GDB files.
2018-04-13infrun: step through indirect branch thunksMarkus Metzger1-0/+73
With version 7.3 GCC supports new options -mindirect-branch=<choice> -mfunction-return=<choice> The choices are: keep behaves as before thunk jumps through a thunk thunk-external jumps through an external thunk thunk-inline jumps through an inlined thunk For thunk and thunk-external, GDB would, on a call to the thunk, step into the thunk and then resume to its caller assuming that this is an undebuggable function. On a return thunk, GDB would stop inside the thunk. Make GDB step through such thunks instead. Before: Temporary breakpoint 1, main () at gdb.base/step-indirect-call-thunk.c:37 37 x = apply (inc, 41); (gdb) s apply (op=0x80483e6 <inc>, x=41) at gdb.base/step-indirect-call-thunk.c:29 29 return op (x); (gdb) 30 } After: Temporary breakpoint 1, main () at gdb.base/step-indirect-call-thunk.c:37 37 x = apply (inc, 41); (gdb) s apply (op=0x80483e6 <inc>, x=41) at gdb.base/step-indirect-call-thunk.c:29 29 return op (x); (gdb) inc (x=41) at gdb.base/step-indirect-call-thunk.c:23 23 return x + 1; This is independent of the step-mode. In order to step into the thunk, you would need to use stepi. When stepping over an indirect call thunk, GDB would first step through the thunk, then recognize that it stepped into a sub-routine and resume to the caller (of the thunk). Not sure whether this is worth optimizing. Thunk detection is implemented via gdbarch. I implemented the methods for IA. Other architectures may run into unexpected fails. The tests assume a fixed number of instruction steps to reach a thunk. This depends on the compiler as well as the architecture. They may need adjustments when we add support for more architectures. Or we can simply drop those tests that cover being able to step into thunks using instruction stepping. When using an older GCC, the tests will fail to build and will be reported as untested: Running .../gdb.base/step-indirect-call-thunk.exp ... gdb compile failed, \ gcc: error: unrecognized command line option '-mindirect-branch=thunk' gcc: error: unrecognized command line option '-mfunction-return=thunk' === gdb Summary === # of untested testcases 1 gdb/ * infrun.c (process_event_stop_test): Call gdbarch_in_indirect_branch_thunk. * gdbarch.sh (in_indirect_branch_thunk): New. * gdbarch.c: Regenerated. * gdbarch.h: Regenerated. * x86-tdep.h: New. * x86-tdep.c: New. * Makefile.in (ALL_TARGET_OBS): Add x86-tdep.o. (HFILES_NO_SRCDIR): Add x86-tdep.h. (ALLDEPFILES): Add x86-tdep.c. * arch-utils.h (default_in_indirect_branch_thunk): New. * arch-utils.c (default_in_indirect_branch_thunk): New. * i386-tdep: Include x86-tdep.h. (i386_in_indirect_branch_thunk): New. (i386_elf_init_abi): Set in_indirect_branch_thunk gdbarch function. * amd64-tdep: Include x86-tdep.h. (amd64_in_indirect_branch_thunk): New. (amd64_init_abi): Set in_indirect_branch_thunk gdbarch function. testsuite/ * gdb.base/step-indirect-call-thunk.exp: New. * gdb.base/step-indirect-call-thunk.c: New. * gdb.reverse/step-indirect-call-thunk.exp: New. * gdb.reverse/step-indirect-call-thunk.c: New.