diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/objinfo.ml | 13 | ||||
| -rw-r--r-- | tools/read_cmt.ml | 11 |
2 files changed, 19 insertions, 5 deletions
diff --git a/tools/objinfo.ml b/tools/objinfo.ml index 0eb33882a0..3eaafcca73 100644 --- a/tools/objinfo.ml +++ b/tools/objinfo.ml @@ -34,8 +34,15 @@ let input_stringlist ic len = let sect = really_input_string ic len in get_string_list sect len -let print_name_crc (name, crc) = - printf "\t%s\t%s\n" (Digest.to_hex crc) name +let dummy_crc = String.make 32 '-' + +let print_name_crc (name, crco) = + let crc = + match crco with + None -> dummy_crc + | Some crc -> Digest.to_hex crc + in + printf "\t%s\t%s\n" crc name let print_line name = printf "\t%s\n" name @@ -143,7 +150,7 @@ let dump_byte ic = | "CRCS" -> p_section "Imported units" - (input_value ic : (string * Digest.t) list) + (input_value ic : (string * Digest.t option) list) | "DLLS" -> p_list "Used DLLs" diff --git a/tools/read_cmt.ml b/tools/read_cmt.ml index 0ff9f3df77..eacba02a50 100644 --- a/tools/read_cmt.ml +++ b/tools/read_cmt.ml @@ -27,6 +27,8 @@ let arg_list = [ let arg_usage = "read_cmt [OPTIONS] FILE.cmt : read FILE.cmt and print related information" +let dummy_crc = String.make 32 '-' + let print_info cmt = let open Cmt_format in Printf.printf "module name: %s\n" cmt.cmt_modname; @@ -60,8 +62,13 @@ let print_info cmt = | Some digest -> Printf.printf "interface digest: %s\n" (Digest.to_hex digest); end; - List.iter (fun (name, digest) -> - Printf.printf "import: %s %s\n" name (Digest.to_hex digest); + List.iter (fun (name, crco) -> + let crc = + match crco with + None -> dummy_crc + | Some crc -> Digest.to_hex crc + in + Printf.printf "import: %s %s\n" name crc; ) (List.sort compare cmt.cmt_imports); Printf.printf "%!"; () |
