(* test throughput of network connection to sctl *) module HT = Hashtbl open Sctl let printlocals (pc:int64) (lt:loctab) : unit = let (_, locres) = Hashtbl.find lt pc in let printloc (l:sctlloc) = let kn = (match l.sl_kind with L_param -> "param" | L_var -> "local var") in ignore (Printf.fprintf stderr "%s %s %s %s\n" kn (formattype l.sl_type) l.sl_id (format_lexpr l.sl_lexpr)) in List.iter printloc locres let sptest () = let argn = Array.length Sys.argv in if argn < 3 then begin ignore (Printf.fprintf stderr "Supply an executable and a symbol name\n"); flush_all (); exit 1 end; let sns = ns (Array.get Sys.argv 1) in let fname = Array.get Sys.argv 2 in (match skip_prologue sns fname with Some (ent, apro) -> ignore (Printf.fprintf stderr "0x%Lx, 0x%Lx\n" ent apro) | None -> let fsym = looksym sns fname in ignore (Printf.fprintf stderr "0x%Lx, 0x%Lx\n" fsym.s_val fsym.s_val)); flush_all(); close sns.ns_sctl; ;; sptest ()