* 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.
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.
* 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.
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.
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, …).
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.
* 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