Commit Graph

1988 Commits

Author SHA1 Message Date
Denys Vlasenko
28ac68f2ab Optimize AArch64 handling of 32-bit personality
By putting aarch64_regs and arm_regs into a union,
register copying is eliminated.
No need to check and change personality on syscall exit.

* defs.h: Remove unused NUM_ARM_REGS define. Fix indentation.
* syscall.c: Put aarch64_regs and arm_regs into a union.
(update_personality): Shorten bitness message.
(printcall): Add commented-out PC printing.
(get_regs): Remove now-unnecessary 64-to-32 bits register copying.
(get_syscall_result): Drop personality changing code.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-08 12:38:51 +01:00
Denys Vlasenko
89804ec3e1 Rename some register statics by prefixing their names with arch.
This makes it easier to grep for them.

* syscall.c: Make IA64's r8, r10 global variables static.
Rename variables:
r8,r10 -> ia64_r8,ia64_r10.
d0 -> m68k_d0.
a3 -> alpha_a3.
r28 -> hppa_r28.
r9 -> sh64_r9.
r10 -> cris_r10.
r3 -> microblaze_r3.
(get_scno): Use new variable names.
(syscall_fixup_on_sysenter): Likewise.
(get_syscall_result): Likewise.
(get_error): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-07 13:14:48 +01:00
Denys Vlasenko
401374e9c2 Rename ARM's regs structure to arm_regs
Compile-tested.

* defs.h: Rename regs structure to arm_regs.
* syscall.c: Likewise.
(printcall): Use new name instead of old one.
(get_regs): Likewise.
(get_scno): Likewise.
(get_syscall_args): Likewise.
(get_error): Likewise.
* signal.c (sys_sigreturn): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-06 18:24:39 +01:00
Denys Vlasenko
4bdb6bb734 Stop needlessly using static variable
* syscall.c: Remove static long psr.
(get_scno): Use local psr variable.
(get_syscall_result): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-06 18:09:31 +01:00
Denys Vlasenko
8d4ca0c8cd Shortcut tests for fork/exec syscalls
This change should speed up strace by a tiny bit.

More importantly, it makes it much more clear that
fork and exec fixups are not necessary for any reasonably
recent kernels. IOW: syscall_fixup_for_fork_exec() and its callees
are all dead code.

* defs.h: Declare new need_fork_exec_workarounds flag variable.
* strace.c: Define need_fork_exec_workarounds flag variable.
(test_ptrace_setoptions_followfork): Return 0/1 as success/fail indicator.
(test_ptrace_setoptions_for_all): Likewise.
(init): Set need_fork_exec_workarounds to TRUE if needed.
* syscall.c: Rename internal_syscall() to syscall_fixup_for_fork_exec().
(trace_syscall_entering): Call syscall_fixup_for_fork_exec() only if
need_fork_exec_workarounds == TRUE.
(trace_syscall_exiting): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-06 13:18:42 +01:00
Ben Noordhuis
88eafd81ab Improve perf_event_open argument decoding
* configure.ac (AC_CHECK_HEADERS): Add linux/perf_event.h.
* desc.c [HAVE_LINUX_PERF_EVENT_H]: Include <linux/perf_event.h>.
(perf_event_open_flags): New xlat structure.
(sys_perf_event_open): New function.
* linux/dummy.h (sys_perf_event_open): Remove.
* linux/syscall.h (sys_perf_event_open): New prototype.

Signed-off-by: Ben Noordhuis <info@bnoordhuis.nl>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2013-02-05 23:15:14 +00:00
Chris Metcalf
af8dc6b3a5 tile: fix merge skew with new get_regs architecture
* defs.h [TILE]: Declare clear_regs(), get_regs() and get_regs_error.
* syscall.c (get_regs) [TILE]: Fix merge skew.
(printcall) [TILE]: fix a compiler warning about pt_reg_t in
a printf expression.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
2013-02-05 23:15:06 +00:00
Bernhard Reutner-Fischer
9e1a7d818a mount: decode MS_NOSEC
* system.c (MS_NOSEC): Define.
(mount_flags): Add MS_NOSEC.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-05 19:07:42 +00:00
Bernhard Reutner-Fischer
21ceeb4879 mmap: decode MAP_UNINITIALIZED
* mem.c (mmap_flags): Add MAP_UNINITIALIZED.

