aboutsummaryrefslogtreecommitdiffstats
path: root/tools/debugger/pdb/Process.ml
blob: 79632b3298f6a2c856326d428be13052bfb0b2ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
(** Process.ml
 *
 *  process context implementation
 *
 *  @author copyright (c) 2005 alex ho
 *  @see <www.cl.cam.ac.uk/netos/pdb> pervasive debugger
 *  @version 1
 *)

open Int32
open Intel

type context_t =
{
  mutable domain : int;
  mutable process : int;
}

let default_context = { domain = 0; process = 0 }

let new_context dom proc = { domain = dom; process = proc }

let string_of_context ctx =
  Printf.sprintf "{process} domain: %d, process: %d"
                 ctx.domain  ctx.process

let set_domain ctx value =
  ctx.domain <- value;
  print_endline (Printf.sprintf "ctx.domain <- %d" ctx.domain)

let set_process ctx value =
  ctx.process <- value;
  print_endline (Printf.sprintf "ctx.process <- %d" ctx.process)

let get_domain ctx =
  ctx.domain

let get_process ctx =
  ctx.process