aboutsummaryrefslogtreecommitdiffstats
path: root/tools/xentrace/xenctx.c
diff options
context:
space:
mode:
authorKeir Fraser <keir.fraser@citrix.com>2007-11-16 17:08:05 +0000
committerKeir Fraser <keir.fraser@citrix.com>2007-11-16 17:08:05 +0000
commit995ee5c0f35ac981af6e226b1816534c71258be1 (patch)
tree3f7c463741b1e7956975c58b3640c4f6408788ac /tools/xentrace/xenctx.c
parentfec0543a2cb61d16bec0e9b247b7f1afbe1bee72 (diff)
downloadxen-995ee5c0f35ac981af6e226b1816534c71258be1.tar.gz
xen-995ee5c0f35ac981af6e226b1816534c71258be1.tar.bz2
xen-995ee5c0f35ac981af6e226b1816534c71258be1.zip
xentrace: make xentrace and xenmon work on Solaris and *BSD.
- Use getopt() to get rid of argp dependency which does not exist on Solaris and *BSD. Done by Tariq Magdon-Ismail. - Minor modifications by me (Christoph) to make it also work on *BSD. - Tested on Linux by me (Christoph). No functional change on Linux. - Tariq ok'd BSD modifications for Solaris - Tariq ok'd submission by me :) Signed-off-by: Tariq Magdon-Ismail <tariqmi@sun.com> Signed-off-by: Christoph Egger <Christoph.Egger@amd.com>
Diffstat (limited to 'tools/xentrace/xenctx.c')
-rw-r--r--tools/xentrace/xenctx.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/tools/xentrace/xenctx.c b/tools/xentrace/xenctx.c
index aa85025cf3..cd6cb98499 100644
--- a/tools/xentrace/xenctx.c
+++ b/tools/xentrace/xenctx.c
@@ -18,7 +18,6 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
-#include <argp.h>
#include <signal.h>
#include <string.h>
#include <inttypes.h>
@@ -32,10 +31,15 @@ int frame_ptrs = 0;
int stack_trace = 0;
#if defined (__i386__)
+#if defined (__OpenBSD__)
+#define FMT_SIZE_T "%08lx"
+#define INSTR_POINTER(regs) (unsigned long)(regs->eip)
+#else
#define FMT_SIZE_T "%08x"
+#define INSTR_POINTER(regs) (regs->eip)
+#endif
#define STACK_POINTER(regs) (regs->esp)
#define FRAME_POINTER(regs) (regs->ebp)
-#define INSTR_POINTER(regs) (regs->eip)
#define STACK_ROWS 4
#define STACK_COLS 8
#elif defined (__x86_64__)
@@ -622,7 +626,8 @@ void print_stack(vcpu_guest_context_t *ctx, int vcpu)
printf("Stack Trace:\n");
else
printf("Call Trace:\n");
- printf("%c [<" FMT_SIZE_T ">] ", stack_trace ? '*' : ' ', INSTR_POINTER(regs));
+ printf("%c [<" FMT_SIZE_T ">] ",
+ stack_trace ? '*' : ' ', INSTR_POINTER(regs));
print_symbol(INSTR_POINTER(regs));
printf(" <--\n");