Signed-off-by: Bernhard Reutner-Fischer <rep.dot.nop@gmail.com>
2013-02-05 19:07:41 +00:00
ddba73e4c0 Print 64-bit instruction pointers zero padded
* syscall.c (printcall): Print 64-bit instruction pointers zero padded.
2013-02-05 19:01:58 +00:00
f0f41cfb19 x86_64: fix compilation warning introduced in previous commit
* syscall.c (printcall): Cast x86_64_regs.rip to the type being printed.
2013-02-05 18:57:16 +00:00
Denys Vlasenko
df39e56d2d Simple bug fix for x86_86
* syscall.c (printcall): Use x86_64_regs.rip, not x86_64_regs.ip.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-05 18:18:07 +01:00
Chris Metcalf
0b99a8ac3b Add tilegx support to strace
tilegx support has been in the kernel since 3.0.
In addition, fix some issues with the tilepro support already
present in strace, primarily the decision to use the
<asm/unistd.h> numbering space for system calls.

* defs.h [TILE]: Include <asm/ptrace.h> and provide an extern
struct pt_regs tile_regs for efficiency.  Provide compat 32-bit
personality via SUPPORTED_PERSONALITIES, PERSONALITY0_WORDSIZE,
PERSONALITY1_WORDSIZE, and DEFAULT_PERSONALITY.
* linux/tile/errnoent1.h: New file, includes linux/errnoent.h.
* linux/tile/ioctlent1.h: New file, includes linux/ioctlent.h.
* linux/tile/signalent1.h: New file, includes linux/signalent.h.
* linux/tile/syscallent.h: Update with new asm-generic syscalls.
The version previously committed was the from the first tile patch
to LKML, which subsequently was changed to use <asm-generic/unistd.h>.
* linux/tile/syscallent1.h: Copy from linux/tile/syscallent.h.
* mem.c (addtileflags) [TILE]: use %ld properly for a "long" variable.
* process.c [TILE]: Choose clone arguments correctly and properly
suppress all "struct user" related offsets in user_struct_offsets.
* signal.c [TILE]: Use tile_regs not upeek.
* syscall.c (update_personality) [TILE]: Print mode.
(PT_FLAGS_COMPAT) [TILE]: Provide if not in system headers.
(tile_regs) [TILE]: Define 'struct pt_regs' variable to hold state.
(get_regs) [TILE]: use PTRACE_GETREGS to set tile_regs rather than using upeek.
(get_scno) [TILE]: Set personality.
(get_syscall_args) [TILE]: Use tile_regs.
(get_syscall_result) [TILE]: Update tile_regs.
(get_error) [TILE]: Use tile_regs.
(printcall) [TILE]: Print pc.
(arg0_offset, arg1_offset, restore_arg0, restore_arg1) [TILE]:
Properly handle tile call semantics and support tilegx.

Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-05 17:48:33 +01:00
Denys Vlasenko
4645582edb Small optimization for SPARC[64] get_scno
* syscall.c: Remove static unsigned long trap veriable.
(get_scno): Use local trap variable.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-05 17:02:59 +01:00
Denys Vlasenko
1ebe08d613 Do not compile getrval2() if not needed
* syscall.c (getrval2): Do not compile it for architetures where
it isn't ever used.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-05 16:55:23 +01:00
Denys Vlasenko
ce7d953ebe Optimize out PTRACE_PEEKUSER with -i
strace -i was fetching PC with a separate PEEKUSER
despite having GETREGS data:

ptrace(PTRACE_GETREGS, 22331, 0, 0x8087f00) = 0
ptrace(PTRACE_PEEKUSER, 22331, 4*EIP, [0x80dd7b7]) = 0
write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
ptrace(PTRACE_SYSCALL, 22331, 0, SIG_0) = 0

Now it does this:

ptrace(PTRACE_GETREGS, 22549, 0, 0x8087ea0) = 0
write(3, "[080dd7b7] ioctl(0, SNDCTL_TMR_T"..., 82) = 82
ptrace(PTRACE_SYSCALL, 22549, 0, SIG_0) = 0

