glibc/debug
Adhemerval Zanella a43565ac44 Refactor sigcontextinfo.h
This patch refactor sigcontextinfo.h header to use SA_SIGINFO as default
for both gmon and debug implementations.  This allows simplify
profil-counter.h on Linux to use a single implementation and remove the
requirements for newer ports to redefine __sigaction/sigaction to use
SA_SIGINFO.

The GET_PC macro is also replaced with a function sigcontext_get_pc that
returns an uintptr_t instead of a void pointer.  It allows easier convertion
to integer on ILP32 architecture, such as x32, without the need to suppress
compiler warnings.

The patch also requires some refactor of register-dump.h file for some
architectures (to reflect it is now called from a sa_sigaction instead of
sa_handler signal context).

   - Alpha, i386, and s390 are straighfoward to take in consideration the
     new argument type.

   - ia64 takes in consideration the kernel pass a struct sigcontextt
     as third argument for sa_sigaction.

   - sparc take in consideration the kernel pass a pt_regs struct
     as third argument for sa_sigaction.

   - m68k dummy function is removed and the FP state is dumped on
     register_dump itself.

   - For SH the register-dump.h file is consolidate on a common implementation
     and the floating-point state is checked based on ownedfp field.

The register_dump does not change its output format in any affected
architecture.

I checked on x86_64-linux-gnu, i686-linux-gnu, aarch64-linux-gnu,
arm-linux-gnueabihf, sparcv9-linux-gnu, sparc64-linux-gnu, powerpc-linux-gnu,
powerpc64-linux-gnu, and powerpc64le-linux-gnu.

I also checked the libSegFault.so through catchsegv on alpha-linux-gnu,
m68k-linux-gnu and sh4-linux-gnu to confirm the output has not changed.

	Adhemerval Zanella  <adhemerval.zanella@linaro.org>
	Florian Weimer  <fweimer@redhat.com>

	* debug/segfault.c (install_handler): Use SA_SIGINFO if defined.
	* sysdeps/generic/profil-counter.h (__profil_counter): Cast to
	uintptr_t.
	* sysdeps/generic/sigcontextinfo.h (GET_PC): Rename to
	sigcontext_get_pc and return aligned cast to uintptr_t.
	* sysdeps/mach/hurd/i386/sigcontextinfo.h (GET_PC): Likewise.
	* sysdeps/posix/profil.c (profil_count): Change PC argument to
	uintptr_t.
	(__profil): Use SA_SIGINFO.
	* sysdeps/posix/sprofil.c (profil_count): Change PCP argument to
	uintptr_t.
	(__sprofil): Use SA_SIGINFO.
	* sysdeps/unix/sysv/linux/profil-counter.h: New file.
	* sysdeps/unix/sysv/linux/aarch64/profil-counter.h: Remove file.
	* sysdeps/unix/sysv/linux/csky/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/nios2/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/riscv/profil-counter.h: Likewise.
	* sysdeps/sysv/linux/s390/s390-32/profil-counter.h: Likewise.
	* sysdeps/sysv/linux/s390/s390-64/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/profil-counter.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/profil-counter.h (__profil_counter):
	Assume SA_SIGINFO and use sigcontext_get_pc instead of GET_PC.
	* sysdeps/unix/sysv/linux/sparc/profil-counter.h: New file.
	* sysdeps/unix/sysv/linux/sparc/sparc64/profil-counter.h: Remove file.
	* sysdeps/unix/sysv/linux/sparc/sparc32/profil-counter.h: Likewise.
	* sysdpes/unix/sysv/linux/aarch64/sigcontextinfo.h (SIGCONTEXT,
	GET_PC, __sigaction, sigaction): Remove defines.
	(sigcontext_get_pc): New function.
	* sysdeps/unix/sysv/linux/alpha/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/arm/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/csky/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/hppa/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/i386/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/ia64/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/m68k/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/mips/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/nios2/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/s390/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/microblaze/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/powerpc/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/riscv/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/sigcontextinfo.h: Likewise.
	* sysdeps/sysv/linux/sparc/sparc32/sigcontextinfo.h: Likewise.
	* sysdeps/sysv/linux/sparc/sparc64/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/x86_64/sigcontextinfo.h: Likewise.
	* sysdeps/unix/sysv/linux/alpha/register-dump.h (register_dump):
	Handle CTX argument as ucontext_t.
	* sysdeps/unix/sysv/linux/i386/register-dump.h: Likewise.
	Likewise.
	* sysdeps/unix/sysv/linux/m68k/register-dump.h: Likewise.
	* sysdeps/sysv/linux/s390/s390-32/register-dump.h: Likewise.
	* sysdeps/sysv/linux/s390/s390-64/register-dump.h: Likewise.
	* sysdeps/unix/sysv/linux/sh/register-dump.h: New file.
	* sysdeps/unix/sysv/linux/sh/sh4/register-dump.h: Remove File.
	* sysdeps/unix/sysv/linux/sh/sh3/register-dump.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc32/register-dump.h: Likewise.
	* sysdeps/unix/sysv/linux/sparc/sparc64/register-dump.h: Likewise.
	* sysdeps/unix/sysv/linux/Makefile (tests-internal): Add
	tst-sigcontextinfo-get_pc.
	* sysdeps/unix/sysv/linux/tst-sigcontextinfo-get_pc.c: New file.
	(CFLAGS-tst-sigcontextinfo-get_pc.c): New rule.
