Commit Graph

17 次程式碼提交

作者 SHA1 備註 提交日期
Thomas Preud'homme f0aa8400b7 Ignore VDSO object
Do not try to load symbols from VDSO as it does not correspond to any
file on disk.
2014-02-28 23:27:45 +08:00
Thomas Preud'homme 8a440f169b Error out if no object file header
Quit the program if object file header can't be read or is smaller than
expected.
2011-10-05 22:56:37 +02:00
Thomas Preud'homme a8f2e34c5f Make struct used by PTRACE_GETREGS arch-dependant
Structure used by ptrace in PTRACE_GETREGS mode is unfortunetely
arch-dependant. Although pt_regs seems portable, it's only designed to
represent the way registers are stored on the stack during system call.
The right struct to use is defined in sys/user.h and is
user_regs_struct on x86-{32,64} and user_regs on armel.
2011-10-05 17:38:17 +02:00
Thomas Preud'homme b455f99538 Add -Wextra flags to CFLAGS and fix warnings 2011-10-03 19:32:16 +02:00
Thomas Preud'homme 6f25ab2494 Fix incorrect ptrace failure tests in crawl() 2011-10-02 23:50:22 +02:00
Thomas Preud'homme eb46b84ec3 Do not call perror in crawl() if no ptrace error
* Set error_occured in crawl() whether an error occurs or not in one of
  the ptrace call of crawl().
* Call perror at end of crawl() only if error_occured is set.
2011-10-02 20:22:02 +02:00
Thomas Preud'homme b26e46a5ae Include <endian.h> as fallback for endianness
Include <endian.h> if none of __ORDER_LITTLE_ENDIAN__ and
__ORDER_BIG_ENDIAN__ are predefined (too old version of gcc) in order to
determine endianness.
2011-10-02 19:53:16 +02:00
Thomas Preud'homme a8f2de4912 Add support for armel architecture
* Define architecture dependant macro for armel;
* Use struct pt_regs instead of struct user_regs_struct;

See http://wiki.debian.org/ArmEabiPort for more details on armel
architecture.
2011-10-02 19:50:48 +02:00
Thomas Preud'homme 22ab00d6ca Separate arch dependant and arch independant code
Extract explicit architecture dependant code into 2 sets of macros at
the beginning of the source file:
  - 1 set of macros for architecture dependant code;
  - 1 set of macros for architecture independant code.
2011-10-02 19:50:48 +02:00
Thomas Preud'homme b04a71ce9e Fix compilation on i386 arch.
Remove useless __ASSEMBLY definition as:
* it is useless
* it makes pstack fails to build
2011-09-11 15:42:59 +02:00
Thomas Preud'homme 0125e45595 Port pstack to amd64 architecture
This patch is an effort to port pstack to other architectures. So far
only amd64 is supported and there is probably still some issues in the
architecture independant code (endianness, integer range, per
architecture frame browsing, …).
2011-09-10 23:46:17 +02:00
Thomas Preud'homme ddc2702e4f Use strerror on syscall failure
Add strerror string to personalized error string on system call failure.
2011-09-10 23:46:17 +02:00
Thomas Preud'homme efb3b5d42b Don't segfault if no _DYNAMIC symbol is found
Test wether _DYNAMIC is found or not before using its value.
2011-09-10 23:46:17 +02:00
Thomas Preud'homme 8d28686a86 Fix incorrect error checking
pstack uses errno to check errors in lots of case which is wrong. According
to the errno manpage, errno is only significative when the sytem call return
an error. This patch fixes all the errno check errors.
2011-09-10 23:46:17 +02:00
Thomas Preud'homme ce2f83eaec Don't fail with shared object without name
pstack was failing with shared objects loaded by the dynamic linker which have
no name. This tiny patch makes pstack ignore those objects.
2011-09-10 23:46:17 +02:00
Baruch Even 4a2f811a5e Improve error handling
* Add a call to perror when open fails
* Uses strtol instead of atoi to handle conversion error
* Call a usage fonction when PID is incorrect
* Display target PID when failing to attach
2011-09-10 23:43:10 +02:00
Thomas Preud'homme 35824dbd12 Initial commit (pstack v1.2) 2011-08-18 17:18:25 +02:00