Analogous improvement in sys_sigreturn() is also implemented.

* defs.h: Declare extern struct pt_regs regs for SPARC[64] and ARM.
Declare clear_regs(), get_regs() and get_regs_error flag variable.
* strace.c (trace): Call get_regs(pid) as soon as we know the tcb
and that it is stopped.
* syscall.c (get_regs): New function. Used to fetch registers early,
just after tracee has stopped.
(printcall): Move it here from util.c. Use global regs.REG data,
if available on the arch, instead of re-fetching it.
(get_scno): Use global regs.REG data.
(get_syscall_result): Likewise.
* signal.c (sys_sigreturn): Likewise.
* util.c (printcall): Moved to syscall.c.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2013-02-05 16:36:13 +01:00
Stanislav Brabec
beae4c7182 Fix sys_semtimedop decoding on s390x
The s390 and s390x pass semtimedop arguments differently from other
architectures.  sys_semtimedop parser was fixed for s390 by commit
v4.6-177-ge0f5fd8, and s390x requires the same fix.

* linux/ipc.c (sys_semtimedop): Fix timespec decoding on s390x.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
2012-12-15 14:13:05 +00:00
1f21513c38 Fix *xattr decoding
* file.c (print_xattr_val): Do not attempt to decode a zero sized array.
Fixes RH#885233.
2012-12-08 00:18:45 +00:00
Stanislav Brabec
eff5c0e60c sys_semtimedop: fix timeval argument index in wrapped call
Looking at the implementation of wrapped semtimedop() call inside glibc
and kernel, I started to believe that timeval should be located in
tcp->u_arg[4] and not tcp->u_arg[5].  Fortunately, tcp->u_arg[5] now
works correctly as well, due to side effects of decode_ipc_subcall().

declaration in header:
int semtimedop(semid, *sops, nsops, *timeout);
                 0      1      2        3

sys_ipc arguments in glibc on all patforms except s390*:
semid, (int) nsops, 0, CHECK_N (sops, nsops), timeout
  0            1    2            3                4
We have to use indexes: 0 3 1 4

sys_ipc arguments on s390*:
semid, (int) nsops, timeout, sops
  0            1       2       3
We have to use indexes: 0 3 1 2

* ipc.c (sys_semtimedop) [!S390]: Fix timeval argument index in
indirect_ipccall case.
2012-12-08 00:17:59 +00:00
John Spencer
eb54c47725 Fix glibc version checks
* util.c: Check if __GLIBC__ is defined before using it.
* signal.c: Likewise.  Fix __GLIBC_MINOR__ checks.
2012-12-06 02:20:33 +00:00
James Hogan
05eb905c44 Add state argument to change_syscall and fix SPARC
Add a state argument to change_syscall() so that SPARC can modify that
instead of read-modify-writing the whole register set.  This function is
always called within an arg_setup/arg_finish_change sequence which on
certain architectures like SPARC will also be doing a read-modify-write.
This prevents the second write (from arg_finish_change) from undoing the
effects of the change_syscall call.