2019-08-23 11:30:56 -03:00
..
Depend * stdlib/bits/stdlib.h: New file. 2005-07-13 06:09:58 +00:00
Makefile Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
Versions New string function explicit_bzero (from OpenBSD). 2016-12-16 16:21:54 -05:00
asprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
backtrace-tst.c Add #include <stdint.h> for uint[32|64]_t usage (except installed headers). 2013-05-16 11:32:54 -05:00
backtrace.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
backtracesyms.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
backtracesymsfd.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
catchsegv.sh Update copyright dates not handled by scripts/update-copyrights. 2019-01-01 00:15:13 +00:00
chk_fail.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
confstr_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
dprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
execinfo.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
explicit_bzero_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fdelt_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fgets_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fgets_u_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fgetws_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fgetws_u_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fortify_fail.c Do not print backtraces on fatal glibc errors 2019-08-19 15:41:29 +02:00
fprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fread_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fread_u_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
fwprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
getcwd_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
getdomainname_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
getgroups_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
gethostname_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
gets_chk.c libio: Use stdin consistently for input functions [BZ #24153] 2019-02-03 09:38:24 +01:00
getwd_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
longjmp_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mbsnrtowcs_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mbsrtowcs_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mbstowcs_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
memcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
memmove_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
mempcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
memset_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
noophooks.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
obprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
pcprofile.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
pcprofiledump.c Update copyright dates not handled by scripts/update-copyrights. 2019-01-01 00:15:13 +00:00
poll_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ppoll_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
pread64_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
pread_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
printf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
read_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
readlink_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
readlinkat_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
readonly-area.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
realpath_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
recv_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
recvfrom_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
segfault.c Refactor sigcontextinfo.h 2019-08-23 11:30:56 -03:00
snprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
sprintf_chk.c Set behavior of sprintf-like functions with overlapping source and destination 2019-01-02 13:53:52 -02:00
stack_chk_fail.c Do not print backtraces on fatal glibc errors 2019-08-19 15:41:29 +02:00
stack_chk_fail_local.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
stpcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
stpncpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
strcat_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
strcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
strncat_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
strncpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
swprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
test-stpcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
test-strcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-backtrace.h Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-backtrace2.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-backtrace3.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-backtrace4.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-backtrace5.c nptl: Fix testcases for new pthread cancellation mechanism 2019-01-03 18:38:09 -02:00
tst-backtrace6.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-chk1.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-chk2.c 2004-10-15 Jakub Jelinek <jakub@redhat.com> 2004-10-18 04:17:19 +00:00
tst-chk3.c 2004-10-15 Jakub Jelinek <jakub@redhat.com> 2004-10-18 04:17:19 +00:00
tst-chk4.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-chk5.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-chk6.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-lfschk1.c * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t 2005-03-20 16:51:05 +00:00
tst-lfschk2.c * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t 2005-03-20 16:51:05 +00:00
tst-lfschk3.c * posix/bits/unistd.h (pread) [__USE_FILE_OFFSET64]: Use __off64_t 2005-03-20 16:51:05 +00:00
tst-lfschk4.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-lfschk5.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-lfschk6.cc * misc/sys/cdefs.h (__va_arg_pack): Define for GCC 4.3+. 2007-09-15 02:38:04 +00:00
tst-longjmp_chk.c tests: unify fortification handler logic 2014-02-08 06:58:43 -05:00
tst-longjmp_chk2.c test-skeleton.c: Add write_message function 2016-06-23 11:00:36 +02:00
tst-longjmp_chk3.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
tst-ssp-1.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
ttyname_r_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vasprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vdprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vfprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vfwprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vobprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vsnprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vsprintf_chk.c Set behavior of sprintf-like functions with overlapping source and destination 2019-01-02 13:53:52 -02:00
vswprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
vwprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
warning-nop.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcpcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcpncpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcrtomb_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcscat_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcscpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcsncat_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcsncpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcsnrtombs_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcsrtombs_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wcstombs_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wctomb_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wmemcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wmemmove_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wmempcpy_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wmemset_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
wprintf_chk.c Update copyright dates with scripts/update-copyrights. 2019-01-01 00:11:28 +00:00
xtrace.sh Update copyright dates not handled by scripts/update-copyrights. 2019-01-01 00:15:13 +00:00