diff options
author | Pedro Alves <palves@redhat.com> | 2018-04-26 13:01:27 +0100 |
---|---|---|
committer | Pedro Alves <palves@redhat.com> | 2018-04-26 13:11:09 +0100 |
commit | c7075ad5030c4c2e79a04f3517689b751ff41860 (patch) | |
tree | 56c9f7a828468310dc0ce42319f220f4cb938bf5 /gdb/testsuite/gdb.base/gnu-ifunc.c | |
parent | bfa5bd2ab31a8abb23cb442d51fe6c3836028880 (diff) | |
download | gdb-c7075ad5030c4c2e79a04f3517689b751ff41860.zip gdb-c7075ad5030c4c2e79a04f3517689b751ff41860.tar.gz gdb-c7075ad5030c4c2e79a04f3517689b751ff41860.tar.bz2 |
Extend GNU ifunc testcases
This patch extends/rewrites the gdb.base/gnu-ifunc.exp testcase to
cover the many different fixes in earlier patches. (This was actually
what encovered most of the problems.)
The current testcase uses an ifunc symbol with the same name as the
ifunc resolver symbol and makes sure to compile the ifunc resolver
without debug info. That does not model how ifuncs are implemented in
gcc/ifunc nowadays. Instead, what we have is that the glibc ifunc
resolvers nowadays are written in C and end up with debug info.
Also, in some cases the ifunc target is written in assembly, but in
other cases it's written in C. In the case of target function written
in C, if the target function has debug info, when we set a break on
the ifunc, we want to set it past the prologue of the target function.
Currently GDB gets that wrong.
To make sure we cover all the different scenarios, the testcase is
tweaked to cover all the different combinations of
- An ifunc resolver with the same name as the user-visible symbol vs
an ifunc resolver with a different name as the user-visible symbol.
- ifunc resolver compiled with and without debug info.
- ifunc target function compiled with and without debug info.
The testcase currently sets breakpoints on ifuncs, calls ifunc
functions, steps into ifunc functions, etc. After this series, this
all works and the testcase passes cleanly.
While working on this, I noticed that "b gnu_ifunc" before and after
the inferior resolved the ifunc would end up with a breakpoint with
different locations. That's now covered by new tests inside the new
"set-break" procedure.
It also tests other things like making sure we can't call an ifunc
without a return-type case if we don't know the type of the target.
And making sure that we pass enough arguments when we do know the
type.
gdb/testsuite/ChangeLog:
2018-04-26 Pedro Alves <palves@redhat.com>
* gdb.base/gnu-ifunc-final.c: New file.
* gdb.base/gnu-ifunc.c (final): Delete, moved to gnu-ifunc-final.c.
* gdb.base/gnu-ifunc.exp (executable): Delete.
(staticexecutable): Adjust.
(lib_opts, exec_opts): Delete.
(make_binsuffix, build, set-break): New procedures.
(misc_tests): New, with tests factored out from the top level.
(top level): Test different combinations of ifunc resolver name,
resolver with and with debug info, and ifunc target with and
without debug info. Wrap static tests with with_target_prefix.
Diffstat (limited to 'gdb/testsuite/gdb.base/gnu-ifunc.c')
-rw-r--r-- | gdb/testsuite/gdb.base/gnu-ifunc.c | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/gdb/testsuite/gdb.base/gnu-ifunc.c b/gdb/testsuite/gdb.base/gnu-ifunc.c index 78fd30d..a4abaca 100644 --- a/gdb/testsuite/gdb.base/gnu-ifunc.c +++ b/gdb/testsuite/gdb.base/gnu-ifunc.c @@ -23,12 +23,6 @@ init_stub (int arg) return 0; } -int -final (int arg) -{ - return arg + 1; -} - /* Make differentiation of how the gnu_ifunc call resolves before and after calling gnu_ifunc_pre. This ensures the resolved function address is not being cached anywhere for the debugging purposes. */ |