* util.c (change_syscall): Move below definition of arg_setup_state.
Add state argument.
[SPARC || SPARC64] Change to set state->u_regs[U_REG_G1] rather than
read-modify-writing it with PTRACE_GETREGS and PTRACE_SETREGS.
(setbpt, clearbpt): Pass state argument to change_syscall.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
2012-11-29 23:45:38 +00:00
Steve McIntyre
890a5cad23 Add support for tracing 32-bit ARM EABI binaries on AArch64
* defs.h [AARCH64]: Copy in the definition of arm_pt_regs and the
accessor macros, so it's possible to build on AArch64 without
ARM system headers.  Set SUPPORTED_PERSONALITIES to 2.
Define PERSONALITY0_WORDSIZE and PERSONALITY1_WORDSIZE.
Set DEFAULT_PERSONALITY to 1.
* linux/aarch64/errnoent1.h: New file, includes generic errnoent.h.
* linux/aarch64/ioctlent1.h: New file, includes generic ioctlent.h.
* linux/aarch64/signalent1.h: New file, includes generic signalent.h.
* linux/aarch64/syscallent1.h: Rename from linux/aarch64/syscallent.h.
* linux/aarch64/syscallent.h: New file, includes arm/syscallent.h.
* syscall.c [AARCH64]: Define aarch64_regs.
(update_personality) [AARCH64]: Add debug output.
(get_scno) [AARCH64]: Determine if we're in ARM or AArch64 mode by
checking the size of the returned uio structure from PTRACE_GETREGSET
and interpret the structure accordingly.
(get_syscall_result): Likewise.
(get_syscall_args): Merge the AArch64 and ARM sections so that on
AArch64 we can fall back to supporting the ARM personality.
(get_error): Likewise.

Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
2012-11-12 15:19:58 +00:00
716c93ecf8 Move asm-generic ioctl definitions to linux/ioctlent.h.in
* linux/ioctlent.h.in: Add asm-generic ioctl entries from all
linux/*/ioctlent.h.in files.
* linux/bfin/ioctlent.h.in: Remove asm-generic ioctl entries.
* linux/i386/ioctlent.h.in: Likewise.
* linux/powerpc/ioctlent.h.in: Likewise.
* linux/s390/ioctlent.h.in: Likewise.
* linux/sparc/ioctlent.h.in: Likewise.
2012-11-12 14:05:53 +00:00
17e3860ee8 Filter out redundant "*32" ioctl entries
* linux/ioctlent-filter.awk: New file.
* Makefile.am: Use it.
* linux/ioctlent.h.in: Removed redundant "*32" entries.
2012-10-27 01:13:53 +00:00
7943966f6c Enhance quotactl decoding
* quota.c (sys_quotactl): Decode 2nd syscall argument using printpath.
* pathtrace.c (pathtrace_match): Add quotactl support.
* linux/*/syscallent.h: Add TF flag to quotactl entry.
2012-10-26 23:43:13 +00:00
Steve McIntyre
d8d3bd3709 Add AArch64 support to strace
AArch64 has been included in linux from 3.7 onwards.
Add support for AArch64 in strace, tested on linux in a simulator.

* configure.ac: Support AArch64.
* defs.h [AARCH64]: Include <sys/ptrace.h>, define TCB_WAITEXECVE.
* ipc.c (indirect_ipccall): Support AArch64.
* process.c (struct_user_offsets): Likewise.
* syscall.c [AARCH64]: Include <asm/ptrace.h>,  <sys/uio.h>, and
<elf.h>.  Define struct user_pt_regs regs.
(get_scno, get_syscall_result): Support AArch64 using PTRACE_GETREGSET.
(get_syscall_args, get_error): Support AArch64.
* linux/aarch64/ioctlent.h.in: New file.
* linux/aarch64/syscallent.h: New file, based on linux 3.7 version of
asm-generic/unistd.h.

Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
2012-10-26 23:32:15 +00:00
Steve McIntyre
d6dbd998b7 linux: add new errno values for EPROBE_DEFER and EOPENSTALE
New definitions match updates in Linux 3.4 and Linux 3.5 respectively.

* linux/errnoent.h (ERRNO_517): Change to EPROBE_DEFER.
(ERRNO_518): Change to EOPENSTALE.

Signed-off-by: Steve McIntyre <steve.mcintyre@linaro.org>
2012-10-26 22:55:52 +00:00
Namhyung Kim
9679296d56 Add -e trace=memory option
Add a new 'memory' category for tracing memory mapping related syscalls.

Affected syscalls are: break, brk, get_mempolicy, madvise, mbind,
migrate_pages, mincore, mlock, mlockall, mmap, move_pages, mprotect,
mremap, msync, munlock, munlockall, munmap, remap_file_pages, and
set_mempolicy.

