Commit Graph

15 Commits

Author SHA1 Message Date
Thomas Preud'homme 3172e4c057 Add .gitignore file
Ignore pstack binary
2011-10-02 22:22:28 +02:00
Thomas Preud'homme 56bbbfe59e Remove distribution files
Remove pstack.spec and adapt Makefile to the change.
2011-10-02 22:22:28 +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
Thomas Preud'homme a0a2ced897 Remove pstack unconditionally in clean target.
Don't fail if pstack binary doesn't exist so that the clean target can be called
at any time.
2011-09-10 23:45:38 +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