debian/0000775000000000000000000000000012332502122007160 5ustar debian/control0000664000000000000000000000202212312603364010567 0ustar Source: ltrace Section: utils Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Juan Cespedes Standards-Version: 3.9.5 Build-Depends: cdbs (>= 0.4.23-1.1), debhelper (>= 7), dh-autoreconf, libiberty-dev, libelf-dev, libselinux1-dev Package: ltrace Architecture: linux-any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Tracks runtime library calls in dynamically linked programs ltrace is a debugging program which runs a specified command until it exits. While the command is executing, ltrace intercepts and records the dynamic library calls which are called by the executed process and the signals received by that process. It can also intercept and print the system calls executed by the program. . The program to be traced need not be recompiled for this, so you can use it on binaries for which you don't have the source handy. . You should install ltrace if you need a sysadmin tool for tracking the execution of processes. debian/changelog0000664000000000000000000007525512332502122011050 0ustar ltrace (0.7.3-4ubuntu5.1) trusty; urgency=medium * debian/ptrace.diff: updated to restore PTRACE scope sysctl warning (LP: #1317136) -- Marc Deslauriers Wed, 07 May 2014 15:04:45 -0400 ltrace (0.7.3-4ubuntu5) trusty; urgency=medium * Build-depend on dh-autoreconf. -- Matthias Klose Thu, 20 Mar 2014 16:18:36 +0100 ltrace (0.7.3-4ubuntu4) trusty; urgency=medium * Add patch to support arm64 (LP: #1292089). * Include cdbs' autoreconf rules to generate new Makefiles -- dann frazier Thu, 13 Mar 2014 10:17:20 -0600 ltrace (0.7.3-4ubuntu3) trusty; urgency=medium * Update patch to support ppc64el. -- Matthias Klose Mon, 24 Feb 2014 16:37:49 +0100 ltrace (0.7.3-4ubuntu2) trusty; urgency=medium * Add patch to support ppc64el. -- Matthias Klose Thu, 09 Jan 2014 16:10:19 +0100 ltrace (0.7.3-4ubuntu1) trusty; urgency=medium * Merge with Debian; remaining changes: - Set architecture to linux-any. - sysdeps/linux-gnu/trace.c: try to make PTRACE scope sysctl more discoverable. - Use libelf-dev instead of libelfg0-dev - Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in debian/rules CFLAGS. The configure script has a bug where it can't properly cope with the need to define these before detecting the use of elfutils. -- Matthias Klose Mon, 06 Jan 2014 12:57:31 +0100 ltrace (0.7.3-4) unstable; urgency=low * Get rid of dh_autoreconf (not needed) * Added "mips" and "mipsel" architectures * Continue after unexpected breakpoint (closes: #649569) -- Juan Cespedes Fri, 03 Jan 2014 13:56:53 +0100 ltrace (0.7.3-3) unstable; urgency=low * Really add support for armhf * Fix new compilation error on sparc -- Juan Cespedes Fri, 03 Jan 2014 10:07:03 +0100 ltrace (0.7.3-2) unstable; urgency=low * Build without libunwind to avoid problems in transition * Added support for powerpcspe (closes: #692486) * Added support for armhf * Fix compilation on sparc -- Juan Cespedes Thu, 02 Jan 2014 23:06:26 +0100 ltrace (0.7.3-1) unstable; urgency=low * New upstream release (closes: #675607), including: + support dlopen()'d libraries (closes: #537781) + support PIE binaries (closes: #614018) + fix -T option (closes: #548400) + use $HOST_CPU instead of $(uname -m) (closes: #457696) + don't hardcode gcc or assume -liberty and -lsupc++ exist (closes: #593639) + support threaded programs (closes: #282068, #591412) * Fix "free(): invalid pointer" crash (closes: #724253) * Fix FTBFS on alpha (closes: #678721) # Added "s390x" to the list of supported archs (closes: #645615) * Fixed dpkg-shlibdeps warning: don't link against libstdc++ or libsupc++ if we have libiberty * Switch to 3.0 (quilt) source format * Standards-Version: 3.9.5 * Lintian clean -- Juan Cespedes Thu, 02 Jan 2014 18:00:05 +0100 ltrace (0.5.3-2.2) unstable; urgency=medium * Non-maintainer upload * Build-depend on libiberty-dev instead of binutils-dev (Closes: #730933) -- David Prévot Sat, 21 Dec 2013 19:21:35 -0400 ltrace (0.5.3-2.1ubuntu3) quantal; urgency=low * Rebuild for new armel compiler default of ARMv5t. -- Colin Watson Tue, 02 Oct 2012 16:36:36 +0100 ltrace (0.5.3-2.1ubuntu2) precise; urgency=low * Build for armhf. -- Matthias Klose Mon, 05 Dec 2011 16:43:20 +0100 ltrace (0.5.3-2.1ubuntu1) natty; urgency=low * Merge with Debian; remaining changes: - Fix ARM syscall_p to handle Thumb-2 mode (Zach Welch). LP: #639796. - sysdeps/linux-gnu/trace.c: adjust sysctl hint to include new yama path. - sysdeps/linux-gnu/trace.c: try to make PTRACE scope sysctl more discoverable. - Use libelf-dev instead of libelfg0-dev - Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in debian/rules CFLAGS. The configure script has a bug where it can't properly cope with the need to define these before detecting the use of elfutils. -- Matthias Klose Wed, 24 Nov 2010 17:58:11 +0100 ltrace (0.5.3-2.1) unstable; urgency=low * Non-maintainer upload. * Add missing includes in sysdeps/linux-gnu/ppc/plt.c to fix FTBFS on powerpc (closes: #574114). Thanks to Javi Merino for the bug report. -- Jakub Wilk Sun, 02 May 2010 10:27:16 +0200 ltrace (0.5.3-2ubuntu6) maverick; urgency=low * Fix ARM syscall_p to handle Thumb-2 mode (Zach Welch). LP: #639796. -- Matthias Klose Fri, 01 Oct 2010 16:06:14 +0200 ltrace (0.5.3-2ubuntu5) maverick; urgency=low * sysdeps/linux-gnu/trace.c: adjust sysctl hint to include new yama path. -- Kees Cook Tue, 06 Jul 2010 15:18:57 -0700 ltrace (0.5.3-2ubuntu4) maverick; urgency=low * sysdeps/linux-gnu/trace.c: try to make PTRACE scope sysctl more discoverable. -- Kees Cook Wed, 09 Jun 2010 16:49:53 -0700 ltrace (0.5.3-2ubuntu3) lucid; urgency=low * rebuild rest of main for armel armv7/thumb2 optimization; UbuntuSpec:mobile-lucid-arm-gcc-v7-thumb2 -- Alexander Sack Sun, 07 Mar 2010 00:56:41 +0100 ltrace (0.5.3-2ubuntu2) karmic; urgency=low * sysdeps/linux-gnu/ppc/plt.c: Include . -- Matthias Klose Sun, 27 Sep 2009 14:05:50 +0200 ltrace (0.5.3-2ubuntu1) karmic; urgency=low * Merge from debian unstable, remaining changes: LP: #404856 - Add lpia to architecture list. - Use libelf-dev instead of libelfg0-dev - Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in debian/rules CFLAGS. The configure script has a bug where it can't properly cope with the need to define these before detecting the use of elfutils. -- Bhavani Shankar Tue, 28 Jul 2009 16:44:35 +0530 ltrace (0.5.3-2) unstable; urgency=low * Fixed compilation problems in armel, ia64 and powerpc (closes: Bug#538441) -- Juan Cespedes Sun, 26 Jul 2009 13:24:44 +0200 ltrace (0.5.3-1) unstable; urgency=low * New upstream release * Make it work again in sparc with new kernel headers (closes: Bug#532195) -- Juan Cespedes Sat, 25 Jul 2009 16:24:38 +0200 ltrace (0.5.2-2ubuntu1) karmic; urgency=low * Merge from debian unstable, remaining changes: - Add lpia to architecture list. - Use libelf-dev instead of libelfg0-dev - Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in debian/rules CFLAGS. The configure script has a bug where it can't properly cope with the need to define these before detecting the use of elfutils. -- Michael Vogt Wed, 03 Jun 2009 11:03:35 +0200 ltrace (0.5.2-2) unstable; urgency=low * Make clone() work when child starts after parent finishes * See syscalls as syscalls and not sysrets when we are a clone -- Juan Cespedes Thu, 28 May 2009 16:30:08 +0200 ltrace (0.5.2-1) unstable; urgency=low * New upstream release (closes: Bug#463023) * New approach for following forks; it should now attach every newly created process (closes: Bug#483827) * Fixed SEGFAULT when killing ltrace with SIGINT or SIGTERM (closes: #458923) -- Juan Cespedes Thu, 21 May 2009 19:16:22 +0200 ltrace (0.5.1-2ubuntu1) jaunty; urgency=low [ Bhavani Shankar ] * Merge from debian unstable, remaining changes: LP: #313530 - Add lpia to architecture list. - Use libelf-dev instead of libelfg0-dev - Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in debian/rules CFLAGS. The configure script has a bug where it can't properly cope with the need to define these before detecting the use of elfutils. [ Colin Watson ] * Remove stray dpatch build-dependency. * Change libelfg0-dev to libelf-dev in debian/control.in as well as in debian/control. -- Bhavani Shankar Tue, 06 Jan 2009 17:46:28 +0000 ltrace (0.5.1-2) unstable; urgency=low * Red-added armel and armeb to debian/control (closes: Bug#463023) -- Juan Cespedes Tue, 16 Dec 2008 13:00:50 +0100 ltrace (0.5.1-1) unstable; urgency=low * New upstream release, fixing many bugs (thanks to Petr Machata, Luis Machado...) * Acknowledged NMU (Closes: Bug#463023) * Update Standards-Version (3.8.0), no changes -- Juan Cespedes Wed, 10 Dec 2008 18:41:20 +0100 ltrace (0.5-3.1ubuntu2) intrepid; urgency=low * Use libelf-dev instead of libelfg0-dev * Define _LARGEFILE_SOURCE and _LARGEFILE64_SOURCE in debian/rules CFLAGS. The configure script has a bug where it can't properly cope with the need to define these before detecting the use of elfutils. -- Ben Collins Wed, 02 Jul 2008 11:10:41 -0400 ltrace (0.5-3.1ubuntu1) intrepid; urgency=low * Merge from debian unstable, remaining changes: - Add lpia to architecture list. - Fix check for host_os in configure. -- Michael Vogt Tue, 27 May 2008 10:51:22 +0200 ltrace (0.5-3.1) unstable; urgency=low * Non-maintainer upload. * Big thanks for Anderson Lizardo for providing patches! * Add generic support for arm targets, Closes: #176413 * Save funtion arguments on arm, Closes: #462530 * Add thumb instruction support, Closes: #462531 * Add basic arm/eabi support, Closes: #450931 * fix exec() testcase cleanup, Closes: #462532 * fix memory corruption in clone() test, Closes: #462533 * fix tracing child with "-p" option, Closes: #462535 * Update standard, no changes -- Riku Voipio Tue, 29 Jan 2008 00:26:50 +0200 ltrace (0.5-3ubuntu1) hardy; urgency=low * Merge from debian unstable, remaining changes: - Add lpia to architecture list. - Set Ubuntu maintainer address. - Fix check for host_os in configure. -- Michael Vogt Thu, 15 Nov 2007 12:47:01 +0100 ltrace (0.5-3) unstable; urgency=low * Really fix compilation problems in ppc (!) -- Juan Cespedes Fri, 31 Aug 2007 19:04:03 +0200 ltrace (0.5-2) unstable; urgency=low * Fixed compilation issue in ppc -- Juan Cespedes Fri, 31 Aug 2007 13:53:27 +0200 ltrace (0.5-1) unstable; urgency=low * New upstream version * Remove some unneeded files in /usr/share/doc (ChangeLog, COPYING...) * Fix several typos (closes: Bug#372928) * Added more system calls to ltrace.conf -- Juan Cespedes Thu, 30 Aug 2007 14:54:44 +0200 ltrace (0.4-2) unstable; urgency=low * Use fclose() to close the output file when using option '-o' (thanks to GuiJianfeng ) -- Juan Cespedes Tue, 07 Aug 2007 11:49:27 +0200 ltrace (0.4-1ubuntu2) gutsy; urgency=low * Fix check for host_os in configure. -- Matthias Klose Tue, 31 Jul 2007 08:13:07 +0000 ltrace (0.4-1ubuntu1) gutsy; urgency=low * Add lpia to architecture list. * Set Ubuntu maintainer address. -- Matthias Klose Mon, 30 Jul 2007 23:56:37 +0200 ltrace (0.4-1) unstable; urgency=low * Rebase code from Redhat patches, now everything lives in SVN * Closes: #297483,#315889,#318009 -- add PowerPC64 support * Add s390x, ppc64 support * This removes the patch from #257903 as it seems unnecessary now. -- Ian Wienand Tue, 21 Feb 2006 09:23:09 +1100 ltrace (0.3.38-1) unstable; urgency=low * Closes: 306862 -- Add IA64 support -- Ian Wienand Fri, 17 Feb 2006 11:17:46 +1100 ltrace (0.3.37-2) unstable; urgency=low * Convert to use CDBS * Use CDBS to build control; you need to run DEB_AUTO_UPDATE_DEBIAN_CONROL=yes ./debian/rules clean to make the control file if you checkout from CVS * Remove autoconf from build-deps, fix up upstream dist target so we don't need it. -- Ian Wienand Thu, 16 Feb 2006 22:56:14 +1100 ltrace (0.3.37-1) unstable; urgency=low [ Ian Wienand ] * Non-maintainer upload * Start a "friendly takeover" from Juan * Closes: #127503,#280608 -- update man page typos * Closes: #339348 -- fix putenv typo in ltrace.conf * Closes: #257903 -- incorporate variable length args patch * Closes: #282051 -- demange names when -c used with -C * Closes: #352389 -- pass build flags through to Makefile * Closes: #155571 -- add note in man page about dlopened libraries * See "upstream" ChangeLog for other changes (mostly warning fixes) * Update README to point to Alioth home: http://ltrace.alioth.debian.org [ Christoph Berg ] * Create non-native package. * Add autoconf to build-deps -- Ian Wienand Thu, 16 Feb 2006 11:51:32 +1100 ltrace (0.3.36-2) unstable; urgency=low * Corrected path for Debian changelog -- Juan Cespedes Wed, 10 Nov 2004 00:33:21 +0100 ltrace (0.3.36-1) unstable; urgency=low * Changed distribution to pristine source * New Standards-Version (3.6.1) * Fixed "--indent" option (closes: Bug#265185) -- Juan Cespedes Wed, 10 Nov 2004 00:14:19 +0100 ltrace (0.3.35.1) unstable; urgency=low * Non-maintainer upload * Applied patch from Jakub Jelinek to fix problems with binaries built with recent binutils (closes: #274955) * Applied patch from Jakub Jelinek to add long/ulong types to ltrace.conf for amd64 * Applied patch from Jakub Jelinek to fix -C * Applied patch from Jakub Jelinek to update syscallent.h * debian/control: build-depend on dpatch and libelfg0-dev * debian/rules: add dpatch support * debian/changelog: convert to utf-8 -- Andrew Pollock Fri, 22 Oct 2004 21:43:16 +1000 ltrace (0.3.35) unstable; urgency=low * Fixed include line in m68k, caused build problems -- Juan Cespedes Fri, 16 Jul 2004 18:00:10 +0200 ltrace (0.3.34) unstable; urgency=low * Fixed prototype declaration problem in arm, m68k, powerpc, s390 * Added "amd64" to list of architectures (closes: Bug#252756) * Sparc port is hopefully working (closes: Bug#35524) -- Juan Cespedes Wed, 07 Jul 2004 10:40:56 +0200 ltrace (0.3.33) unstable; urgency=low * Fixed two bugs, thanks to Mauro Meneghin : + Cope correctly with breakpoint values greater than sizeof(long) bytes + Fixed small bug in option -r (closes: Bug#212792) * Show help if no (or few) arguments are given, just like strace and fenris (thanks, Tomasz Wegrzanowski ) * Some fixes from Jakub Bogusz : + Small 64-bit cleanup of code + support for more than 6 function arguments on amd64 + Adapted SPARC port from Jakub Jelinek + Added alpha support -- Juan Cespedes Mon, 14 Jun 2004 18:01:12 +0200 ltrace (0.3.32) unstable; urgency=low * Fixed wrong version number * Removed unused file "opt_c.c" * Remove error when tracing no calls and doing fork() * Clean-up of sysdeps/linux-gnu/s390/trace.c * Clean-up of sysdeps/linux-gnu/ppc/trace.c * Make `--library' option really work (closes: Bug#232321) * Merged several patches from SuSE: + Added some functions to ltrace.conf + Handle 64-big ELF files nicely + AMD64 support + Updated list of syscalls for S/390 + Improved some debugging statements Many thanks to Bernhard Kaindl for his great work -- Juan Cespedes Sun, 04 Apr 2004 01:31:37 +0200 ltrace (0.3.31) unstable; urgency=low * Added a lot of functions to ltrace.conf, thanks to Jakub Jelinek (closes: Bug#144518) * Fixed off-by-one problem in checking syscall number * Removed some warnings -- Juan Cespedes Tue, 04 Feb 2003 23:22:46 +0100 ltrace (0.3.30) unstable; urgency=low * Implemented -T option (show time spent inside each call) * Alphabetically sort options in help and manual page * Added -c option (summary of calls on program exit) -- Juan Cespedes Mon, 03 Feb 2003 00:22:28 +0100 ltrace (0.3.29) unstable; urgency=low * Align return values depending on screen width * Updated list of syscalls and signals to Linux 2.4.20 * Fixed bug introduced in 0.3.27 which caused -L option to segfault -- Juan Cespedes Sat, 01 Feb 2003 19:01:39 +0100 ltrace (0.3.28) unstable; urgency=medium * Fixed memory corruption when using execve() in a traced program (closes: Bug#160341, Bug#165626) -- Juan Cespedes Fri, 31 Jan 2003 19:51:28 +0100 ltrace (0.3.27) unstable; urgency=low * Removed dependency on libdl (it is no longer needed) * Wrote generic dictionary, used in demangle.c and breakpoints.c * Added debug.c for better debugging output -- Juan Cespedes Fri, 31 Jan 2003 18:58:55 +0100 ltrace (0.3.26) unstable; urgency=low * Fixed `ltrace -L' in powerpc -- Juan Cespedes Sun, 31 Mar 2002 20:53:49 +0200 ltrace (0.3.25) unstable; urgency=low * Finally added powerpc support (Anton Blanchard ) -- Juan Cespedes Sun, 31 Mar 2002 19:58:25 +0200 ltrace (0.3.24) unstable; urgency=low * Fixed 2 minor buffer overflows (closes: Bug#130746) * Obey --prefix, --sysconfdir, --mandir options in configure * Adding powerpc support (doesn't work yet) (Anton Blanchard ) -- Juan Cespedes Wed, 27 Mar 2002 00:20:57 +0100 ltrace (0.3.23) unstable; urgency=low * Fixed missing include in trace.c * One arch-dependent function less (continue_after_breakpoint) * Fixed S/390 port (it didn't compile yet...) -- Juan Cespedes Sun, 3 Mar 2002 18:58:36 +0100 ltrace (0.3.22) unstable; urgency=low * S/390: Removed extra target in sysdeps/linux-gnu/s390 which avoided compiling... -- Juan Cespedes Sun, 3 Mar 2002 14:04:38 +0100 ltrace (0.3.21) unstable; urgency=low * Get rid of arch/breakpoint.c; we can do it arch-independent -- Juan Cespedes Sun, 3 Mar 2002 02:37:46 +0100 ltrace (0.3.20) unstable; urgency=low * Added s390 port (Timothy R. Fesig ) * Modified configure process to use ltrace.spec.in to generate ltrace.spec (Timothy R. Fesig ) * Fixed some problems using ltrace.spec on Intel platform. (Timothy R. Fesig ) -- Juan Cespedes Sat, 2 Mar 2002 23:33:00 +0100 ltrace (0.3.19) unstable; urgency=low * Fixed small bug: "" lines were sometimes incorrectly displayed * Added new functions to /etc/ltrace.conf (thanks to James R. Van Zandt ) (closes: Bug#91349) -- Juan Cespedes Fri, 1 Mar 2002 21:05:37 +0100 ltrace (0.3.18) unstable; urgency=low * Simplified arch-dependent stuff * Updated list of syscalls and signals to Linux 2.4.18 * Unified coding-style of all function declarations * Do not indent lines indicating signals, exit codes, etc * Updated description * fix off-by-one problem in checking syscall number (Tim Waugh fixed this problem in RedHat two years ago; thank you for NOT noticing me...) -- Juan Cespedes Fri, 1 Mar 2002 19:52:43 +0100 ltrace (0.3.17) unstable; urgency=low * Added a bit more debugging * Fixed display of return address in nested functions * Added posibility to exit from a function different from the last called one (this fixes "ltrace gnome-terminal", for example) -- Juan Cespedes Mon, 25 Feb 2002 00:19:19 +0100 ltrace (0.3.16) unstable; urgency=low * ltrace works again after an execve is received (closes: Bug#108835) * Added prototypes for fnmatch() and bsearch() (closes: Bug#106862) * Re-wrote short description so it does not exceed 60 chars (closes: Bug#114682) -- Juan Cespedes Mon, 10 Dec 2001 04:11:26 +0100 ltrace (0.3.15) unstable; urgency=low * Fixed `-n' option so that it displays correct output even when tracing several processes -- Juan Cespedes Mon, 9 Jul 2001 01:02:46 +0200 ltrace (0.3.14) unstable; urgency=low * Assume a syscall is always immediatly followed by a sysret in i386 (fixes bug which prevented ltrace to work properly in any program using signals); I will have to rethink all this and fix it correctly or port it to non-i386 archs * Fixed -n option: now it is done in output.c (this still has problems when tracing more than one process at a time) -- Juan Cespedes Sat, 7 Jul 2001 20:56:42 +0200 ltrace (0.3.13) unstable; urgency=low * Fixed "ltrace -i", broken since version 0.3.11 -- Juan Cespedes Tue, 3 Jul 2001 18:36:15 +0200 ltrace (0.3.12) unstable; urgency=low * Re-wrote of "elf.c" (Silvio Cesare ) * Added "--library" option (Silvio) * Updated list of syscalls and signals to Linux 2.4.5 * Compile cleanly with gcc-3.0 (thanks to Frédéric L. W. Meunier) -- Juan Cespedes Tue, 3 Jul 2001 00:43:25 +0200 ltrace (0.3.11) unstable; urgency=low * Clean up lintian bugs * Fixed small bug reading start of arguments in config file * Keep a stack of nested calls (Morten Eriksen, 1999-07-04) * Add "--indent" option (Morten Eriksen, 1999-07-04) * cleans up connection between a breakpoint address and a call instance (Morten Eriksen, 1999-07-04) * New Standards-Version (3.5.5) -- Juan Cespedes Mon, 2 Jul 2001 00:24:11 +0200 ltrace (0.3.10) unstable; urgency=low * Added C++ demangle (again) * Added correct Build-Depends -- Juan Cespedes Thu, 23 Dec 1999 00:22:33 +0100 ltrace (0.3.9) unstable; urgency=low * New Standards-Version (3.1.1) * Fixed Lintian bugs -- Juan Cespedes Sun, 19 Dec 1999 17:49:40 +0100 ltrace (0.3.8) unstable; urgency=low * glibc-2.1 does no longer need `_GNU_SOURCE' defined to use * Changed description of package; adopted Red Hat's one (thanks to whoever wrote it) * Close all the file descriptors used before executing program (close-on-exec) * Updated copyright file for new location /usr/share/common-licenses/GPL. * Used GNU autoconf instead of "uname" to guess host system type * Install man page in /usr/share/man instead of /usr/man * Added a few functions to /etc/ltrace.conf * Updated list of syscalls and signals to linux-2.2.12 * Fixed bugs in C++ demangle (Morten Eriksen ) * New Standards-Version: 3.0.1 (but keeping docs in /usr/doc) -- Juan Cespedes Mon, 30 Aug 1999 19:34:47 +0200 ltrace (0.3.7) unstable; urgency=low * Minor fixes * Added minor patch from Alex Buell to be able to compile under glibc 2.1 * Additions to config file from David Dyck * Clean-up Makefile a bit * Changed `LT_PT_*' with `ARGTYPE_*' * Display '\\' instead of '\' * Updated list of syscalls and signals to linux-2.2.5 * Compiled against glibc-2.1 -- Juan Cespedes Sat, 3 Apr 1999 03:21:50 +0200 ltrace (0.3.6) unstable; urgency=low * Added m68k port (Roman Hodek ) (Bug#27075) * Changed "int pid" with "pid_t pid" everywhere * Fixed return type of some functions from "int" to "void *" (thanks, Roman) -- Juan Cespedes Fri, 25 Sep 1998 14:48:37 +0200 ltrace (0.3.5) unstable; urgency=low * Added ARMLinux port (Pat Beirne ) (Bug#27040) * Fixed minor things in options.c -- Juan Cespedes Thu, 24 Sep 1998 13:18:01 +0200 ltrace (0.3.4) unstable; urgency=low * Added "ltrace.spec" to build a .rpm binary file. * Added "-r" option -- Juan Cespedes Sun, 20 Sep 1998 21:22:05 +0200 ltrace (0.3.3) unstable; urgency=low * Fixed a little bug in display_string * A few more functions added to /etc/ltrace.conf -- Juan Cespedes Sun, 6 Sep 1998 14:03:10 +0200 ltrace (0.3.2) unstable; urgency=low * Make the output line-buffered (Bug#22874) * New Standards-Version (2.4.1) * Make it compile cleanly with glibc 2.0.7 -- Juan Cespedes Tue, 14 Jul 1998 13:45:24 +0200 ltrace (0.3.1) frozen unstable; urgency=low * setgid programs had their uid and gid swapped! Fixed. -- Juan Cespedes Wed, 29 Apr 1998 19:25:11 +0200 ltrace (0.3.0) unstable; urgency=low * Preliminary autoconf support * Switched to getopt() * New option: -C (demangle C++ names) * New options: --help, --version * Display "format" (printf-like) argument types * Updated manual page * New option: -e -- Juan Cespedes Sat, 25 Apr 1998 14:21:59 +0200 ltrace (0.2.9) frozen unstable; urgency=low * Bug#20616 wasn't completely fixed; it didn't work with some programs (Fixed) * Stopping ltrace with ^C DIDN'T WORK if -p option is not used!! (Fixed) * Option -f caused program to segfault; fixed * Fixed nasty bug about executing set[ug]id binaries: When executing a program fails, don't left the program STOPPED. * Make ltrace work with all setuid and setgid binaries when invoked as root -- Juan Cespedes Sat, 11 Apr 1998 22:50:38 +0200 ltrace (0.2.8) frozen unstable; urgency=low * Fix important bug regarding -p: disable all breakpoints on exit (Bug#20616) * Compile cleanly on libc5 * Added `-t' option (Bug#20615) -- Juan Cespedes Sat, 4 Apr 1998 08:34:03 +0200 ltrace (0.2.7) unstable; urgency=low * Some minor fixes -- Juan Cespedes Sun, 15 Mar 1998 14:01:40 +0100 ltrace (0.2.6) unstable; urgency=low * Option `-f' now works (but it fails to attach some processes...) * Output is now more similar to strace's -- Juan Cespedes Sat, 14 Mar 1998 20:50:16 +0100 ltrace (0.2.5) unstable; urgency=low * After a successful execve(), library calls are now logged * Enhanced displaying of non-printable chars * Added some functions to /etc/ltrace.conf -- Juan Cespedes Fri, 13 Mar 1998 19:16:47 +0100 ltrace (0.2.4) unstable; urgency=low * Option `-p' now works (but programs fail when ltrace is interrupted) -- Juan Cespedes Fri, 13 Mar 1998 00:29:10 +0100 ltrace (0.2.3) unstable; urgency=low * Don't display `...' in strings when limit of bytes is reached * Added some functions to /etc/ltrace.conf -- Juan Cespedes Wed, 11 Mar 1998 23:33:14 +0100 ltrace (0.2.2) unstable; urgency=low * After a successful execve(), syscalls are now logged correctly -- Juan Cespedes Wed, 11 Mar 1998 00:02:35 +0100 ltrace (0.2.1) unstable; urgency=low * Added -u option (run command as other username) * Updated manual page a bit -- Juan Cespedes Tue, 10 Mar 1998 00:08:38 +0100 ltrace (0.2.0) unstable; urgency=low * First `unstable' release * Complete re-structured all the code to be able to add support for different architectures (but only i386 arch is supported in this version) * Log also return values * Log arguments (and return values) for syscalls * Added preliminary support for various simultaneous processes * getopt-like options * New option: -a (alignment column) * New option: -L (don't display library calls) * New option: -s (maximum # of chars in strings) * Now it reads config files with function names and parameter types * Programs using clone() should work ok now * debian/rules: gzipped only big files in /usr/doc/ltrace * New Standards-Version: 2.4.0.0 * beginning to work on sparc port (not yet done) -- Juan Cespedes Sun, 8 Mar 1998 22:27:30 +0100 ltrace (0.1.7) experimental; urgency=low * Internal release. * New Standards-Version (2.3.0.1) * Clean up structures a bit * Trying to log return values... -- Juan Cespedes Sun, 26 Oct 1997 19:53:20 +0100 ltrace (0.1.6) experimental; urgency=low * New maintainer address * New Standards-Version -- Juan Cespedes Thu, 11 Sep 1997 23:22:32 +0200 ltrace (0.1.5) experimental; urgency=low * `command' is now searched in the PATH -- Juan Cespedes Wed, 27 Aug 1997 22:27:33 +0200 ltrace (0.1.4) experimental; urgency=low * Updated execute_process() * No longer uses signals to wait for children. Should be a little faster. * Now every function uses output.c:send_*() instead of `FILE * output' -- Juan Cespedes Mon, 25 Aug 1997 16:08:36 +0200 ltrace (0.1.3) experimental; urgency=low * Added options `-i', `-S' * Added syscall names * Added signal names * Added `output.c', `signal.c' -- Juan Cespedes Sun, 24 Aug 1997 01:45:49 +0200 ltrace (0.1.2) experimental; urgency=low * Updated ``TODO'' * Added process.c:execute_process * Added i386.c:type_of_stop * Hopefully, system dependent stuff is now only in i386.[ch] and process.[ch] * `-d' can now be used many times: many levels of debug * removed breakpoint for children detecting fork()s. Now, *every* program should work ok * struct process now also has a field for the process filename * Added "syscall.c" with a list of system call names in Linux/i386 -- Juan Cespedes Sat, 23 Aug 1997 15:00:23 +0200 ltrace (0.1.1) experimental; urgency=low * Added ``TODO'' * Added symbols.c:disable_all_breakpoints * Added ``process.[ch]'': init_sighandler, pid2proc * Removed ``trace.c'' * Added rudimentary support for multiple processes * Now tracing syscalls (fork() needs a special treatment (TODO)) * Added process.c:detach_process * Added i386.c:trace_me,untrace_pid -- Juan Cespedes Sat, 23 Aug 1997 02:09:14 +0200 ltrace (0.1.0) experimental; urgency=low * Some clean-ups * Added simple manual page -- Juan Cespedes Thu, 21 Aug 1997 17:01:36 +0200 ltrace (0.0.1997.08.14) experimental; urgency=low * Still re-structuring code... new file: symbols.c -- Juan Cespedes Thu, 14 Aug 1997 22:22:43 +0200 ltrace (0.0.1997.08.09) experimental; urgency=low * Added Debian files * Re-structured most of the code; new files: elf.c, i386.c, trace.c -- Juan Cespedes Sat, 9 Aug 1997 20:55:24 +0200 debian/source/0000775000000000000000000000000012261307366010476 5ustar debian/source/format0000664000000000000000000000001412260014606011673 0ustar 3.0 (quilt) debian/compat0000664000000000000000000000000212047446004010367 0ustar 5 debian/patches/0000775000000000000000000000000012332504242010614 5ustar debian/patches/Add-missing-include-stdio.h.patch0000664000000000000000000000217312312577754017006 0ustar Author: dann frazier Description: Add missing #include stdio.h Include stdio.h in files that use fprintf() Applied-Upstream: http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=commitdiff;h=3c4a0de0be06377caf43a5f9e1682b05ef7299f9 Last-Update: 2014-03-17 Index: ltrace/sysdeps/linux-gnu/aarch64/regs.c =================================================================== --- ltrace.orig/sysdeps/linux-gnu/aarch64/regs.c 2014-03-12 16:23:25.382866486 -0600 +++ ltrace/sysdeps/linux-gnu/aarch64/regs.c 2014-03-12 16:26:20.989198876 -0600 @@ -23,6 +23,7 @@ #include #include #include +#include #include "backend.h" #include "proc.h" Index: ltrace/sysdeps/linux-gnu/aarch64/trace.c =================================================================== --- ltrace.orig/sysdeps/linux-gnu/aarch64/trace.c 2014-03-12 16:23:25.382866486 -0600 +++ ltrace/sysdeps/linux-gnu/aarch64/trace.c 2014-03-12 16:26:20.989198876 -0600 @@ -23,6 +23,7 @@ #include #include #include +#include #include #include "backend.h" debian/patches/06-unexpected-breakpoint0000664000000000000000000000133312261531302015260 0ustar From: Juan Cespedes Description: continue after unexpected breakpoint (instead of decrementing PC and execute int3 again and again) Last-Update: 2014-01-03 --- ltrace-0.7.3.orig/handle_event.c +++ ltrace-0.7.3/handle_event.c @@ -656,9 +656,12 @@ handle_breakpoint(Event *event) if ((sbp = address2bpstruct(leader, brk_addr)) != NULL) breakpoint_on_hit(sbp, event->proc); - else if (event->proc->state != STATE_IGNORED) + else if (event->proc->state != STATE_IGNORED) { output_line(event->proc, "unexpected breakpoint at %p", brk_addr); + continue_process(event->proc->pid); + return; + } /* breakpoint_on_hit may delete its own breakpoint, so we have * to look it up again. */ debian/patches/05-sparc-ftbfs0000664000000000000000000000124512261476744013215 0ustar From: Juan Cespedes Description: fixes compilation on sparc Last-Update: 2014-01-02 --- ltrace-0.7.3.orig/sysdeps/linux-gnu/sparc/plt.c +++ ltrace-0.7.3/sysdeps/linux-gnu/sparc/plt.c @@ -19,8 +19,9 @@ */ #include + #include "proc.h" -#include "common.h" +#include "library.h" GElf_Addr arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela * rela) { --- ltrace-0.7.3.orig/sysdeps/linux-gnu/sparc/trace.c +++ ltrace-0.7.3/sysdeps/linux-gnu/sparc/trace.c @@ -26,8 +26,10 @@ #include #include #include + #include "ptrace.h" #include "proc.h" +#include "backend.h" #include "common.h" void debian/patches/Implement-aarch64-support.patch0000664000000000000000000022506512312577754016561 0ustar Author: Petr Machata Description: Set child stack alignment in trace-clone.c This is important on aarch64, which requires 16-byte aligned stack pointer. This might be relevant on other arches as well, I suspect we just happened to get the 16-byte boundary in some cases. Applied-Upstream: http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=commit;h=912a0f75b3521803fa724a55f0e883c134c7b4e9 Last-Update: 2014-03-13 Index: ltrace/configure.ac =================================================================== --- ltrace.orig/configure.ac 2014-03-12 16:20:44.020676662 -0600 +++ ltrace/configure.ac 2014-03-12 16:20:44.012676553 -0600 @@ -1,6 +1,6 @@ # -*- Autoconf -*- # This file is part of ltrace. -# Copyright (C) 2010,2013 Petr Machata, Red Hat Inc. +# Copyright (C) 2010,2013,2014 Petr Machata, Red Hat Inc. # Copyright (C) 2010,2011 Joe Damato # Copyright (C) 2010 Marc Kleine-Budde # Copyright (C) 2010 Zachary T Welch @@ -319,6 +319,7 @@ Makefile sysdeps/Makefile sysdeps/linux-gnu/Makefile + sysdeps/linux-gnu/aarch64/Makefile sysdeps/linux-gnu/alpha/Makefile sysdeps/linux-gnu/arm/Makefile sysdeps/linux-gnu/cris/Makefile Index: ltrace/sysdeps/linux-gnu/Makefile.am =================================================================== --- ltrace.orig/sysdeps/linux-gnu/Makefile.am 2014-03-12 16:20:44.020676662 -0600 +++ ltrace/sysdeps/linux-gnu/Makefile.am 2014-03-12 16:20:44.016676607 -0600 @@ -1,4 +1,5 @@ # This file is part of ltrace. +# Copyright (C) 2014 Petr Machata, Red Hat, Inc. # Copyright (C) 2010,2012 Marc Kleine-Budde, Pengutronix # # This program is free software; you can redistribute it and/or @@ -16,7 +17,7 @@ # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA # 02110-1301 USA -DIST_SUBDIRS = alpha arm cris ia64 m68k mips ppc s390 sparc x86 +DIST_SUBDIRS = aarch64 alpha arm cris ia64 m68k mips ppc s390 sparc x86 SUBDIRS = \ $(HOST_CPU) Index: ltrace/sysdeps/linux-gnu/aarch64/Makefile.am =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/Makefile.am 2014-03-12 16:20:44.016676607 -0600 @@ -0,0 +1,25 @@ +# This file is part of ltrace. +# Copyright (C) 2014 Petr Machata, Red Hat, Inc. +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License as +# published by the Free Software Foundation; either version 2 of the +# License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA +# 02110-1301 USA + +noinst_LTLIBRARIES = ../libcpu.la + +___libcpu_la_SOURCES = fetch.c plt.c regs.c trace.c + +noinst_HEADERS = arch.h ptrace.h signalent.h syscallent.h + +MAINTAINERCLEANFILES = Makefile.in Index: ltrace/sysdeps/linux-gnu/aarch64/arch.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/arch.h 2014-03-12 16:20:44.016676607 -0600 @@ -0,0 +1,37 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ +#ifndef LTRACE_AARCH64_ARCH_H +#define LTRACE_AARCH64_ARCH_H + +/* | 31 21 | 20 5 | 4 0 | * + * | 1 1 0 1 0 1 0 0 0 0 1 | imm16 | 0 0 0 0 0 | */ +#define BREAKPOINT_VALUE { 0xd4, 0x20, 0, 0 } +#define BREAKPOINT_LENGTH 4 +#define DECR_PC_AFTER_BREAK 0 + +#define LT_ELFCLASS ELFCLASS64 +#define LT_ELF_MACHINE EM_AARCH64 + +#define ARCH_HAVE_FETCH_ARG +#define ARCH_ENDIAN_BIG +#define ARCH_HAVE_SIZEOF +#define ARCH_HAVE_ALIGNOF + +#endif /* LTRACE_AARCH64_ARCH_H */ Index: ltrace/sysdeps/linux-gnu/aarch64/fetch.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/fetch.c 2014-03-12 16:23:25.382866486 -0600 @@ -0,0 +1,365 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include +#include +#include +#include + +#include "fetch.h" +#include "proc.h" +#include "type.h" +#include "value.h" + +int aarch64_read_gregs(struct Process *proc, struct user_pt_regs *regs); +int aarch64_read_fregs(struct Process *proc, struct user_fpsimd_state *regs); + + +struct fetch_context +{ + struct user_pt_regs gregs; + struct user_fpsimd_state fpregs; + arch_addr_t nsaa; + unsigned ngrn; + unsigned nsrn; + arch_addr_t x8; +}; + +static int +context_init(struct fetch_context *context, struct Process *proc) +{ + if (aarch64_read_gregs(proc, &context->gregs) < 0 + || aarch64_read_fregs(proc, &context->fpregs) < 0) + return -1; + + context->ngrn = 0; + context->nsrn = 0; + /* XXX double cast */ + context->nsaa = (arch_addr_t) (uintptr_t) context->gregs.sp; + context->x8 = 0; + + return 0; +} + +struct fetch_context * +arch_fetch_arg_clone(struct Process *proc, struct fetch_context *context) +{ + struct fetch_context *ret = malloc(sizeof(*ret)); + if (ret == NULL) + return NULL; + return memcpy(ret, context, sizeof(*ret)); +} + +static void +fetch_next_gpr(struct fetch_context *context, unsigned char *buf) +{ + uint64_t u = context->gregs.regs[context->ngrn++]; + memcpy(buf, &u, 8); +} + +static int +fetch_gpr(struct fetch_context *context, struct value *value, size_t sz) +{ + if (sz < 8) + sz = 8; + + unsigned char *buf = value_reserve(value, sz); + if (buf == NULL) + return -1; + + size_t i; + for (i = 0; i < sz; i += 8) + fetch_next_gpr(context, buf + i); + + return 0; +} + +static void +fetch_next_sse(struct fetch_context *context, unsigned char *buf, size_t sz) +{ + __int128 u = context->fpregs.vregs[context->nsrn++]; + memcpy(buf, &u, sz); +} + +static int +fetch_sse(struct fetch_context *context, struct value *value, size_t sz) +{ + unsigned char *buf = value_reserve(value, sz); + if (buf == NULL) + return -1; + + fetch_next_sse(context, buf, sz); + return 0; +} + +static int +fetch_hfa(struct fetch_context *context, + struct value *value, struct arg_type_info *hfa_t, size_t count) +{ + size_t sz = type_sizeof(value->inferior, hfa_t); + unsigned char *buf = value_reserve(value, sz * count); + if (buf == NULL) + return -1; + + size_t i; + for (i = 0; i < count; ++i) { + fetch_next_sse(context, buf, sz); + buf += sz; + } + return 0; +} + +static int +fetch_stack(struct fetch_context *context, struct value *value, + size_t align, size_t sz) +{ + if (align < 8) + align = 8; + size_t amount = ((sz + align - 1) / align) * align; + + /* XXX double casts */ + uintptr_t sp = (uintptr_t) context->nsaa; + sp = ((sp + align - 1) / align) * align; + + value_in_inferior(value, (arch_addr_t) sp); + + sp += amount; + context->nsaa = (arch_addr_t) sp; + + return 0; +} + +enum convert_method { + CVT_ERR = -1, + CVT_NOP = 0, + CVT_BYREF, +}; + +enum fetch_method { + FETCH_NOP, + FETCH_STACK, + FETCH_GPR, + FETCH_SSE, + FETCH_HFA, +}; + +struct fetch_script { + enum convert_method c; + enum fetch_method f; + size_t sz; + struct arg_type_info *hfa_t; + size_t count; +}; + +static struct fetch_script +pass_arg(struct fetch_context const *context, + struct Process *proc, struct arg_type_info *info) +{ + enum fetch_method cvt = CVT_NOP; + + size_t sz = type_sizeof(proc, info); + if (sz == (size_t) -1) + return (struct fetch_script) { CVT_ERR, FETCH_NOP, sz }; + + switch (info->type) { + case ARGTYPE_VOID: + return (struct fetch_script) { cvt, FETCH_NOP, sz }; + + case ARGTYPE_STRUCT: + case ARGTYPE_ARRAY:; + size_t count; + struct arg_type_info *hfa_t = type_get_hfa_type(info, &count); + if (hfa_t != NULL && count <= 4) { + if (context->nsrn + count <= 8) + return (struct fetch_script) + { cvt, FETCH_HFA, sz, hfa_t, count }; + return (struct fetch_script) + { cvt, FETCH_STACK, sz, hfa_t, count }; + } + + if (sz <= 16) { + size_t count = sz / 8; + if (context->ngrn + count <= 8) + return (struct fetch_script) + { cvt, FETCH_GPR, sz }; + } + + cvt = CVT_BYREF; + sz = 8; + /* Fall through. */ + + case ARGTYPE_POINTER: + case ARGTYPE_INT: + case ARGTYPE_UINT: + case ARGTYPE_LONG: + case ARGTYPE_ULONG: + case ARGTYPE_CHAR: + case ARGTYPE_SHORT: + case ARGTYPE_USHORT: + if (context->ngrn < 8 && sz <= 8) + return (struct fetch_script) { cvt, FETCH_GPR, sz }; + /* We don't support types wider than 8 bytes as of + * now. */ + assert(sz <= 8); + + return (struct fetch_script) { cvt, FETCH_STACK, sz }; + + case ARGTYPE_FLOAT: + case ARGTYPE_DOUBLE: + if (context->nsrn < 8) { + /* ltrace doesn't support float128. */ + assert(sz <= 8); + return (struct fetch_script) { cvt, FETCH_SSE, sz }; + } + + return (struct fetch_script) { cvt, FETCH_STACK, sz }; + } + + assert(! "Failed to allocate argument."); + abort(); +} + +static int +convert_arg(struct value *value, struct fetch_script how) +{ + switch (how.c) { + case CVT_NOP: + return 0; + case CVT_BYREF: + return value_pass_by_reference(value); + case CVT_ERR: + return -1; + } + + assert(! "Don't know how to convert argument."); + abort(); +} + +static int +fetch_arg(struct fetch_context *context, + struct Process *proc, struct arg_type_info *info, + struct value *value, struct fetch_script how) +{ + if (convert_arg(value, how) < 0) + return -1; + + switch (how.f) { + case FETCH_NOP: + return 0; + + case FETCH_STACK: + if (how.hfa_t != NULL && how.count != 0 && how.count <= 8) + context->nsrn = 8; + return fetch_stack(context, value, + type_alignof(proc, info), how.sz); + + case FETCH_GPR: + return fetch_gpr(context, value, how.sz); + + case FETCH_SSE: + return fetch_sse(context, value, how.sz); + + case FETCH_HFA: + return fetch_hfa(context, value, how.hfa_t, how.count); + } + + assert(! "Don't know how to fetch argument."); + abort(); +} + +struct fetch_context * +arch_fetch_arg_init(enum tof type, struct Process *proc, + struct arg_type_info *ret_info) +{ + struct fetch_context *context = malloc(sizeof *context); + if (context == NULL || context_init(context, proc) < 0) { + fail: + free(context); + return NULL; + } + + /* There's a provision in ARMv8 parameter passing convention + * for returning types that, if passed as first argument to a + * function, would be passed on stack. For those types, x8 + * contains an address where the return argument should be + * placed. The callee doesn't need to preserve the value of + * x8, so we need to fetch it now. + * + * To my knowledge, there are currently no types where this + * holds, but the code is here, utterly untested. */ + + struct fetch_script how = pass_arg(context, proc, ret_info); + if (how.c == CVT_ERR) + goto fail; + if (how.c == CVT_NOP && how.f == FETCH_STACK) { + /* XXX double cast. */ + context->x8 = (arch_addr_t) (uintptr_t) context->gregs.regs[8]; + /* See the comment above about the assert. */ + assert(! "Unexpected: first argument passed on stack."); + abort(); + } + + return context; +} + +int +arch_fetch_arg_next(struct fetch_context *context, enum tof type, + struct Process *proc, struct arg_type_info *info, + struct value *value) +{ + return fetch_arg(context, proc, info, value, + pass_arg(context, proc, info)); +} + +int +arch_fetch_retval(struct fetch_context *context, enum tof type, + struct Process *proc, struct arg_type_info *info, + struct value *value) +{ + if (context->x8 != 0) { + value_in_inferior(value, context->x8); + return 0; + } + + if (context_init(context, proc) < 0) + return -1; + + return fetch_arg(context, proc, info, value, + pass_arg(context, proc, info)); +} + +void +arch_fetch_arg_done(struct fetch_context *context) +{ + if (context != NULL) + free(context); +} + +size_t +arch_type_sizeof(struct Process *proc, struct arg_type_info *arg) +{ + return (size_t) -2; +} + +size_t +arch_type_alignof(struct Process *proc, struct arg_type_info *arg) +{ + return (size_t) -2; +} Index: ltrace/sysdeps/linux-gnu/aarch64/plt.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/plt.c 2014-03-12 16:23:25.382866486 -0600 @@ -0,0 +1,38 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include + +#include "backend.h" +#include "proc.h" +#include "library.h" +#include "ltrace-elf.h" + +arch_addr_t +sym2addr(struct Process *proc, struct library_symbol *sym) +{ + return sym->enter_addr; +} + +GElf_Addr +arch_plt_sym_val(struct ltelf *lte, size_t ndx, GElf_Rela *rela) +{ + return lte->plt_addr + 32 + ndx * 16; +} Index: ltrace/sysdeps/linux-gnu/aarch64/ptrace.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/ptrace.h 2014-03-12 16:20:44.016676607 -0600 @@ -0,0 +1,22 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include +#include Index: ltrace/sysdeps/linux-gnu/aarch64/regs.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/regs.c 2014-03-12 16:23:25.382866486 -0600 @@ -0,0 +1,130 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include +#include +#include +#include +#include + +#include "backend.h" +#include "proc.h" + +#define PC_OFF (32 * 4) + +int +aarch64_read_gregs(struct Process *proc, struct user_pt_regs *regs) +{ + *regs = (struct user_pt_regs) {}; + struct iovec iovec; + iovec.iov_base = regs; + iovec.iov_len = sizeof *regs; + return ptrace(PTRACE_GETREGSET, proc->pid, NT_PRSTATUS, &iovec) < 0 + ? -1 : 0; +} + +int +aarch64_write_gregs(struct Process *proc, struct user_pt_regs *regs) +{ + struct iovec iovec; + iovec.iov_base = regs; + iovec.iov_len = sizeof *regs; + return ptrace(PTRACE_SETREGSET, proc->pid, NT_PRSTATUS, &iovec) < 0 + ? -1 : 0; +} + +int +aarch64_read_fregs(struct Process *proc, struct user_fpsimd_state *regs) +{ + *regs = (struct user_fpsimd_state) {}; + struct iovec iovec; + iovec.iov_base = regs; + iovec.iov_len = sizeof *regs; + return ptrace(PTRACE_GETREGSET, proc->pid, NT_FPREGSET, &iovec) < 0 + ? -1 : 0; +} + +arch_addr_t +get_instruction_pointer(struct Process *proc) +{ + struct user_pt_regs regs; + if (aarch64_read_gregs(proc, ®s) < 0) { + fprintf(stderr, "get_instruction_pointer: " + "Couldn't read registers of %d.\n", proc->pid); + return 0; + } + + /* + char buf[128]; + sprintf(buf, "cat /proc/%d/maps", proc->pid); + system(buf); + */ + + /* XXX double cast */ + return (arch_addr_t) (uintptr_t) regs.pc; +} + +void +set_instruction_pointer(struct Process *proc, arch_addr_t addr) +{ + struct user_pt_regs regs; + if (aarch64_read_gregs(proc, ®s) < 0) { + fprintf(stderr, "get_instruction_pointer: " + "Couldn't read registers of %d.\n", proc->pid); + return; + } + + /* XXX double cast */ + regs.pc = (uint64_t) (uintptr_t) addr; + + if (aarch64_write_gregs(proc, ®s) < 0) { + fprintf(stderr, "get_instruction_pointer: " + "Couldn't write registers of %d.\n", proc->pid); + return; + } +} + +arch_addr_t +get_stack_pointer(struct Process *proc) +{ + struct user_pt_regs regs; + if (aarch64_read_gregs(proc, ®s) < 0) { + fprintf(stderr, "get_stack_pointer: " + "Couldn't read registers of %d.\n", proc->pid); + return 0; + } + + /* XXX double cast */ + return (arch_addr_t) (uintptr_t) regs.sp; +} + +arch_addr_t +get_return_addr(struct Process *proc, arch_addr_t stack_pointer) +{ + struct user_pt_regs regs; + if (aarch64_read_gregs(proc, ®s) < 0) { + fprintf(stderr, "get_return_addr: " + "Couldn't read registers of %d.\n", proc->pid); + return 0; + } + + /* XXX double cast */ + return (arch_addr_t) (uintptr_t) regs.regs[30]; +} Index: ltrace/sysdeps/linux-gnu/aarch64/signalent.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/signalent.h 2014-03-12 16:20:44.016676607 -0600 @@ -0,0 +1,52 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2006 Ian Wienand + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + + "SIG_0", /* 0 */ + "SIGHUP", /* 1 */ + "SIGINT", /* 2 */ + "SIGQUIT", /* 3 */ + "SIGILL", /* 4 */ + "SIGTRAP", /* 5 */ + "SIGABRT", /* 6 */ + "SIGBUS", /* 7 */ + "SIGFPE", /* 8 */ + "SIGKILL", /* 9 */ + "SIGUSR1", /* 10 */ + "SIGSEGV", /* 11 */ + "SIGUSR2", /* 12 */ + "SIGPIPE", /* 13 */ + "SIGALRM", /* 14 */ + "SIGTERM", /* 15 */ + "SIGSTKFLT", /* 16 */ + "SIGCHLD", /* 17 */ + "SIGCONT", /* 18 */ + "SIGSTOP", /* 19 */ + "SIGTSTP", /* 20 */ + "SIGTTIN", /* 21 */ + "SIGTTOU", /* 22 */ + "SIGURG", /* 23 */ + "SIGXCPU", /* 24 */ + "SIGXFSZ", /* 25 */ + "SIGVTALRM", /* 26 */ + "SIGPROF", /* 27 */ + "SIGWINCH", /* 28 */ + "SIGIO", /* 29 */ + "SIGPWR", /* 30 */ + "SIGSYS", /* 31 */ Index: ltrace/sysdeps/linux-gnu/aarch64/syscallent.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/syscallent.h 2014-03-12 16:20:44.016676607 -0600 @@ -0,0 +1,1100 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + + "io_setup", /* 0 */ + "io_destroy", /* 1 */ + "io_submit", /* 2 */ + "io_cancel", /* 3 */ + "io_getevents", /* 4 */ + "setxattr", /* 5 */ + "lsetxattr", /* 6 */ + "fsetxattr", /* 7 */ + "getxattr", /* 8 */ + "lgetxattr", /* 9 */ + "fgetxattr", /* 10 */ + "listxattr", /* 11 */ + "llistxattr", /* 12 */ + "flistxattr", /* 13 */ + "removexattr", /* 14 */ + "lremovexattr", /* 15 */ + "fremovexattr", /* 16 */ + "getcwd", /* 17 */ + "lookup_dcookie", /* 18 */ + "eventfd2", /* 19 */ + "epoll_create1", /* 20 */ + "epoll_ctl", /* 21 */ + "epoll_pwait", /* 22 */ + "dup", /* 23 */ + "dup3", /* 24 */ + "fcntl", /* 25 */ + "inotify_init1", /* 26 */ + "inotify_add_watch", /* 27 */ + "inotify_rm_watch", /* 28 */ + "ioctl", /* 29 */ + "ioprio_set", /* 30 */ + "ioprio_get", /* 31 */ + "flock", /* 32 */ + "mknodat", /* 33 */ + "mkdirat", /* 34 */ + "unlinkat", /* 35 */ + "symlinkat", /* 36 */ + "linkat", /* 37 */ + "renameat", /* 38 */ + "umount2", /* 39 */ + "mount", /* 40 */ + "pivot_root", /* 41 */ + "nfsservctl", /* 42 */ + "statfs", /* 43 */ + "fstatfs", /* 44 */ + "truncate", /* 45 */ + "ftruncate", /* 46 */ + "fallocate", /* 47 */ + "faccessat", /* 48 */ + "chdir", /* 49 */ + "fchdir", /* 50 */ + "chroot", /* 51 */ + "fchmod", /* 52 */ + "fchmodat", /* 53 */ + "fchownat", /* 54 */ + "fchown", /* 55 */ + "openat", /* 56 */ + "close", /* 57 */ + "vhangup", /* 58 */ + "pipe2", /* 59 */ + "quotactl", /* 60 */ + "getdents64", /* 61 */ + "lseek", /* 62 */ + "read", /* 63 */ + "write", /* 64 */ + "readv", /* 65 */ + "writev", /* 66 */ + "pread64", /* 67 */ + "pwrite64", /* 68 */ + "preadv", /* 69 */ + "pwritev", /* 70 */ + "sendfile", /* 71 */ + "pselect6", /* 72 */ + "ppoll", /* 73 */ + "signalfd4", /* 74 */ + "vmsplice", /* 75 */ + "splice", /* 76 */ + "tee", /* 77 */ + "readlinkat", /* 78 */ + "fstatat", /* 79 */ + "fstat", /* 80 */ + "sync", /* 81 */ + "fsync", /* 82 */ + "fdatasync", /* 83 */ + "sync_file_range", /* 84 */ + "timerfd_create", /* 85 */ + "timerfd_settime", /* 86 */ + "timerfd_gettime", /* 87 */ + "utimensat", /* 88 */ + "acct", /* 89 */ + "capget", /* 90 */ + "capset", /* 91 */ + "personality", /* 92 */ + "exit", /* 93 */ + "exit_group", /* 94 */ + "waitid", /* 95 */ + "set_tid_address", /* 96 */ + "unshare", /* 97 */ + "futex", /* 98 */ + "set_robust_list", /* 99 */ + "get_robust_list", /* 100 */ + "nanosleep", /* 101 */ + "getitimer", /* 102 */ + "setitimer", /* 103 */ + "kexec_load", /* 104 */ + "init_module", /* 105 */ + "delete_module", /* 106 */ + "timer_create", /* 107 */ + "timer_gettime", /* 108 */ + "timer_getoverrun", /* 109 */ + "timer_settime", /* 110 */ + "timer_delete", /* 111 */ + "clock_settime", /* 112 */ + "clock_gettime", /* 113 */ + "clock_getres", /* 114 */ + "clock_nanosleep", /* 115 */ + "syslog", /* 116 */ + "ptrace", /* 117 */ + "sched_setparam", /* 118 */ + "sched_setscheduler", /* 119 */ + "sched_getscheduler", /* 120 */ + "sched_getparam", /* 121 */ + "sched_setaffinity", /* 122 */ + "sched_getaffinity", /* 123 */ + "sched_yield", /* 124 */ + "sched_get_priority_max", /* 125 */ + "sched_get_priority_min", /* 126 */ + "sched_rr_get_interval", /* 127 */ + "restart_syscall", /* 128 */ + "kill", /* 129 */ + "tkill", /* 130 */ + "tgkill", /* 131 */ + "sigaltstack", /* 132 */ + "rt_sigsuspend", /* 133 */ + "rt_sigaction", /* 134 */ + "rt_sigprocmask", /* 135 */ + "rt_sigpending", /* 136 */ + "rt_sigtimedwait", /* 137 */ + "rt_sigqueueinfo", /* 138 */ + "rt_sigreturn", /* 139 */ + "setpriority", /* 140 */ + "getpriority", /* 141 */ + "reboot", /* 142 */ + "setregid", /* 143 */ + "setgid", /* 144 */ + "setreuid", /* 145 */ + "setuid", /* 146 */ + "setresuid", /* 147 */ + "getresuid", /* 148 */ + "setresgid", /* 149 */ + "getresgid", /* 150 */ + "setfsuid", /* 151 */ + "setfsgid", /* 152 */ + "times", /* 153 */ + "setpgid", /* 154 */ + "getpgid", /* 155 */ + "getsid", /* 156 */ + "setsid", /* 157 */ + "getgroups", /* 158 */ + "setgroups", /* 159 */ + "uname", /* 160 */ + "sethostname", /* 161 */ + "setdomainname", /* 162 */ + "getrlimit", /* 163 */ + "setrlimit", /* 164 */ + "getrusage", /* 165 */ + "umask", /* 166 */ + "prctl", /* 167 */ + "getcpu", /* 168 */ + "gettimeofday", /* 169 */ + "settimeofday", /* 170 */ + "adjtimex", /* 171 */ + "getpid", /* 172 */ + "getppid", /* 173 */ + "getuid", /* 174 */ + "geteuid", /* 175 */ + "getgid", /* 176 */ + "getegid", /* 177 */ + "gettid", /* 178 */ + "sysinfo", /* 179 */ + "mq_open", /* 180 */ + "mq_unlink", /* 181 */ + "mq_timedsend", /* 182 */ + "mq_timedreceive", /* 183 */ + "mq_notify", /* 184 */ + "mq_getsetattr", /* 185 */ + "msgget", /* 186 */ + "msgctl", /* 187 */ + "msgrcv", /* 188 */ + "msgsnd", /* 189 */ + "semget", /* 190 */ + "semctl", /* 191 */ + "semtimedop", /* 192 */ + "semop", /* 193 */ + "shmget", /* 194 */ + "shmctl", /* 195 */ + "shmat", /* 196 */ + "shmdt", /* 197 */ + "socket", /* 198 */ + "socketpair", /* 199 */ + "bind", /* 200 */ + "listen", /* 201 */ + "accept", /* 202 */ + "connect", /* 203 */ + "getsockname", /* 204 */ + "getpeername", /* 205 */ + "sendto", /* 206 */ + "recvfrom", /* 207 */ + "setsockopt", /* 208 */ + "getsockopt", /* 209 */ + "shutdown", /* 210 */ + "sendmsg", /* 211 */ + "recvmsg", /* 212 */ + "readahead", /* 213 */ + "brk", /* 214 */ + "munmap", /* 215 */ + "mremap", /* 216 */ + "add_key", /* 217 */ + "request_key", /* 218 */ + "keyctl", /* 219 */ + "clone", /* 220 */ + "execve", /* 221 */ + "mmap", /* 222 */ + "fadvise64", /* 223 */ + "swapon", /* 224 */ + "swapoff", /* 225 */ + "mprotect", /* 226 */ + "msync", /* 227 */ + "mlock", /* 228 */ + "munlock", /* 229 */ + "mlockall", /* 230 */ + "munlockall", /* 231 */ + "mincore", /* 232 */ + "madvise", /* 233 */ + "remap_file_pages", /* 234 */ + "mbind", /* 235 */ + "get_mempolicy", /* 236 */ + "set_mempolicy", /* 237 */ + "migrate_pages", /* 238 */ + "move_pages", /* 239 */ + "rt_tgsigqueueinfo", /* 240 */ + "perf_event_open", /* 241 */ + "accept4", /* 242 */ + "recvmmsg", /* 243 */ + "arch_specific_syscall", /* 244 */ + "245", /* 245 */ + "246", /* 246 */ + "247", /* 247 */ + "248", /* 248 */ + "249", /* 249 */ + "250", /* 250 */ + "251", /* 251 */ + "252", /* 252 */ + "253", /* 253 */ + "254", /* 254 */ + "255", /* 255 */ + "256", /* 256 */ + "257", /* 257 */ + "258", /* 258 */ + "259", /* 259 */ + "wait4", /* 260 */ + "prlimit64", /* 261 */ + "fanotify_init", /* 262 */ + "fanotify_mark", /* 263 */ + "name_to_handle_at", /* 264 */ + "open_by_handle_at", /* 265 */ + "clock_adjtime", /* 266 */ + "syncfs", /* 267 */ + "setns", /* 268 */ + "sendmmsg", /* 269 */ + "process_vm_readv", /* 270 */ + "process_vm_writev", /* 271 */ + "kcmp", /* 272 */ + "finit_module", /* 273 */ + "syscalls", /* 274 */ + "275", /* 275 */ + "276", /* 276 */ + "277", /* 277 */ + "278", /* 278 */ + "279", /* 279 */ + "280", /* 280 */ + "281", /* 281 */ + "282", /* 282 */ + "283", /* 283 */ + "284", /* 284 */ + "285", /* 285 */ + "286", /* 286 */ + "287", /* 287 */ + "288", /* 288 */ + "289", /* 289 */ + "290", /* 290 */ + "291", /* 291 */ + "292", /* 292 */ + "293", /* 293 */ + "294", /* 294 */ + "295", /* 295 */ + "296", /* 296 */ + "297", /* 297 */ + "298", /* 298 */ + "299", /* 299 */ + "300", /* 300 */ + "301", /* 301 */ + "302", /* 302 */ + "303", /* 303 */ + "304", /* 304 */ + "305", /* 305 */ + "306", /* 306 */ + "307", /* 307 */ + "308", /* 308 */ + "309", /* 309 */ + "310", /* 310 */ + "311", /* 311 */ + "312", /* 312 */ + "313", /* 313 */ + "314", /* 314 */ + "315", /* 315 */ + "316", /* 316 */ + "317", /* 317 */ + "318", /* 318 */ + "319", /* 319 */ + "320", /* 320 */ + "321", /* 321 */ + "322", /* 322 */ + "323", /* 323 */ + "324", /* 324 */ + "325", /* 325 */ + "326", /* 326 */ + "327", /* 327 */ + "328", /* 328 */ + "329", /* 329 */ + "330", /* 330 */ + "331", /* 331 */ + "332", /* 332 */ + "333", /* 333 */ + "334", /* 334 */ + "335", /* 335 */ + "336", /* 336 */ + "337", /* 337 */ + "338", /* 338 */ + "339", /* 339 */ + "340", /* 340 */ + "341", /* 341 */ + "342", /* 342 */ + "343", /* 343 */ + "344", /* 344 */ + "345", /* 345 */ + "346", /* 346 */ + "347", /* 347 */ + "348", /* 348 */ + "349", /* 349 */ + "350", /* 350 */ + "351", /* 351 */ + "352", /* 352 */ + "353", /* 353 */ + "354", /* 354 */ + "355", /* 355 */ + "356", /* 356 */ + "357", /* 357 */ + "358", /* 358 */ + "359", /* 359 */ + "360", /* 360 */ + "361", /* 361 */ + "362", /* 362 */ + "363", /* 363 */ + "364", /* 364 */ + "365", /* 365 */ + "366", /* 366 */ + "367", /* 367 */ + "368", /* 368 */ + "369", /* 369 */ + "370", /* 370 */ + "371", /* 371 */ + "372", /* 372 */ + "373", /* 373 */ + "374", /* 374 */ + "375", /* 375 */ + "376", /* 376 */ + "377", /* 377 */ + "378", /* 378 */ + "379", /* 379 */ + "380", /* 380 */ + "381", /* 381 */ + "382", /* 382 */ + "383", /* 383 */ + "384", /* 384 */ + "385", /* 385 */ + "386", /* 386 */ + "387", /* 387 */ + "388", /* 388 */ + "389", /* 389 */ + "390", /* 390 */ + "391", /* 391 */ + "392", /* 392 */ + "393", /* 393 */ + "394", /* 394 */ + "395", /* 395 */ + "396", /* 396 */ + "397", /* 397 */ + "398", /* 398 */ + "399", /* 399 */ + "400", /* 400 */ + "401", /* 401 */ + "402", /* 402 */ + "403", /* 403 */ + "404", /* 404 */ + "405", /* 405 */ + "406", /* 406 */ + "407", /* 407 */ + "408", /* 408 */ + "409", /* 409 */ + "410", /* 410 */ + "411", /* 411 */ + "412", /* 412 */ + "413", /* 413 */ + "414", /* 414 */ + "415", /* 415 */ + "416", /* 416 */ + "417", /* 417 */ + "418", /* 418 */ + "419", /* 419 */ + "420", /* 420 */ + "421", /* 421 */ + "422", /* 422 */ + "423", /* 423 */ + "424", /* 424 */ + "425", /* 425 */ + "426", /* 426 */ + "427", /* 427 */ + "428", /* 428 */ + "429", /* 429 */ + "430", /* 430 */ + "431", /* 431 */ + "432", /* 432 */ + "433", /* 433 */ + "434", /* 434 */ + "435", /* 435 */ + "436", /* 436 */ + "437", /* 437 */ + "438", /* 438 */ + "439", /* 439 */ + "440", /* 440 */ + "441", /* 441 */ + "442", /* 442 */ + "443", /* 443 */ + "444", /* 444 */ + "445", /* 445 */ + "446", /* 446 */ + "447", /* 447 */ + "448", /* 448 */ + "449", /* 449 */ + "450", /* 450 */ + "451", /* 451 */ + "452", /* 452 */ + "453", /* 453 */ + "454", /* 454 */ + "455", /* 455 */ + "456", /* 456 */ + "457", /* 457 */ + "458", /* 458 */ + "459", /* 459 */ + "460", /* 460 */ + "461", /* 461 */ + "462", /* 462 */ + "463", /* 463 */ + "464", /* 464 */ + "465", /* 465 */ + "466", /* 466 */ + "467", /* 467 */ + "468", /* 468 */ + "469", /* 469 */ + "470", /* 470 */ + "471", /* 471 */ + "472", /* 472 */ + "473", /* 473 */ + "474", /* 474 */ + "475", /* 475 */ + "476", /* 476 */ + "477", /* 477 */ + "478", /* 478 */ + "479", /* 479 */ + "480", /* 480 */ + "481", /* 481 */ + "482", /* 482 */ + "483", /* 483 */ + "484", /* 484 */ + "485", /* 485 */ + "486", /* 486 */ + "487", /* 487 */ + "488", /* 488 */ + "489", /* 489 */ + "490", /* 490 */ + "491", /* 491 */ + "492", /* 492 */ + "493", /* 493 */ + "494", /* 494 */ + "495", /* 495 */ + "496", /* 496 */ + "497", /* 497 */ + "498", /* 498 */ + "499", /* 499 */ + "500", /* 500 */ + "501", /* 501 */ + "502", /* 502 */ + "503", /* 503 */ + "504", /* 504 */ + "505", /* 505 */ + "506", /* 506 */ + "507", /* 507 */ + "508", /* 508 */ + "509", /* 509 */ + "510", /* 510 */ + "511", /* 511 */ + "512", /* 512 */ + "513", /* 513 */ + "514", /* 514 */ + "515", /* 515 */ + "516", /* 516 */ + "517", /* 517 */ + "518", /* 518 */ + "519", /* 519 */ + "520", /* 520 */ + "521", /* 521 */ + "522", /* 522 */ + "523", /* 523 */ + "524", /* 524 */ + "525", /* 525 */ + "526", /* 526 */ + "527", /* 527 */ + "528", /* 528 */ + "529", /* 529 */ + "530", /* 530 */ + "531", /* 531 */ + "532", /* 532 */ + "533", /* 533 */ + "534", /* 534 */ + "535", /* 535 */ + "536", /* 536 */ + "537", /* 537 */ + "538", /* 538 */ + "539", /* 539 */ + "540", /* 540 */ + "541", /* 541 */ + "542", /* 542 */ + "543", /* 543 */ + "544", /* 544 */ + "545", /* 545 */ + "546", /* 546 */ + "547", /* 547 */ + "548", /* 548 */ + "549", /* 549 */ + "550", /* 550 */ + "551", /* 551 */ + "552", /* 552 */ + "553", /* 553 */ + "554", /* 554 */ + "555", /* 555 */ + "556", /* 556 */ + "557", /* 557 */ + "558", /* 558 */ + "559", /* 559 */ + "560", /* 560 */ + "561", /* 561 */ + "562", /* 562 */ + "563", /* 563 */ + "564", /* 564 */ + "565", /* 565 */ + "566", /* 566 */ + "567", /* 567 */ + "568", /* 568 */ + "569", /* 569 */ + "570", /* 570 */ + "571", /* 571 */ + "572", /* 572 */ + "573", /* 573 */ + "574", /* 574 */ + "575", /* 575 */ + "576", /* 576 */ + "577", /* 577 */ + "578", /* 578 */ + "579", /* 579 */ + "580", /* 580 */ + "581", /* 581 */ + "582", /* 582 */ + "583", /* 583 */ + "584", /* 584 */ + "585", /* 585 */ + "586", /* 586 */ + "587", /* 587 */ + "588", /* 588 */ + "589", /* 589 */ + "590", /* 590 */ + "591", /* 591 */ + "592", /* 592 */ + "593", /* 593 */ + "594", /* 594 */ + "595", /* 595 */ + "596", /* 596 */ + "597", /* 597 */ + "598", /* 598 */ + "599", /* 599 */ + "600", /* 600 */ + "601", /* 601 */ + "602", /* 602 */ + "603", /* 603 */ + "604", /* 604 */ + "605", /* 605 */ + "606", /* 606 */ + "607", /* 607 */ + "608", /* 608 */ + "609", /* 609 */ + "610", /* 610 */ + "611", /* 611 */ + "612", /* 612 */ + "613", /* 613 */ + "614", /* 614 */ + "615", /* 615 */ + "616", /* 616 */ + "617", /* 617 */ + "618", /* 618 */ + "619", /* 619 */ + "620", /* 620 */ + "621", /* 621 */ + "622", /* 622 */ + "623", /* 623 */ + "624", /* 624 */ + "625", /* 625 */ + "626", /* 626 */ + "627", /* 627 */ + "628", /* 628 */ + "629", /* 629 */ + "630", /* 630 */ + "631", /* 631 */ + "632", /* 632 */ + "633", /* 633 */ + "634", /* 634 */ + "635", /* 635 */ + "636", /* 636 */ + "637", /* 637 */ + "638", /* 638 */ + "639", /* 639 */ + "640", /* 640 */ + "641", /* 641 */ + "642", /* 642 */ + "643", /* 643 */ + "644", /* 644 */ + "645", /* 645 */ + "646", /* 646 */ + "647", /* 647 */ + "648", /* 648 */ + "649", /* 649 */ + "650", /* 650 */ + "651", /* 651 */ + "652", /* 652 */ + "653", /* 653 */ + "654", /* 654 */ + "655", /* 655 */ + "656", /* 656 */ + "657", /* 657 */ + "658", /* 658 */ + "659", /* 659 */ + "660", /* 660 */ + "661", /* 661 */ + "662", /* 662 */ + "663", /* 663 */ + "664", /* 664 */ + "665", /* 665 */ + "666", /* 666 */ + "667", /* 667 */ + "668", /* 668 */ + "669", /* 669 */ + "670", /* 670 */ + "671", /* 671 */ + "672", /* 672 */ + "673", /* 673 */ + "674", /* 674 */ + "675", /* 675 */ + "676", /* 676 */ + "677", /* 677 */ + "678", /* 678 */ + "679", /* 679 */ + "680", /* 680 */ + "681", /* 681 */ + "682", /* 682 */ + "683", /* 683 */ + "684", /* 684 */ + "685", /* 685 */ + "686", /* 686 */ + "687", /* 687 */ + "688", /* 688 */ + "689", /* 689 */ + "690", /* 690 */ + "691", /* 691 */ + "692", /* 692 */ + "693", /* 693 */ + "694", /* 694 */ + "695", /* 695 */ + "696", /* 696 */ + "697", /* 697 */ + "698", /* 698 */ + "699", /* 699 */ + "700", /* 700 */ + "701", /* 701 */ + "702", /* 702 */ + "703", /* 703 */ + "704", /* 704 */ + "705", /* 705 */ + "706", /* 706 */ + "707", /* 707 */ + "708", /* 708 */ + "709", /* 709 */ + "710", /* 710 */ + "711", /* 711 */ + "712", /* 712 */ + "713", /* 713 */ + "714", /* 714 */ + "715", /* 715 */ + "716", /* 716 */ + "717", /* 717 */ + "718", /* 718 */ + "719", /* 719 */ + "720", /* 720 */ + "721", /* 721 */ + "722", /* 722 */ + "723", /* 723 */ + "724", /* 724 */ + "725", /* 725 */ + "726", /* 726 */ + "727", /* 727 */ + "728", /* 728 */ + "729", /* 729 */ + "730", /* 730 */ + "731", /* 731 */ + "732", /* 732 */ + "733", /* 733 */ + "734", /* 734 */ + "735", /* 735 */ + "736", /* 736 */ + "737", /* 737 */ + "738", /* 738 */ + "739", /* 739 */ + "740", /* 740 */ + "741", /* 741 */ + "742", /* 742 */ + "743", /* 743 */ + "744", /* 744 */ + "745", /* 745 */ + "746", /* 746 */ + "747", /* 747 */ + "748", /* 748 */ + "749", /* 749 */ + "750", /* 750 */ + "751", /* 751 */ + "752", /* 752 */ + "753", /* 753 */ + "754", /* 754 */ + "755", /* 755 */ + "756", /* 756 */ + "757", /* 757 */ + "758", /* 758 */ + "759", /* 759 */ + "760", /* 760 */ + "761", /* 761 */ + "762", /* 762 */ + "763", /* 763 */ + "764", /* 764 */ + "765", /* 765 */ + "766", /* 766 */ + "767", /* 767 */ + "768", /* 768 */ + "769", /* 769 */ + "770", /* 770 */ + "771", /* 771 */ + "772", /* 772 */ + "773", /* 773 */ + "774", /* 774 */ + "775", /* 775 */ + "776", /* 776 */ + "777", /* 777 */ + "778", /* 778 */ + "779", /* 779 */ + "780", /* 780 */ + "781", /* 781 */ + "782", /* 782 */ + "783", /* 783 */ + "784", /* 784 */ + "785", /* 785 */ + "786", /* 786 */ + "787", /* 787 */ + "788", /* 788 */ + "789", /* 789 */ + "790", /* 790 */ + "791", /* 791 */ + "792", /* 792 */ + "793", /* 793 */ + "794", /* 794 */ + "795", /* 795 */ + "796", /* 796 */ + "797", /* 797 */ + "798", /* 798 */ + "799", /* 799 */ + "800", /* 800 */ + "801", /* 801 */ + "802", /* 802 */ + "803", /* 803 */ + "804", /* 804 */ + "805", /* 805 */ + "806", /* 806 */ + "807", /* 807 */ + "808", /* 808 */ + "809", /* 809 */ + "810", /* 810 */ + "811", /* 811 */ + "812", /* 812 */ + "813", /* 813 */ + "814", /* 814 */ + "815", /* 815 */ + "816", /* 816 */ + "817", /* 817 */ + "818", /* 818 */ + "819", /* 819 */ + "820", /* 820 */ + "821", /* 821 */ + "822", /* 822 */ + "823", /* 823 */ + "824", /* 824 */ + "825", /* 825 */ + "826", /* 826 */ + "827", /* 827 */ + "828", /* 828 */ + "829", /* 829 */ + "830", /* 830 */ + "831", /* 831 */ + "832", /* 832 */ + "833", /* 833 */ + "834", /* 834 */ + "835", /* 835 */ + "836", /* 836 */ + "837", /* 837 */ + "838", /* 838 */ + "839", /* 839 */ + "840", /* 840 */ + "841", /* 841 */ + "842", /* 842 */ + "843", /* 843 */ + "844", /* 844 */ + "845", /* 845 */ + "846", /* 846 */ + "847", /* 847 */ + "848", /* 848 */ + "849", /* 849 */ + "850", /* 850 */ + "851", /* 851 */ + "852", /* 852 */ + "853", /* 853 */ + "854", /* 854 */ + "855", /* 855 */ + "856", /* 856 */ + "857", /* 857 */ + "858", /* 858 */ + "859", /* 859 */ + "860", /* 860 */ + "861", /* 861 */ + "862", /* 862 */ + "863", /* 863 */ + "864", /* 864 */ + "865", /* 865 */ + "866", /* 866 */ + "867", /* 867 */ + "868", /* 868 */ + "869", /* 869 */ + "870", /* 870 */ + "871", /* 871 */ + "872", /* 872 */ + "873", /* 873 */ + "874", /* 874 */ + "875", /* 875 */ + "876", /* 876 */ + "877", /* 877 */ + "878", /* 878 */ + "879", /* 879 */ + "880", /* 880 */ + "881", /* 881 */ + "882", /* 882 */ + "883", /* 883 */ + "884", /* 884 */ + "885", /* 885 */ + "886", /* 886 */ + "887", /* 887 */ + "888", /* 888 */ + "889", /* 889 */ + "890", /* 890 */ + "891", /* 891 */ + "892", /* 892 */ + "893", /* 893 */ + "894", /* 894 */ + "895", /* 895 */ + "896", /* 896 */ + "897", /* 897 */ + "898", /* 898 */ + "899", /* 899 */ + "900", /* 900 */ + "901", /* 901 */ + "902", /* 902 */ + "903", /* 903 */ + "904", /* 904 */ + "905", /* 905 */ + "906", /* 906 */ + "907", /* 907 */ + "908", /* 908 */ + "909", /* 909 */ + "910", /* 910 */ + "911", /* 911 */ + "912", /* 912 */ + "913", /* 913 */ + "914", /* 914 */ + "915", /* 915 */ + "916", /* 916 */ + "917", /* 917 */ + "918", /* 918 */ + "919", /* 919 */ + "920", /* 920 */ + "921", /* 921 */ + "922", /* 922 */ + "923", /* 923 */ + "924", /* 924 */ + "925", /* 925 */ + "926", /* 926 */ + "927", /* 927 */ + "928", /* 928 */ + "929", /* 929 */ + "930", /* 930 */ + "931", /* 931 */ + "932", /* 932 */ + "933", /* 933 */ + "934", /* 934 */ + "935", /* 935 */ + "936", /* 936 */ + "937", /* 937 */ + "938", /* 938 */ + "939", /* 939 */ + "940", /* 940 */ + "941", /* 941 */ + "942", /* 942 */ + "943", /* 943 */ + "944", /* 944 */ + "945", /* 945 */ + "946", /* 946 */ + "947", /* 947 */ + "948", /* 948 */ + "949", /* 949 */ + "950", /* 950 */ + "951", /* 951 */ + "952", /* 952 */ + "953", /* 953 */ + "954", /* 954 */ + "955", /* 955 */ + "956", /* 956 */ + "957", /* 957 */ + "958", /* 958 */ + "959", /* 959 */ + "960", /* 960 */ + "961", /* 961 */ + "962", /* 962 */ + "963", /* 963 */ + "964", /* 964 */ + "965", /* 965 */ + "966", /* 966 */ + "967", /* 967 */ + "968", /* 968 */ + "969", /* 969 */ + "970", /* 970 */ + "971", /* 971 */ + "972", /* 972 */ + "973", /* 973 */ + "974", /* 974 */ + "975", /* 975 */ + "976", /* 976 */ + "977", /* 977 */ + "978", /* 978 */ + "979", /* 979 */ + "980", /* 980 */ + "981", /* 981 */ + "982", /* 982 */ + "983", /* 983 */ + "984", /* 984 */ + "985", /* 985 */ + "986", /* 986 */ + "987", /* 987 */ + "988", /* 988 */ + "989", /* 989 */ + "990", /* 990 */ + "991", /* 991 */ + "992", /* 992 */ + "993", /* 993 */ + "994", /* 994 */ + "995", /* 995 */ + "996", /* 996 */ + "997", /* 997 */ + "998", /* 998 */ + "999", /* 999 */ + "1000", /* 1000 */ + "1001", /* 1001 */ + "1002", /* 1002 */ + "1003", /* 1003 */ + "1004", /* 1004 */ + "1005", /* 1005 */ + "1006", /* 1006 */ + "1007", /* 1007 */ + "1008", /* 1008 */ + "1009", /* 1009 */ + "1010", /* 1010 */ + "1011", /* 1011 */ + "1012", /* 1012 */ + "1013", /* 1013 */ + "1014", /* 1014 */ + "1015", /* 1015 */ + "1016", /* 1016 */ + "1017", /* 1017 */ + "1018", /* 1018 */ + "1019", /* 1019 */ + "1020", /* 1020 */ + "1021", /* 1021 */ + "1022", /* 1022 */ + "1023", /* 1023 */ + "open", /* 1024 */ + "link", /* 1025 */ + "unlink", /* 1026 */ + "mknod", /* 1027 */ + "chmod", /* 1028 */ + "chown", /* 1029 */ + "mkdir", /* 1030 */ + "rmdir", /* 1031 */ + "lchown", /* 1032 */ + "access", /* 1033 */ + "rename", /* 1034 */ + "readlink", /* 1035 */ + "symlink", /* 1036 */ + "utimes", /* 1037 */ + "stat", /* 1038 */ + "lstat", /* 1039 */ + "pipe", /* 1040 */ + "dup2", /* 1041 */ + "epoll_create", /* 1042 */ + "inotify_init", /* 1043 */ + "eventfd", /* 1044 */ + "signalfd", /* 1045 */ + "sendfile", /* 1046 */ + "ftruncate", /* 1047 */ + "truncate", /* 1048 */ + "stat", /* 1049 */ + "lstat", /* 1050 */ + "fstat", /* 1051 */ + "fcntl", /* 1052 */ + "fadvise64", /* 1053 */ + "newfstatat", /* 1054 */ + "fstatfs", /* 1055 */ + "statfs", /* 1056 */ + "lseek", /* 1057 */ + "mmap", /* 1058 */ + "alarm", /* 1059 */ + "getpgrp", /* 1060 */ + "pause", /* 1061 */ + "time", /* 1062 */ + "utime", /* 1063 */ + "creat", /* 1064 */ + "getdents", /* 1065 */ + "futimesat", /* 1066 */ + "select", /* 1067 */ + "poll", /* 1068 */ + "epoll_wait", /* 1069 */ + "ustat", /* 1070 */ + "vfork", /* 1071 */ + "oldwait4", /* 1072 */ + "recv", /* 1073 */ + "send", /* 1074 */ + "bdflush", /* 1075 */ + "umount", /* 1076 */ + "uselib", /* 1077 */ + "_sysctl", /* 1078 */ + "fork", /* 1079 */ Index: ltrace/sysdeps/linux-gnu/aarch64/trace.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ ltrace/sysdeps/linux-gnu/aarch64/trace.c 2014-03-12 16:23:25.382866486 -0600 @@ -0,0 +1,83 @@ +/* + * This file is part of ltrace. + * Copyright (C) 2014 Petr Machata, Red Hat, Inc. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA + * 02110-1301 USA + */ + +#include +#include +#include +#include +#include +#include + +#include "backend.h" +#include "proc.h" + +void +get_arch_dep(struct Process *proc) +{ +} + +int aarch64_read_gregs(struct Process *proc, struct user_pt_regs *regs); + +/* The syscall instruction is: + * | 31 21 | 20 5 | 4 0 | + * | 1 1 0 1 0 1 0 0 | 0 0 0 | imm16 | 0 0 0 0 1 | */ +#define SVC_MASK 0xffe0001f +#define SVC_VALUE 0xd4000001 + +int +syscall_p(struct Process *proc, int status, int *sysnum) +{ + if (WIFSTOPPED(status) + && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) { + + struct user_pt_regs regs; + if (aarch64_read_gregs(proc, ®s) < 0) { + fprintf(stderr, "syscall_p: " + "Couldn't read registers of %d.\n", proc->pid); + return -1; + } + + errno = 0; + unsigned long insn = (unsigned long) ptrace(PTRACE_PEEKTEXT, + proc->pid, + regs.pc - 4, 0); + if (insn == -1UL && errno != 0) { + fprintf(stderr, "syscall_p: " + "Couldn't peek into %d: %s\n", proc->pid, + strerror(errno)); + return -1; + } + + insn &= 0xffffffffUL; + if ((insn & SVC_MASK) == SVC_VALUE) { + *sysnum = regs.regs[8]; + + size_t d1 = proc->callstack_depth - 1; + if (proc->callstack_depth > 0 + && proc->callstack[d1].is_syscall + && proc->callstack[d1].c_un.syscall == *sysnum) + return 2; + + return 1; + } + } + + return 0; +} debian/patches/ppc64el.diff0000664000000000000000000003663612302663513012745 0ustar Index: b/configure.ac =================================================================== --- a/configure.ac +++ b/configure.ac @@ -42,7 +42,7 @@ arm*|sa110) HOST_CPU="arm" ;; cris*) HOST_CPU="cris" ;; mips*) HOST_CPU="mips" ;; - powerpc|powerpc64) HOST_CPU="ppc" ;; + powerpc|powerpc64|powerpc64le) HOST_CPU="ppc" ;; sun4u|sparc64) HOST_CPU="sparc" ;; s390x) HOST_CPU="s390" ;; i?86|x86_64) HOST_CPU="x86" ;; @@ -168,6 +168,7 @@ i?86) UNWIND_ARCH="x86" ;; powerpc) UNWIND_ARCH="ppc32" ;; powerpc64) UNWIND_ARCH="ppc64" ;; + powerpc64le) UNWIND_ARCH="ppc64le" ;; mips*) UNWIND_ARCH="mips" ;; *) UNWIND_ARCH="${host_cpu}" ;; esac Index: b/config/autoconf/config.guess =================================================================== --- a/config/autoconf/config.guess +++ b/config/autoconf/config.guess @@ -952,6 +952,9 @@ ppc64:Linux:*:*) echo powerpc64-unknown-linux-gnu exit ;; + ppc64le:Linux:*:*) + echo powerpc64le-unknown-linux-gnu + exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-gnu exit ;; Index: b/config/m4/libtool.m4 =================================================================== --- a/config/m4/libtool.m4 +++ b/config/m4/libtool.m4 @@ -1285,6 +1285,9 @@ ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; + ppc64le-*linux*|powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; @@ -1304,6 +1307,9 @@ ppc*-*linux*|powerpc*-*linux*) LD="${LD-ld} -m elf64ppc" ;; + ppc64-*linux*|powerpc64-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; Index: b/configure =================================================================== --- a/configure +++ b/configure @@ -2552,7 +2552,7 @@ arm*|sa110) HOST_CPU="arm" ;; cris*) HOST_CPU="cris" ;; mips*) HOST_CPU="mips" ;; - powerpc|powerpc64) HOST_CPU="ppc" ;; + powerpc|powerpc64|powerpc64le) HOST_CPU="ppc" ;; sun4u|sparc64) HOST_CPU="sparc" ;; s390x) HOST_CPU="s390" ;; i?86|x86_64) HOST_CPU="x86" ;; @@ -5747,6 +5747,9 @@ ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf32ppclinux" ;; + ppc64le-*linux*|powerpc64le-*linux*) + LD="${LD-ld} -m elf32lppclinux" + ;; s390x-*linux*) LD="${LD-ld} -m elf_s390" ;; @@ -5763,9 +5766,12 @@ x86_64-*linux*) LD="${LD-ld} -m elf_x86_64" ;; - ppc*-*linux*|powerpc*-*linux*) + ppc64-*linux*|powerpc64-*linux*) LD="${LD-ld} -m elf64ppc" ;; + ppc64le-*linux*|powerpc64le-*linux*) + LD="${LD-ld} -m elf64lppc" + ;; s390*-*linux*|s390*-*tpf*) LD="${LD-ld} -m elf64_s390" ;; Index: b/ltrace-elf.c =================================================================== --- a/ltrace-elf.c +++ b/ltrace-elf.c @@ -714,6 +714,9 @@ continue; } +#if _CALL_ELF == 2 + naddr += PPC64_LOCAL_ENTRY_OFFSET (sym.st_other); +#endif char *full_name; int own_full_name = 1; if (name_copy == NULL) { Index: b/sysdeps/linux-gnu/ppc/arch.h =================================================================== --- a/sysdeps/linux-gnu/ppc/arch.h +++ b/sysdeps/linux-gnu/ppc/arch.h @@ -24,7 +24,6 @@ #include -#define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 } #define BREAKPOINT_LENGTH 4 #define DECR_PC_AFTER_BREAK 0 @@ -34,15 +33,28 @@ #ifdef __powerpc64__ // Says 'ltrace' is 64 bits, says nothing about target. #define LT_ELFCLASS2 ELFCLASS64 #define LT_ELF_MACHINE2 EM_PPC64 +#if _CALL_ELF == 2 +#undef ARCH_SUPPORTS_OPD +#else #define ARCH_SUPPORTS_OPD #endif +#ifdef __LITTLE_ENDIAN__ +#define BREAKPOINT_VALUE { 0x08, 0x00, 0xe0, 0x7f } +#define ARCH_ENDIAN_LITTLE +#else +#define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 } +#define ARCH_ENDIAN_BIG +#endif +#else /* is not __powerpc64__ */ +#define BREAKPOINT_VALUE { 0x7f, 0xe0, 0x00, 0x08 } +#define ARCH_ENDIAN_BIG +#endif #define ARCH_HAVE_ATOMIC_SINGLESTEP #define ARCH_HAVE_ADD_PLT_ENTRY #define ARCH_HAVE_TRANSLATE_ADDRESS #define ARCH_HAVE_DYNLINK_DONE #define ARCH_HAVE_FETCH_ARG -#define ARCH_ENDIAN_BIG #define ARCH_HAVE_SIZEOF #define ARCH_HAVE_ALIGNOF Index: b/sysdeps/linux-gnu/ppc/fetch.c =================================================================== --- a/sysdeps/linux-gnu/ppc/fetch.c +++ b/sysdeps/linux-gnu/ppc/fetch.c @@ -65,16 +65,36 @@ }; +enum homogeneous_type { + NOINIT = 0, + HETEROGENEOUS, + HOMOGENEOUS, + HOMOGENEOUS_NESTED_FLOAT, +}; + +struct struct_attributes { + struct arg_type_info *info; + enum arg_type type; + size_t nb_elements; + enum homogeneous_type homogeneous; +}; + static int fetch_context_init(struct Process *proc, struct fetch_context *context) { context->greg = 3; context->freg = 1; +#if _CALL_ELF == 2 +#define STACK_FRAME_OVERHEAD 96 +#else +#define STACK_FRAME_OVERHEAD 112 +#endif if (proc->e_machine == EM_PPC) context->stack_pointer = proc->stack_pointer + 8; else - context->stack_pointer = proc->stack_pointer + 112; + context->stack_pointer = proc->stack_pointer + + STACK_FRAME_OVERHEAD; /* When ltrace is 64-bit, we might use PTRACE_GETREGS to * obtain 64-bit as well as 32-bit registers. But if we do it @@ -107,6 +127,57 @@ return 0; } +#if _CALL_ELF == 2 +static int +get_struct_attribut(struct arg_type_info *info, struct Process *proc, + size_t *size_of, struct struct_attributes *struct_attr) +{ + size_t n = type_aggregate_size(info); + if (n == (size_t)-1) + return ARGTYPE_VOID; + + enum arg_type type = ARGTYPE_VOID; + + while (n-- > 0) { + struct arg_type_info *emt = type_element(info, n); + enum arg_type emt_type = emt->type; + + if (emt_type != ARGTYPE_STRUCT) { + (struct_attr->nb_elements)++; + if (struct_attr->homogeneous == NOINIT) { + struct_attr->info = emt; + struct_attr->type = emt_type; + + if (emt_type == ARGTYPE_DOUBLE || + emt_type == ARGTYPE_FLOAT) + struct_attr->homogeneous = + HOMOGENEOUS_NESTED_FLOAT; + else + struct_attr->homogeneous = HOMOGENEOUS; + } else { + if (struct_attr->type != emt_type) + struct_attr->homogeneous = HETEROGENEOUS; + } + } + + if (emt_type == ARGTYPE_STRUCT) { + emt_type = get_struct_attribut(emt, proc, size_of, + struct_attr); + } else { + size_t size = type_sizeof(proc, emt); + if (size == (size_t)-1) + return -1; + *size_of += size; + } + + type = emt_type; + } + + assert(type != ARGTYPE_STRUCT); + return type; +} +#endif + struct fetch_context * arch_fetch_arg_init(enum tof type, struct Process *proc, struct arg_type_info *ret_info) @@ -118,6 +189,7 @@ return NULL; } +#if _CALL_ELF != 2 /* Aggregates or unions of any length, and character strings * of length longer than 8 bytes, will be returned in a * storage buffer allocated by the caller. The caller will @@ -125,6 +197,40 @@ * in r3, causing the first explicit argument to be passed in * r4. */ context->ret_struct = ret_info->type == ARGTYPE_STRUCT; +#else + /* There are two changes regarding structure return types: + * * homogeneous float/vector structs are returned + * in (multiple) FP/vector registers, + * instead of via implicit reference. + * * small structs (up to 16 bytes) are return + * in one or two GPRs, instead of via implicit reference. + + * Other structures (larger than 16 bytes, not homogeneous) + * are still returned via implicit reference (i.e. a pointer + * to memory where to return the struct being passed in r3). + * Of course, whether or not an implicit reference pointer + * is present will shift the remaining arguments, + * so you need to get this right for ELFv2 in order + * to get the arguments correct. */ + + struct struct_attributes struct_attr; + struct_attr.homogeneous = NOINIT; + struct_attr.nb_elements = 0; + size_t ret_size = 0; + context->ret_struct = 0; + + if (ret_info->type == ARGTYPE_STRUCT) { + get_struct_attribut(ret_info, proc, &ret_size, &struct_attr); + + if (((struct_attr.homogeneous == HOMOGENEOUS_NESTED_FLOAT) && + (struct_attr.nb_elements > 8)) || + (((struct_attr.homogeneous == HOMOGENEOUS) || + (struct_attr.homogeneous == HETEROGENEOUS)) && + (ret_size > 16))) + + context->ret_struct = 1; + } +#endif if (context->ret_struct) context->greg++; @@ -275,6 +381,56 @@ return allocate_stack_slot(ctx, proc, info, valuep); } +struct arg_type_info * +arch_type_get_fp_equivalent(struct arg_type_info *info, struct Process *proc) +{ +#if _CALL_ELF != 2 + info = type_get_fp_equivalent(info); + return info; +#else + struct struct_attributes struct_attr; + struct_attr.homogeneous = NOINIT; + struct_attr.nb_elements = 0; + size_t ret_size = 0; + + if (info->type == ARGTYPE_STRUCT) { + enum arg_type elm_type = + get_struct_attribut(info, proc, &ret_size, &struct_attr); + + if ((struct_attr.nb_elements <= 8) && + ((struct_attr.homogeneous == HOMOGENEOUS) || + (struct_attr.homogeneous == HOMOGENEOUS_NESTED_FLOAT)) && + ((elm_type == ARGTYPE_FLOAT) || + (elm_type == ARGTYPE_DOUBLE))) + info = struct_attr.info; + else + return NULL; + } + + switch (info->type) { + case ARGTYPE_CHAR: + case ARGTYPE_SHORT: + case ARGTYPE_INT: + case ARGTYPE_LONG: + case ARGTYPE_UINT: + case ARGTYPE_ULONG: + case ARGTYPE_USHORT: + case ARGTYPE_VOID: + case ARGTYPE_ARRAY: + case ARGTYPE_POINTER: + return NULL; + + case ARGTYPE_FLOAT: + case ARGTYPE_DOUBLE: + return info; + + case ARGTYPE_STRUCT: + abort(); + } + abort(); +#endif +} + static int allocate_argument(struct fetch_context *ctx, struct Process *proc, struct arg_type_info *info, struct value *valuep) @@ -327,6 +483,28 @@ if (sz == (size_t)-1) return -1; size_t slots = (sz + width - 1) / width; /* Round up. */ +#if _CALL_ELF == 2 + if (info->type == ARGTYPE_STRUCT) { + enum arg_type elm_type; + struct struct_attributes struct_attr; + struct_attr.homogeneous = NOINIT; + struct_attr.nb_elements = 0; + size_t dummy = 0; + + elm_type = + get_struct_attribut(info, proc, &dummy, &struct_attr); + if ((struct_attr.nb_elements <= 8) && + ((struct_attr.homogeneous == HOMOGENEOUS) || + (struct_attr.homogeneous == HOMOGENEOUS_NESTED_FLOAT)) && + (elm_type == ARGTYPE_FLOAT)) { + /* adjust sizes for float */ + width = 4; + sz = width * struct_attr.nb_elements; + slots = (size_t)struct_attr.nb_elements; + } + } +#endif + unsigned char *buf = value_reserve(valuep, slots * width); if (buf == NULL) return -1; @@ -344,7 +522,7 @@ aggregates within aggregates ad infinitum. */ int rc; struct arg_type_info *fp_info - = type_get_fp_equivalent(valuep->type); + = arch_type_get_fp_equivalent(valuep->type, proc); if (fp_info != NULL) rc = allocate_float(ctx, proc, fp_info, &val); else @@ -356,13 +534,18 @@ } value_destroy(&val); +#if _CALL_ELF != 2 /* Bail out if we failed or if we are dealing with * FP-equivalent. Those don't need the adjustments * made below. */ if (rc < 0 || fp_info != NULL) +#else + if (rc < 0) +#endif return rc; } +#ifndef __LITTLE_ENDIAN__ /* Small values need post-processing. */ if (sz < width) { switch (info->type) { @@ -394,7 +577,7 @@ break; } } - +#endif return 0; } Index: b/sysdeps/linux-gnu/ppc/plt.c =================================================================== --- a/sysdeps/linux-gnu/ppc/plt.c +++ b/sysdeps/linux-gnu/ppc/plt.c @@ -113,7 +113,11 @@ */ #define PPC_PLT_STUB_SIZE 16 +#if _CALL_ELF != 2 #define PPC64_PLT_STUB_SIZE 8 //xxx +#else +#define PPC64_PLT_STUB_SIZE 4 //xxx +#endif static inline int host_powerpc64() @@ -221,7 +225,11 @@ if ((insn1 & BRANCH_MASK) == B_INSN || ((insn2 & BRANCH_MASK) == B_INSN /* XXX double cast */ +#ifdef __LITTLE_ENDIAN__ + && (ppc_branch_dest(libsym->enter_addr + 4, insn1) +#else && (ppc_branch_dest(libsym->enter_addr + 4, insn2) +#endif == (void*)(long)libsym->lib->arch.pltgot_addr))) mark_as_resolved(libsym, libsym->arch.resolved_value); @@ -249,7 +257,11 @@ * that case we put brakpoints to PLT entries the same * as the PPC32 secure PLT case does. */ assert(lte->arch.plt_stub_vma != 0); +#if _CALL_ELF == 2 + return lte->arch.plt_stub_vma -4 + PPC64_PLT_STUB_SIZE * ndx; +#else return lte->arch.plt_stub_vma + PPC64_PLT_STUB_SIZE * ndx; +#endif } } @@ -261,6 +273,7 @@ arch_translate_address_dyn(struct Process *proc, arch_addr_t addr, arch_addr_t *ret) { +#if _CALL_ELF != 2 if (proc->e_machine == EM_PPC64) { uint64_t value; if (read_target_8(proc, addr, &value) < 0) { @@ -274,7 +287,7 @@ *ret = (arch_addr_t)(uintptr_t)value; return 0; } - +#endif *ret = addr; return 0; } @@ -283,7 +296,8 @@ arch_translate_address(struct ltelf *lte, arch_addr_t addr, arch_addr_t *ret) { - if (lte->ehdr.e_machine == EM_PPC64) { + if (lte->ehdr.e_machine == EM_PPC64 && + (lte->ehdr.e_flags & 3) != 2 ) { /* XXX The double cast should be removed when * arch_addr_t becomes integral type. */ GElf_Xword offset @@ -429,6 +443,7 @@ arch_elf_init(struct ltelf *lte, struct library *lib) { if (lte->ehdr.e_machine == EM_PPC64 + && (lte->ehdr.e_flags & 3) != 2 && load_opd_data(lte, lib) < 0) return -1; @@ -569,7 +584,7 @@ uint64_t l; /* XXX double cast. */ if (read_target_8(proc, (arch_addr_t)(uintptr_t)addr, &l) < 0) { - fprintf(stderr, "ptrace .plt slot value @%#" PRIx64": %s\n", + debug(DEBUG_EVENT, "ptrace .plt slot value @%#" PRIx64": %s", addr, strerror(errno)); return -1; } @@ -652,8 +667,17 @@ || plt_slot_addr < lte->plt_addr + lte->plt_size); GElf_Addr plt_slot_value; - if (read_plt_slot_value(proc, plt_slot_addr, &plt_slot_value) < 0) + if (read_plt_slot_value(proc, plt_slot_addr, &plt_slot_value) < 0) { +#if _CALL_ELF != 2 return plt_fail; +#else + /* With ABIv2, depending on how libc.so and ld.so are + constructed (see Debian/Ubuntu) stub area may not + be initialized requiring the common process to do it + usually making symbols latent */ + return plt_default; +#endif + } char *name = strdup(a_name); struct library_symbol *libsym = malloc(sizeof(*libsym)); @@ -846,9 +870,11 @@ (struct process_stopping_handler *); case PPC_DEFAULT: +#if _CALL_ELF !=2 assert(proc->e_machine == EM_PPC); assert(bp->libsym != NULL); assert(bp->libsym->lib->arch.bss_plt_prelinked == 0); +#endif /* Fall through. */ case PPC_PLT_UNRESOLVED: Index: b/sysdeps/linux-gnu/ppc/trace.c =================================================================== --- a/sysdeps/linux-gnu/ppc/trace.c +++ b/sysdeps/linux-gnu/ppc/trace.c @@ -64,7 +64,11 @@ && WSTOPSIG(status) == (SIGTRAP | proc->tracesysgood)) { long pc = (long)get_instruction_pointer(proc); int insn = +#ifndef __LITTLE_ENDIAN__ (int)ptrace(PTRACE_PEEKTEXT, proc->pid, pc - sizeof(long), +#else + (int)ptrace(PTRACE_PEEKTEXT, proc->pid, pc - sizeof(int), +#endif 0); if (insn == SYSCALL_INSN) { @@ -122,13 +126,19 @@ int insn_count; arch_addr_t addr = ip; for (insn_count = 0; ; ++insn_count) { +#if (!defined(__LITTLE_ENDIAN__)) || (_CALL_ELF == 2) addr += 4; +#endif unsigned long l = ptrace(PTRACE_PEEKTEXT, proc->pid, addr, 0); if (l == (unsigned long)-1 && errno) return -1; uint32_t insn; #ifdef __powerpc64__ +#ifdef __LITTLE_ENDIAN__ + insn = (uint32_t) l ; +#else insn = l >> 32; +#endif #else insn = l; #endif debian/patches/Set-child-stack-alignment-in-trace-clone.c.patch0000664000000000000000000000216412312577754021572 0ustar Author: Petr Machata Description: Set child stack alignment in trace-clone.c This is important on aarch64, which requires 16-byte aligned stack pointer. This might be relevant on other arches as well, I suspect we just happened to get the 16-byte boundary in some cases. Applied-Upstream: http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=commit;h=0b5457a9e59978bcd2eb5240f54838910365a93c Last-Update: 2014-03-13 Index: ltrace/testsuite/ltrace.minor/trace-clone.c =================================================================== --- ltrace.orig/testsuite/ltrace.minor/trace-clone.c 2014-03-12 16:13:44.075726000 -0600 +++ ltrace/testsuite/ltrace.minor/trace-clone.c 2014-03-12 16:16:14.593150571 -0600 @@ -8,6 +8,7 @@ #include #include #include +#include int child () { @@ -22,7 +23,8 @@ int main () { pid_t pid; - static char stack[STACK_SIZE]; + static __attribute__ ((aligned (16))) char stack[STACK_SIZE]; + #ifdef __ia64__ pid = __clone2((myfunc)&child, stack, STACK_SIZE, CLONE_FS, NULL); #else debian/patches/series0000664000000000000000000000052512312577754012053 0ustar 01-avoid-libstdc++ 02-printf-p 03-alpha-debug.h 04-compile-warning 05-sparc-ftbfs 06-unexpected-breakpoint ptrace.diff ppc64el.diff Move-get_hfa_type-from-IA64-backend-to-type.c-name-i.patch Set-child-stack-alignment-in-trace-clone.c.patch Implement-aarch64-support.patch add-missing-stdint.h-include.patch Add-missing-include-stdio.h.patch debian/patches/03-alpha-debug.h0000664000000000000000000000071612261303275013366 0ustar From: Juan Cespedes Description: fixed FTBFS on alpha don't include "debug.h" twice Last-Update: 2014-01-02 Bug-Debian: http://bugs.debian.org/678721 --- ltrace-0.7.3.orig/sysdeps/linux-gnu/alpha/trace.c +++ ltrace-0.7.3/sysdeps/linux-gnu/alpha/trace.c @@ -29,7 +29,6 @@ #include "proc.h" #include "common.h" -#include "debug.h" #if (!defined(PTRACE_PEEKUSER) && defined(PTRACE_PEEKUSR)) # define PTRACE_PEEKUSER PTRACE_PEEKUSR debian/patches/01-avoid-libstdc++0000664000000000000000000000175412261302656013644 0ustar From: Juan Cespedes Description: avoid warning from dpkg-shlibdeps: package could avoid a useless dependency if ltrace was not linked against libstdc++.so.6 (it uses none of the library's symbols) Last-Update: 2013-12-30 --- a/configure.ac 2013-09-17 01:04:28.000000000 +0200 +++ b/configure.ac 2013-12-30 12:24:20.000000000 +0100 @@ -113,6 +113,15 @@ libstdcxx_LIBS=""]) AC_SUBST(libstdcxx_LIBS) +if test "x$liberty_LIBS" != "x" +then + libsupcxx_LIBS="" + libstdcxx_LIBS="" +elif test "x$libsupcxx_LIBS" != "x" +then + libstdcxx_LIBS="" +fi + dnl Check security_get_boolean_active availability. AC_CHECK_HEADERS(selinux/selinux.h) --- a/configure 2013-09-17 01:07:46.000000000 +0100 +++ b/configure 2013-12-30 12:34:23.000000000 +0100 @@ -11826,6 +11826,15 @@ +if test "x$liberty_LIBS" != "x" +then + libsupcxx_LIBS="" + libstdcxx_LIBS="" +elif test "x$libsupcxx_LIBS" != "x" +then + libstdcxx_LIBS="" +fi + for ac_header in selinux/selinux.h do : debian/patches/ptrace.diff0000664000000000000000000000462412332504242012732 0ustar Description: try to make PTRACE scope sysctl more discoverable. Updated: 2014-05-07 Index: ltrace-0.7.3/sysdeps/linux-gnu/trace.c =================================================================== --- ltrace-0.7.3.orig/sysdeps/linux-gnu/trace.c 2014-05-07 15:17:07.949872643 -0400 +++ ltrace-0.7.3/sysdeps/linux-gnu/trace.c 2014-05-07 15:24:08.077866134 -0400 @@ -49,7 +49,7 @@ #include "type.h" void -trace_fail_warning(pid_t pid) +trace_fail_warning(pid_t pid, int err) { /* This was adapted from GDB. */ #ifdef HAVE_LIBSELINUX @@ -66,6 +66,11 @@ "tracing other processes. You can disable this process attach protection by\n" "issuing 'setsebool deny_ptrace=0' in the superuser context.\n"); #endif /* HAVE_LIBSELINUX */ + if (err == EPERM) + fprintf(stderr, + "Could not attach to process. If your uid matches the uid of the target\n" + "process, check the setting of /proc/sys/kernel/yama/ptrace_scope, or try\n" + "again as the root user. For more details, see /etc/sysctl.d/10-ptrace.conf\n"); } void @@ -73,8 +78,9 @@ { debug(DEBUG_PROCESS, "trace_me: pid=%d", getpid()); if (ptrace(PTRACE_TRACEME, 0, 0, 0) < 0) { + int errno_save = errno; perror("PTRACE_TRACEME"); - trace_fail_warning(getpid()); + trace_fail_warning(getpid(), errno_save); exit(1); } } Index: ltrace-0.7.3/backend.h =================================================================== --- ltrace-0.7.3.orig/backend.h 2014-05-07 15:03:16.000000000 -0400 +++ ltrace-0.7.3/backend.h 2014-05-07 15:25:00.805865317 -0400 @@ -150,7 +150,7 @@ /* Called when trace_me or primary trace_pid fail. This may plug in * any platform-specific knowledge of why it could be so. */ -void trace_fail_warning(pid_t pid); +void trace_fail_warning(pid_t pid, int err); /* A pair of functions called to initiate a detachment request when * ltrace is about to exit. Their job is to undo any effects that Index: ltrace-0.7.3/proc.c =================================================================== --- ltrace-0.7.3.orig/proc.c 2014-05-07 15:03:16.000000000 -0400 +++ ltrace-0.7.3/proc.c 2014-05-07 15:24:42.881865595 -0400 @@ -496,9 +496,10 @@ /* First, see if we can attach the requested PID itself. */ if (open_one_pid(pid)) { + int errno_save = errno; fprintf(stderr, "Cannot attach to pid %u: %s\n", pid, strerror(errno)); - trace_fail_warning(pid); + trace_fail_warning(pid, errno_save); return; } debian/patches/04-compile-warning0000664000000000000000000000170512261315410014054 0ustar From: Juan Cespedes Description: Fix compile warning Last-Update: 2014-01-02 Forwarded: not-needed --- ltrace-0.7.3.orig/value.c +++ ltrace-0.7.3/value.c @@ -284,7 +284,7 @@ value_init_deref(struct value *ret_val, /* We need "long" to be long enough to hold platform * pointers. */ - typedef char assert__long_enough_long[-(sizeof(l) < sizeof(void *))]; + (void)sizeof(char[1 - 2*(sizeof(l) < sizeof(void *))]); value_common_init(ret_val, valp->inferior, valp, valp->type->u.ptr_info.info, 0); --- ltrace-0.7.3.orig/lens_default.c +++ ltrace-0.7.3/lens_default.c @@ -344,7 +344,7 @@ format_array(FILE *stream, struct value { /* We need "long" to be long enough to cover the whole address * space. */ - typedef char assert__long_enough_long[-(sizeof(long) < sizeof(void *))]; + (void)sizeof(char[1 - 2*(sizeof(long) < sizeof(void *))]); long l; if (expr_eval_word(length, value, arguments, &l) < 0) return -1; debian/patches/02-printf-p0000664000000000000000000000115712261303307012521 0ustar From: Juan Cespedes Description: Prevent freeing static-alloc'd memory for %p and %n in printf Bug-Debian: http://bugs.debian.org/614994 Forwarded: http://lists.alioth.debian.org/pipermail/ltrace-devel/2013-September/000953.html Last-Update: 2014-01-02 --- ltrace-0.7.3.orig/printf.c +++ ltrace-0.7.3/printf.c @@ -168,7 +168,7 @@ form_next_param(struct param_enum *self, type_init_pointer(infop, array, 1); } else if (format_type == ARGTYPE_POINTER) { - type_init_pointer(infop, elt_info, 1); + type_init_pointer(infop, elt_info, 0); } else { *infop = *type_get_simple(format_type); debian/patches/Move-get_hfa_type-from-IA64-backend-to-type.c-name-i.patch0000664000000000000000000001167312312577754023202 0ustar Author: Petr Machata Description: Move get_hfa_type from IA64 backend to type.c, name it type_get_hfa_type Applied-Upstream: http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=commit;h=982cbca34b2b49a158086ff5f43eb9bba89edead Last-Update: 2014-03-13 Index: ltrace/sysdeps/linux-gnu/ia64/fetch.c =================================================================== --- ltrace.orig/sysdeps/linux-gnu/ia64/fetch.c 2014-03-12 16:13:44.075726000 -0600 +++ ltrace/sysdeps/linux-gnu/ia64/fetch.c 2014-03-13 09:32:30.504762084 -0600 @@ -1,6 +1,6 @@ /* * This file is part of ltrace. - * Copyright (C) 2012 Petr Machata, Red Hat Inc. + * Copyright (C) 2012,2013 Petr Machata, Red Hat Inc. * Copyright (C) 2008,2009 Juan Cespedes * Copyright (C) 2006 Steve Fink * Copyright (C) 2006 Ian Wienand @@ -249,37 +249,6 @@ return 0; } -static enum arg_type -get_hfa_type(struct arg_type_info *info, size_t *countp) -{ - size_t n = type_aggregate_size(info); - if (n == (size_t)-1) - return ARGTYPE_VOID; - - enum arg_type type = ARGTYPE_VOID; - *countp = 0; - - while (n-- > 0) { - struct arg_type_info *emt = type_element(info, n); - - enum arg_type emt_type = emt->type; - size_t emt_count = 1; - if (emt_type == ARGTYPE_STRUCT || emt_type == ARGTYPE_ARRAY) - emt_type = get_hfa_type(emt, &emt_count); - - if (type == ARGTYPE_VOID) { - if (emt_type != ARGTYPE_FLOAT - && emt_type != ARGTYPE_DOUBLE) - return ARGTYPE_VOID; - type = emt_type; - } - if (emt_type != type) - return ARGTYPE_VOID; - *countp += emt_count; - } - return type; -} - static int allocate_hfa(struct fetch_context *ctx, struct Process *proc, struct arg_type_info *info, struct value *valuep, @@ -380,10 +349,11 @@ * floating-point registers, beginning with f8. */ if (info->type == ARGTYPE_STRUCT || info->type == ARGTYPE_ARRAY) { size_t hfa_size; - enum arg_type hfa_type = get_hfa_type(info, &hfa_size); - if (hfa_type != ARGTYPE_VOID && hfa_size <= 8) + struct arg_type_info *hfa_info + = type_get_hfa_type(info, &hfa_size); + if (hfa_info != NULL && hfa_size <= 8) return allocate_hfa(ctx, proc, info, valuep, - hfa_type, hfa_size); + hfa_info->type, hfa_size); } /* Integers and pointers are passed in r8. 128-bit integers @@ -409,7 +379,7 @@ struct arg_type_info *info, struct value *valuep) { switch (info->type) { - enum arg_type hfa_type; + struct arg_type_info *hfa_info; size_t hfa_size; case ARGTYPE_VOID: @@ -421,10 +391,10 @@ return allocate_float(ctx, proc, info, valuep, 1); case ARGTYPE_STRUCT: - hfa_type = get_hfa_type(info, &hfa_size); - if (hfa_type != ARGTYPE_VOID) + hfa_info = type_get_hfa_type(info, &hfa_size); + if (hfa_info != NULL) return allocate_hfa(ctx, proc, info, valuep, - hfa_type, hfa_size); + hfa_info->type, hfa_size); /* Fall through. */ case ARGTYPE_CHAR: case ARGTYPE_SHORT: Index: ltrace/type.c =================================================================== --- ltrace.orig/type.c 2014-03-12 16:13:44.075726000 -0600 +++ ltrace/type.c 2014-03-13 09:32:30.504762084 -0600 @@ -568,3 +568,39 @@ } abort(); } + +struct arg_type_info * +type_get_hfa_type(struct arg_type_info *info, size_t *countp) +{ + assert(info != NULL); + if (info->type != ARGTYPE_STRUCT + && info->type != ARGTYPE_ARRAY) + return NULL; + + size_t n = type_aggregate_size(info); + if (n == (size_t)-1) + return NULL; + + struct arg_type_info *ret = NULL; + *countp = 0; + + while (n-- > 0) { + struct arg_type_info *emt = type_element(info, n); + + size_t emt_count = 1; + if (emt->type == ARGTYPE_STRUCT || emt->type == ARGTYPE_ARRAY) + emt = type_get_hfa_type(emt, &emt_count); + if (emt == NULL) + return NULL; + if (ret == NULL) { + if (emt->type != ARGTYPE_FLOAT + && emt->type != ARGTYPE_DOUBLE) + return NULL; + ret = emt; + } + if (emt->type != ret->type) + return NULL; + *countp += emt_count; + } + return ret; +} Index: ltrace/type.h =================================================================== --- ltrace.orig/type.h 2014-03-12 16:13:44.075726000 -0600 +++ ltrace/type.h 2014-03-13 09:32:30.504762084 -0600 @@ -1,6 +1,6 @@ /* * This file is part of ltrace. - * Copyright (C) 2011,2012 Petr Machata, Red Hat Inc. + * Copyright (C) 2011,2012,2013 Petr Machata, Red Hat Inc. * Copyright (C) 1997-2009 Juan Cespedes * * This program is free software; you can redistribute it and/or @@ -142,4 +142,13 @@ * type. */ struct arg_type_info *type_get_fp_equivalent(struct arg_type_info *info); +/* If INFO is homogeneous floating-point aggregate, return the + * corresponding floating point type, and set *COUNTP to number of + * fields of the structure. Otherwise return NULL. INFO is a HFA if + * it's an aggregate whose each field is either a HFA, or a + * floating-point type. */ +struct arg_type_info *type_get_hfa_type(struct arg_type_info *info, + size_t *countp); + + #endif /* TYPE_H */ debian/patches/add-missing-stdint.h-include.patch0000664000000000000000000000153412312577754017231 0ustar Author: dann frazier Description: add missing include aarch64's fetch.c uses the uintptr_t typedef defined by stdint.h without including it. This doesn't currently cause a build failure because stdint.h is indirectly included via proc.h. Applied-Upstream: http://anonscm.debian.org/gitweb/?p=collab-maint/ltrace.git;a=commitdiff;h=e9919d980a5b6fc2417d7c05d46329b442467940 Last-Update: 2014-03-17 Index: ltrace/sysdeps/linux-gnu/aarch64/fetch.c =================================================================== --- ltrace.orig/sysdeps/linux-gnu/aarch64/fetch.c 2014-03-12 16:23:25.382866486 -0600 +++ ltrace/sysdeps/linux-gnu/aarch64/fetch.c 2014-03-12 16:25:38.492638417 -0600 @@ -22,6 +22,7 @@ #include #include #include +#include #include "fetch.h" #include "proc.h" debian/copyright0000664000000000000000000000306612047446004011131 0ustar This is the Debian GNU/Linux's prepackaged version of the Dynamic Library Tracer ``ltrace''. It was downloaded from http://www.ltrace.org/ Copyrights ---------- Copyright (C) 1997-2009 Juan Cespedes ARMLinux port: Copyright (C) 1998 Pat Beirne m68k port: Copyright (C) 1998 Roman Hodek Misc fixes: Copyright (C) 1999 Morten Eriksen s390 port: Copyright (C) 2001 IBM Poughkeepsie, IBM Cororation ELF hacking: Copyright (C) 1999 Silvio Cesare PowerPC port: Copyright (C) 2001-2002 Anton Blanchard SPARC port: Copyright (C) 1999 Jakub Jelinek C++ demangle: Copyright 1989-1997 Free Software Foundation, Inc. License ------- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A copy of the GNU General Public License is available as `/usr/share/common-licenses/GPL' in the Debian GNU/Linux distribution or on the World Wide Web at `http://www.gnu.org/copyleft/gpl.html'. You can also obtain it by writing to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA debian/rules0000775000000000000000000000073612312577754010273 0ustar #!/usr/bin/make -f cdbs_configure_flags := --with-libunwind=no # The configure logic for this is backwards. We need this before checking # for elfutils (ELF_C_READ_MMAP) CFLAGS=-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE include /usr/share/cdbs/1/rules/debhelper.mk include /usr/share/cdbs/1/rules/autoreconf.mk include /usr/share/cdbs/1/class/autotools.mk install/ltrace:: rm -f debian/ltrace/usr/share/doc/ltrace/COPYING* rm -f debian/ltrace/usr/share/doc/ltrace/INSTALL*