* defs.h (TRACE_MEMORY): New macro.
* syscall.c (lookup_class): Handle trace=memory option.
* strace.1: Document it.
* linux/alpha/syscallent.h: Add TM flag to memory mapping related syscalls.
* linux/arm/syscallent.h: Likewise.
* linux/avr32/syscallent.h: Likewise.
* linux/bfin/syscallent.h: Likewise.
* linux/hppa/syscallent.h: Likewise.
* linux/i386/syscallent.h: Likewise.
* linux/ia64/syscallent.h: Likewise.
* linux/m68k/syscallent.h: Likewise.
* linux/microblaze/syscallent.h: Likewise.
* linux/mips/syscallent.h: Likewise.
* linux/powerpc/syscallent.h: Likewise.
* linux/s390/syscallent.h: Likewise.
* linux/s390x/syscallent.h: Likewise.
* linux/sh/syscallent.h: Likewise.
* linux/sh64/syscallent.h: Likewise.
* linux/sparc/syscallent.h: Likewise.
* linux/tile/syscallent.h: Likewise.
* linux/x32/syscallent.h: Likewise.
* linux/x86_64/syscallent.h: Likewise.

Signed-off-by: Namhyung Kim <namhyung.kim@lge.com>
2012-10-26 22:45:08 +00:00
Mike Frysinger
85c2178490 x32: add 64bit annotation too
Since someone can invoke these entry points directly with syscall(),
at least decode their name and show that they're 64bit versions rather
than just showing syscall_###.

* linux/x32/syscallent.h: Sync all missing entries below 312 with x86_64.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-09-28 01:25:17 +00:00
b742d8c1b8 Ignore fflush(3) return value
strace used to honor fflush(3) return value in trace_syscall_entering
which resulted to tracees not being PTRACE_SYSCALL'ed which in turn
caused nasty hangups like this one:

$ strace -o'|:' pwd
|:: Broken pipe

There is little strace can do in case of fflush(3) returning EOF, and
hangup is certainly not the best solution for the issue.

* syscall.c (trace_syscall_entering): Ignore fflush(3) return value.
2012-09-28 01:18:43 +00:00
9a71bcdab2 Use perror_msg instead of perror
* signal.c (sys_sigreturn): Use perror_msg instead of perror.
* strace.c (tprintf, tprints, detach, startup_attach): Likewise.
* syscall.c (get_scno): Likewise.
* util.c (umoven, umovestr): Likewise.
2012-09-28 01:13:10 +00:00
Denys Vlasenko
4411a0ce30 process_vm_readv may return ESRCH if tracee was killed, don't complain
Discovered by running test/sigkill_rain under strace.

* util.c (umoven): Do not emit error message if process_vm_readv
fails with ESRCH.
(umovestr): LikeWise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-27 13:53:37 +02:00
Denys Vlasenko
978fbc901c Trivial fixes, no code changes.
* strace.c: Fix compiler warning message about tgkill - we don't use it.
Fix indentation of preprocessor directives.
(trace): Remove outdated comment.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-09-13 10:28:43 +02:00
508279c94f Always check setreuid return code
* strace.c (startup_child): Check setreuid return code.
2012-08-24 17:56:53 +00:00
Mike Frysinger
f04b5de5a5 x32: update {g,s}etsockopt syscall numbers
Starting with linux 3.6 (and backported to earlier kernels), these two
syscalls have changed numbers (moving from native to compat entry points).
Update the strace syscall list accordingly.

* linux/x32/syscallent.h: Move setsockopt from 54 to 541, and move
getsockopt from 55 to 542.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-08-24 12:18:48 +00:00
ad232c6aa0 Decode file type returned by getdents system call
* file.c (sys_getdents): Decode d_type in unabbreviated mode.
2012-08-16 19:29:55 +00:00
cf53436f73 Close pipe and wait for the pipe process termination
In case of normal strace termination, when the trace output is
redirected to a file or a pipe, close it and wait for the pipe
process termination.

* strace.c (main): Before normal exit, close shared_log when it
differs from stderr, and wait for popen_pid termination.
2012-07-12 20:54:46 +00:00
Denys Vlasenko
26bc0606d9 Enable usage of PTRACE_SEIZE
* defs.h: Define USE_SEIZE to 1. Remove PTRACE_SEIZE_DEVEL
and PTRACE_EVENT_STOP1.
* strace.c (ptrace_attach_or_seize): Replace PTRACE_SEIZE_DEVEL
with 0.
(trace): Do not check for PTRACE_EVENT_STOP1.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-07-10 16:36:32 +02:00
Mike Frysinger
d7df59197d x32: update syscall table
This syncs with the syscall table as it is in linux 3.4.

