5 |
* |
* |
6 |
* Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp) |
* Author: Matthias Blume (blume@kurims.kyoto-u.ac.jp) |
7 |
*) |
*) |
8 |
structure MkBootList = |
local |
9 |
MkListFn (type element = string * (int * string) option |
structure PS = GenericVC.PersStamps |
10 |
|
type pid = PS.persstamp |
11 |
|
in |
12 |
|
structure MkBootList = struct |
13 |
|
fun group listName g = let |
14 |
|
val Nil = { l = [], ss = StableSet.empty } |
15 |
|
fun Cons ({ x, s = NONE }, { l, ss }) = { l = x :: l, ss = ss } |
16 |
|
| Cons ({ x, s = SOME i }, { l , ss }) = |
17 |
|
{ l = x :: l, ss = StableSet.add (ss, i) } |
18 |
fun bininfo i = |
fun bininfo i = |
19 |
(BinInfo.stablename i, |
case BinInfo.rts_pid i of |
20 |
SOME (BinInfo.offset i, BinInfo.describe i)) |
SOME p => { x = "#" ^ PS.toHex p, s = NONE } |
21 |
fun smlinfo i = (SmlInfo.binname i, NONE)) |
| NONE => let |
22 |
|
val x = concat [listName (BinInfo.stablename i), |
23 |
|
"@", Int.toString (BinInfo.offset i), |
24 |
|
":", BinInfo.describe i] |
25 |
|
val s = case BinInfo.sh_mode i of |
26 |
|
Sharing.DONTSHARE => NONE |
27 |
|
| _ => SOME i |
28 |
|
in { x = x, s = s } |
29 |
|
end |
30 |
|
fun smlinfo i = { x = listName (SmlInfo.binname i), s = NONE } |
31 |
|
val arg = { bininfo = bininfo, |
32 |
|
smlinfo = smlinfo, |
33 |
|
Cons = Cons, Nil = Nil } |
34 |
|
in |
35 |
|
MkList.group arg g |
36 |
|
end |
37 |
|
end |
38 |
|
end |