summaryrefslogtreecommitdiffstats
path: root/byterun/instrtrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'byterun/instrtrace.c')
-rw-r--r--byterun/instrtrace.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/byterun/instrtrace.c b/byterun/instrtrace.c
index 03260b41e..ef6bdcf91 100644
--- a/byterun/instrtrace.c
+++ b/byterun/instrtrace.c
@@ -30,7 +30,7 @@
extern code_t caml_start_code;
-long caml_icount = 0;
+intnat caml_icount = 0;
void caml_stop_here () {}
@@ -193,10 +193,10 @@ caml_trace_value_file (value v, code_t prog, int proglen, FILE * f)
&& (code_t) v < (code_t) ((char *) prog + proglen))
fprintf (f, "=code@%d", (code_t) v - prog);
else if (Is_long (v))
- fprintf (f, "=long%ld", Long_val (v));
+ fprintf (f, "=long%" ARCH_INTNAT_PRINTF_FORMAT "d", Long_val (v));
else if ((void*)v >= (void*)caml_stack_low
&& (void*)v < (void*)caml_stack_high)
- fprintf (f, "=stack_%d", (long*)caml_stack_high - (long*)v);
+ fprintf (f, "=stack_%d", (intnat*)caml_stack_high - (intnat*)v);
else if (Is_block (v)) {
int s = Wosize_val (v);
int tg = Tag_val (v);
@@ -259,7 +259,8 @@ caml_trace_accu_sp_file (value accu, value * sp, code_t prog, int proglen,
value *p;
fprintf (f, "accu=");
caml_trace_value_file (accu, prog, proglen, f);
- fprintf (f, "\n sp=%#lx @%d:", (long) sp, caml_stack_high - sp);
+ fprintf (f, "\n sp=%#" ARCH_INTNAT_PRINTF_FORMAT "x @%d:",
+ (intnat) sp, caml_stack_high - sp);
for (p = sp, i = 0; i < 12 + (1 << caml_trace_flag) && p < caml_stack_high;
p++, i++) {
fprintf (f, "\n[%d] ", caml_stack_high - p);