* linux/x32/syscallent.h (59): Fix comment typo.
(78): Add missing getdents entry.
(174): Delete create_module entry (not in the kernel).
(181, 182, 183, 184, 185): Add missing entries.
(524, 536, 539, 540): Fix spacing.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-06-05 13:35:01 +00:00
Denys Vlasenko
d33e72a26d Merge adjacent printing operations in a few places
* file.c (sys_readahead): Merge tprints() with following printllval().
(sys_ftruncate64): Likewise.
(sys_fadvise64): Likewise.
(sys_fadvise64_64): Likewise.
(sys_fallocate): Merge tprints() with following tprintf().

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-18 02:03:24 +02:00
Denys Vlasenko
318a273ea9 Use %d printf format instead of %i everywhere
* loop.c (loop_ioctl): Use %d instead of %i.
* mtd.c (mtd_ioctl): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-16 12:29:09 +02:00
Denys Vlasenko
8560ef291c Fix a few goofs in sys_sysctl()
* system.c (sys_sysctl): Cast pointer to long, not size_t,
when we intend to use it as an address. Set oldlen to 0 prior
to reading into it - we want to have deterministic result
if read fails.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-16 12:23:58 +02:00
Denys Vlasenko
048cc42f08 Stop using non-standard %Zu and %Zd formats for size_t printing
The documented formats are %zu and %zd, but since our (normally disabled)
"fast" printf code doesn't support those too, I convert them to %lu and %ld.

* bjm.c (sys_query_module): Convert %Zd usages to %lu.
* system.c (sys_sysctl): Likewise.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-16 12:20:17 +02:00
Denys Vlasenko
c59b3f13fb Remove outdated comment about suspending new tracees
We no longer track parent/child relationship between tracees.
Therefore, we no longer suspend new tracee until parent is seen
exiting form [v]fork/clone. The comment is obsolete.

* strace.c (trace): Remove outdated comment.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-15 15:35:52 +02:00
Denys Vlasenko
c52826c267 Make sure current_wordsize and PERSONALITY0_WORDSIZE are ints in all arches
On 64bit systems with a single personality, they used to be sizeof(long),
which has type "long", not "int", which complicates printf formats.

* defs.h: Ensure that PERSONALITY0_WORDSIZE;s tyoe is int.
This in turn makes sure current_wordsize is also an int.
* count.c (call_summary): Revert the change which added cast to int.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-15 14:28:56 +02:00
d376c92a91 Add configure --enable-gcc-Werror option
* configure.ac: New option --enable-gcc-Werror.
2012-05-15 00:50:26 +00:00
f112d07800 Make x86-64 build free of artificial warnings
* signal.c (sys_sigreturn): Do not issue "no sys_sigreturn" warning
on X86_64.
2012-05-15 00:13:59 +00:00
0dbc80de89 Fix kernel release string parsing
* strace.c (get_os_release): Handle "X.Y-something" utsname.release
strings properly.

Reported-by: Bryce Gibson <bryce@gibson-consulting.com.au>
2012-05-14 23:42:10 +00:00
Denys Vlasenko
55980f5b72 On clearing "breakpopint", restore syscall number too
This fixes Fedora bug 659382.
Low risk: this code is not supposed to be used on any non-acient kernel.

* util.c (clearbpt): Restore syscall number too.

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
2012-05-14 16:40:28 +02:00
Mike Frysinger
24ee60b836 util: fix building when glibc has a stub process_vm_readv
If you have a newer glibc which provides process_vm_readv, but it is built
against older kernel headers which lack __NR_process_vm_readv, the library
will contain a stub implementation that just returns ENOSYS.  Autoconf
checks for this case explicitly and will declare it as unavailable.  So we
end up in a case where the headers provide the prototype, but autoconf has
not defined HAVE_PROCESS_VM_READV, so we hit the same build failure again:

util.c:738:16: error: static declaration of 'process_vm_readv' follows non-static declaration
/usr/include/bits/uio.h:58:16: note: previous declaration of 'process_vm_readv' was here

So rename our local function to something unique, and add a define so the
callers all hit the right place.

* util.c (strace_process_vm_readv): Rename from process_vm_readv.
(process_vm_readv): Define to strace_process_vm_readv.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2012-05-05 00:06:58 +00:00