diff options
Diffstat (limited to 'tools')
-rw-r--r-- | tools/Makefile | 3 | ||||
-rw-r--r-- | tools/dumpobj.ml | 30 | ||||
-rwxr-xr-x | tools/make-package-macosx | 4 | ||||
-rwxr-xr-x | tools/ocaml-objcopy-macosx | 5 |
4 files changed, 28 insertions, 14 deletions
diff --git a/tools/Makefile b/tools/Makefile index 9bc1646efd..68f9049560 100644 --- a/tools/Makefile +++ b/tools/Makefile @@ -23,7 +23,8 @@ INCLUDES=-I ../utils -I ../parsing -I ../typing -I ../bytecomp -I ../asmcomp \ COMPFLAGS= -warn-error A $(INCLUDES) LINKFLAGS=$(INCLUDES) -all: ocamldep ocamlprof ocamlcp ocamlmktop ocamlmklib scrapelabels addlabels +all: ocamldep ocamlprof ocamlcp ocamlmktop ocamlmklib scrapelabels addlabels \ + dumpobj opt.opt: ocamldep.opt diff --git a/tools/dumpobj.ml b/tools/dumpobj.ml index c52942a123..3f39687024 100644 --- a/tools/dumpobj.ml +++ b/tools/dumpobj.ml @@ -14,15 +14,16 @@ (* Disassembler for executable and .cmo object files *) -open Obj -open Printf -open Config open Asttypes -open Lambda +open Config open Emitcode -open Opcodes open Instruct +open Lambda +open Location +open Obj +open Opcodes open Opnames +open Printf (* Read signed and unsigned integers *) @@ -107,6 +108,9 @@ let rec print_struct_const = function (* Print an obj *) +let same_custom x y = + Obj.field x 0 = Obj.field (Obj.repr y) 0 + let rec print_obj x = if Obj.is_block x then begin let tag = Obj.tag x in @@ -122,7 +126,13 @@ let rec print_obj x = printf "%.12g" a.(i) done; printf "|]" - end else if tag < Obj.no_scan_tag then begin + end else if tag = Obj.custom_tag && same_custom x 0l then + printf "%ldl" (Obj.magic x : int32) + else if tag = Obj.custom_tag && same_custom x 0n then + printf "%ndn" (Obj.magic x : nativeint) + else if tag = Obj.custom_tag && same_custom x 0L then + printf "%LdL" (Obj.magic x : int64) + else if tag < Obj.no_scan_tag then begin printf "<%d>" (Obj.tag x); match Obj.size x with 0 -> () @@ -388,9 +398,11 @@ let op_shapes = [ ];; let print_event ev = - printf "File \"%s\", line %d, character %d:\n" ev.ev_char.Lexing.pos_fname - ev.ev_char.Lexing.pos_lnum - (ev.ev_char.Lexing.pos_cnum - ev.ev_char.Lexing.pos_bol) + let ls = ev.ev_loc.loc_start in + let le = ev.ev_loc.loc_end in + printf "File \"%s\", line %d, characters %d-%d:\n" ls.Lexing.pos_fname + ls.Lexing.pos_lnum (ls.Lexing.pos_cnum - ls.Lexing.pos_bol) + (le.Lexing.pos_cnum - ls.Lexing.pos_bol) let print_instr ic = let pos = currpos ic in diff --git a/tools/make-package-macosx b/tools/make-package-macosx index 8822871d71..7dd79175a2 100755 --- a/tools/make-package-macosx +++ b/tools/make-package-macosx @@ -103,8 +103,8 @@ mkdir -p resources # stop here -> | cat >resources/ReadMe.txt <<EOF This package installs Objective Caml version ${VERSION}. -You need Mac OS X 10.3 (panther), with X11 and the -XCode tools installed. +You need Mac OS X 10.4.x (Tiger), with X11 and the +XCode tools (v2.2) installed. Files will be installed in the following directories: diff --git a/tools/ocaml-objcopy-macosx b/tools/ocaml-objcopy-macosx index 31070f54b5..cb2f703b4d 100755 --- a/tools/ocaml-objcopy-macosx +++ b/tools/ocaml-objcopy-macosx @@ -15,8 +15,9 @@ # $Id$ -TEMP=/tmp/ocaml-objcopy-$$.o -UNDEF=/tmp/ocaml-objcopy-$$.sym +TMP="${TMPDIR=/tmp}" +TEMP="${TMP}"/ocaml-objcopy-$$.o +UNDEF="${TMP}"/ocaml-objcopy-$$.sym usage () { echo "usage: objcopy {--redefine-sym <old>=<new>} file.o" >&2 |