Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debugger merging #86

Merged
merged 157 commits into from
Jan 8, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
13b9c91
Add ability to launch in debug verification mode
matthew-ho Apr 12, 2021
2fb6282
Add interfact for verifier
matthew-ho Apr 8, 2021
2ce60cc
Refactor debugger and debug adapter to use functors
matthew-ho Apr 8, 2021
52852a6
Implement messy version of pausing of execution
matthew-ho Apr 9, 2021
ff369fb
Implement inspection commands with dummy data
matthew-ho Apr 9, 2021
0be345f
Refactor to have evaluate_cmd_iter call evaluate_cmd_step
matthew-ho Apr 12, 2021
c8dce1e
Add start_time to Verifier interface
matthew-ho Apr 12, 2021
50feea8
Refactor evaluate_proc to use init_evaluate_proc and modify init_eval…
matthew-ho Apr 12, 2021
67a08f0
Refactor verifier to reuse verify_up_to_procs functions
matthew-ho Apr 12, 2021
487467d
Add GInterpreter interface
matthew-ho Apr 13, 2021
7e6aafe
Implement returning call stack info
matthew-ho Apr 13, 2021
20f250f
Implement displaying of store
matthew-ho Apr 14, 2021
b7729e4
Use full_pp to display store values
matthew-ho Apr 14, 2021
d2e2ec1
esy format
matthew-ho Apr 14, 2021
73e39b0
Implement Continue command
matthew-ho Apr 14, 2021
2d6e5c6
Add location annotations to GIL parsing and display stack trace corre…
matthew-ho Apr 15, 2021
cd57941
Support one breakpoint per line
matthew-ho Apr 15, 2021
6ee07ec
Rename scopes in debugger.ml
matthew-ho Apr 15, 2021
df95481
Refactor out command handlers from debug adapter
matthew-ho Apr 15, 2021
e0183c2
Move log into debug adapter
matthew-ho Apr 15, 2021
6c59a57
esy format
matthew-ho Apr 20, 2021
e11f3e6
Add yojson functions for store
matthew-ho Apr 21, 2021
15e81de
Attempt to make any type loggable
matthew-ho Apr 21, 2021
9fb5a9f
Add loggable GADT
matthew-ho Apr 22, 2021
17013d1
Implement log specific for file reporter
matthew-ho Apr 22, 2021
e463d77
Refactor so reporters only have one log function
matthew-ho Apr 22, 2021
d3aea3b
Make debug message sof type packedPP, stop reporting store in file re…
matthew-ho Apr 23, 2021
d3045d2
Refactor content type to be a string
matthew-ho Apr 23, 2021
d90ad80
Refactor database and file reporters to be modules
matthew-ho Apr 23, 2021
e5406f3
Refactor command line to pass in reporters to remove enabled
matthew-ho Apr 23, 2021
cb1807d
Modify command line to only accept comma separated list for reporters
matthew-ho Apr 23, 2021
05a24c7
Add comments to logging module
matthew-ho Apr 24, 2021
9b67b50
Add log_specific functions for each logging level
matthew-ho Apr 24, 2021
834e4fc
Add sqlite3 library
matthew-ho Apr 24, 2021
f371b05
Attempt to use SQLite for database reporter
matthew-ho Apr 25, 2021
f1a004a
Attempt to use biniou
matthew-ho Apr 25, 2021
b84a65f
Testing if Yojson conversion is bottleneck - not really
matthew-ho Apr 25, 2021
a77f5eb
Test database reporter writing all logs to file
matthew-ho Apr 26, 2021
df30a65
Add pragra synchronous=OFF for performance and tidy
matthew-ho Apr 27, 2021
49968d7
Add *.db to gitignore
matthew-ho Apr 27, 2021
3f85c45
Use enum for storing report severity in db
matthew-ho Apr 27, 2021
70c8eec
Move process id from report id
matthew-ho Apr 27, 2021
8543814
Refactor out db operations to logDatabase
matthew-ho Apr 27, 2021
a50ad9f
Add loggable functions to Callstack.t
matthew-ho Apr 28, 2021
f27f26f
Use database query to get data in debugger
matthew-ho Apr 28, 2021
d53fb9d
Implement reverse debugging, but not forward after reversing
matthew-ho Apr 28, 2021
0719c6d
Fix not logging initial conf
matthew-ho Apr 29, 2021
8e35de5
Get reverse debugging fully working with logs that ned to be removed
matthew-ho Apr 30, 2021
5a096c3
Refactor cont_func so that report id can be returned before calling t…
matthew-ho Apr 30, 2021
145cce0
esy format debug adapter
matthew-ho Apr 30, 2021
8635e84
Fix breakpoint on first line not being hit
matthew-ho Apr 30, 2021
1169a3f
Refactor zero_or_one_row to be more robust
matthew-ho Apr 30, 2021
b2ed279
Remove unused logging in logging module
matthew-ho Apr 30, 2021
fdeba22
Fix conversion of call_stacks to frames by using call index
matthew-ho Apr 30, 2021
5acd54d
Remove old logging statements
matthew-ho May 1, 2021
f0cad36
Add dummy to yojson and of yojson functions to states and implement p…
matthew-ho May 2, 2021
0497837
Add dummy yojson functions to SMemory
matthew-ho May 2, 2021
3db501b
Implement yojson functions for wislSMemory
matthew-ho May 2, 2021
353b4c4
Add heap to yojson functions in SState
matthew-ho May 2, 2021
e4c68df
Add dummy SMemoryDisplayables
matthew-ho May 3, 2021
cd22269
Implement get_heap for states and dummy call to to_debugger_tree
matthew-ho May 3, 2021
8e13a54
Display Wisl heap
matthew-ho May 3, 2021
d8d1c6a
Use ppx_yojson_conv rather than ppx_deriving_yojson as it supports ha…
matthew-ho May 4, 2021
98a4a4d
Implement yojsonableHashtbl and use in store, callGraph, wislSHeap
matthew-ho May 4, 2021
67335d2
Implement yojsonableMap and use for wisl SFVL
matthew-ho May 4, 2021
21c4639
Comment out return normal print for now as it causes issues when comm…
matthew-ho May 4, 2021
a32b5c6
Remove unnecessary result_t type from Verifier
matthew-ho May 4, 2021
9c3310b
Make cont_func optional in debugger_state so when it has reached the …
matthew-ho May 4, 2021
0cad8fd
esy format
matthew-ho May 4, 2021
82c8750
Check whether to continue or pause on each execuiion step
matthew-ho May 4, 2021
c5f8919
Display typing env
matthew-ho May 4, 2021
6e560ce
Refactor top level scopes
matthew-ho May 5, 2021
0fda55c
Display pure formulae
matthew-ho May 5, 2021
b1f668c
Display preds
matthew-ho May 5, 2021
1a71058
Only display offset in Leafs for SMemory display as location is alrea…
matthew-ho May 6, 2021
3b07dee
Use Val.pp for displaying store
matthew-ho May 6, 2021
05c26d2
Sort heap offsets when displaying
matthew-ho May 6, 2021
954fa6e
esy format
matthew-ho May 6, 2021
0935f79
Log ConfErrs with callstack
matthew-ho May 6, 2021
7d21e7a
Store LAction error and log errors as strings in database
matthew-ho May 6, 2021
9988083
Add basic support for display an exception has occurred
matthew-ho May 6, 2021
3cb5b73
Support exception info request with basic information
matthew-ho May 6, 2021
4717d10
Display Basic action failed rather than local action failed
matthew-ho May 7, 2021
7ce820e
Modify fail command in wisl2Gil to have no special characters
matthew-ho May 7, 2021
d182020
Switch back to ppx_deriving_yojson
matthew-ho May 8, 2021
07f8fd4
Sort variable display
matthew-ho May 8, 2021
cfa0186
Add origin locations to wisl2Gil so that wisl files can be debugged
matthew-ho May 9, 2021
095fb97
Filter store to remove generated variables if not a gil file
matthew-ho May 10, 2021
30b5060
Remove unnecessary loggin
matthew-ho May 10, 2021
0a0ee21
Add DisplayFilterMap to allow tool developers to specify how to displ…
matthew-ho May 11, 2021
1801c7a
Use Fmt.hbox for pure formula and predicates
matthew-ho May 12, 2021
9a32b14
Rename step to step_in and implement step in command
matthew-ho May 12, 2021
c5ba9ab
Implement step which correctly skips over inner function calls
matthew-ho May 12, 2021
d1242d8
Implement step out request
matthew-ho May 12, 2021
a6fddf0
Implement yojson functions for JS SMemory
matthew-ho May 13, 2021
0140543
Implement displaying of JS SMemory
matthew-ho May 13, 2021
565a36a
Add location annotations to Javert Parser, fix positions of comments …
matthew-ho May 14, 2021
3c30bb3
Display JS properties as list
matthew-ho May 17, 2021
f847cb0
Pass on locations from Gillian AST to JSIL
matthew-ho May 17, 2021
4b104a9
Add option for proc name in launch config
matthew-ho May 18, 2021
0e81706
Fix displaying of wisl heap
matthew-ho May 18, 2021
a2b03ac
Raise Internal_State_Err on action failure rather than new LAction error
matthew-ho May 19, 2021
2c68349
Fix typos in wisl memory errors
matthew-ho May 19, 2021
f7c6805
Add more detail to wisl out of bounds error
matthew-ho May 19, 2021
fbab403
Fix display of wisl pointers
matthew-ho May 19, 2021
1fa60e9
Log annotated action when action is executed
matthew-ho May 20, 2021
d1edbf6
Start new phase for every cmd step
matthew-ho May 20, 2021
1dd40c7
Implement displaying double free error with location of previous free
matthew-ho May 20, 2021
f7b0a80
Make LogQueryer return None if not enabled
matthew-ho May 20, 2021
1edbcab
Add previously freed code locations to use after free error messages
matthew-ho May 20, 2021
7fc19d6
Refactor storing of errors as err_t rather than strings
matthew-ho May 21, 2021
51c49d5
Match types so we can extract memory errors in debugger
matthew-ho May 21, 2021
67f8117
Add MemoryErrorLifter and use dummy version in all memory models
matthew-ho May 21, 2021
9316ce9
Refactor Double Free to use error lifter and display variable being f…
matthew-ho May 22, 2021
c629992
Move displaying of use after free errors to error lifter
matthew-ho May 22, 2021
edc2100
Move displaying of out of bounds errors to error lifter
matthew-ho May 22, 2021
3970ae5
Make error lifter return exception info and refactor out debugger types
matthew-ho May 22, 2021
2c563c9
Make step button skip until next target language command
matthew-ho May 22, 2021
b5fb576
Move get_previously_freed_annot to wisl error lifter
matthew-ho May 22, 2021
68a24c9
Use one query for getting the previously freed annotation
matthew-ho May 22, 2021
f1bb49e
Extract location_to_display_location for add one to column positions
matthew-ho May 22, 2021
cd13e22
Add target language AST to compilation result for WISL and JS
matthew-ho May 24, 2021
ba728fa
Pass target language AST in memory error lifter and use it in wisl to…
matthew-ho May 24, 2021
6c78a37
Add basic fix for wisl missing cell resources in error description
matthew-ho May 25, 2021
6f7c74f
Display location (and offset) in unliftable missing resource error m…
matthew-ho May 26, 2021
74fb931
Fix resolve_paths in GIL_parsing to be able to deal with absolute paths
matthew-ho May 27, 2021
a107481
Ignore debug messages when reporting to database to improve performance
matthew-ho May 27, 2021
b269a3c
Fix getting of var for use after free error message
matthew-ho May 27, 2021
a60d05c
Serialize JS memory errors
matthew-ho May 27, 2021
01a4022
Fix sorting of wisl heap and rename blocks to cells
matthew-ho May 27, 2021
a3fa157
Add attempt to fold JS heap variables
matthew-ho May 29, 2021
98a6e0a
Hacky way of displaying local scope in JS
matthew-ho May 31, 2021
b827d8d
Add StoreAndSMemoryLifter
matthew-ho May 31, 2021
d4a4e58
Add store and smemory lifter and use for WISL, js heap does not displ…
matthew-ho Jun 3, 2021
b3b6d98
Remove unused debugger display filter abd displayable
matthew-ho Jun 3, 2021
5285973
Add update case to wisl error lifter
matthew-ho Jun 6, 2021
3defe87
Move status to be location value in heap display
matthew-ho Jun 6, 2021
db3455d
Rename heap to memory for wisl display
matthew-ho Jun 7, 2021
c005628
resolution for conf-sqlite3
giltho Jun 8, 2021
e20f16c
add freed internal predicate
giltho Jun 8, 2021
fe68e84
Sort WISL store
matthew-ho Jun 9, 2021
f403927
Add default memory to store and memory lifter
matthew-ho Jun 10, 2021
bc14792
Exit when reached end rather than stop
matthew-ho Jun 16, 2021
3420f06
Implement basic JS lifting for GIL
matthew-ho Jun 17, 2021
5cc66e9
Implement basic folding
matthew-ho Jun 17, 2021
7af4be0
A mostly working version of JS lifting
matthew-ho Jun 17, 2021
38aeaad
Reaching fail doesn't kill gillian
giltho Jun 19, 2021
c564108
Merge remote-tracking branch 'public/master' into debugger-merging
giltho Oct 20, 2021
13861a7
Merge branch 'master' into debugger-merging
giltho Dec 11, 2021
5428e64
Merge branch 'master' into debugger-merging
giltho Dec 13, 2021
dd87c1a
remove Yojsonable structures as they're now yojsonable in the prelude
giltho Dec 13, 2021
b7ffc92
Merge branch 'master' into debugger-merging
giltho Dec 20, 2021
49a1448
Fixes/improvement - merge branch 'master' into debugger-merging
giltho Dec 21, 2021
75cf2da
Move things around, and only one Lifter module per language
giltho Jan 7, 2022
39d72f3
Merge branch 'master' into debugger-merging
giltho Jan 7, 2022
6877d59
tiny style fixes
giltho Jan 7, 2022
d8889da
Some improvements
giltho Jan 8, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -87,4 +87,4 @@ see_deps.py
javert-test262

# Temporary databases for logs
*.db
*.db
1 change: 1 addition & 0 deletions Gillian-C/bin/gillian_c.ml
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,6 @@ module CLI =
let runners : Gillian.Bulk.Runner.t list =
[ (module CRunner); (module SRunner) ]
end)
(Debugger.Gil_to_tl_lifter.Default (SMemory) (ParserAndCompiler))

let () = CLI.main ()
2 changes: 1 addition & 1 deletion Gillian-JS/bin/dune
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
(name gillian_js)
(public_name gillian-js)
(package gillian-js)
(libraries gillian js2jsil_lib semantics test262 cosetteRunner))
(libraries gillian js2jsil_lib semantics test262 cosetteRunner debugging))

; (executable
; (name test262)
Expand Down
1 change: 1 addition & 0 deletions Gillian-JS/bin/gillian_js.ml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ module CLI =
let runners : Gillian.Bulk.Runner.t list =
[ (module Test262.Test262_runner); (module CosetteRunner) ]
end)
(Debugging.JSLifter)

let () = CLI.main ()
288 changes: 288 additions & 0 deletions Gillian-JS/lib/Debugging/JSLifter.ml
Original file line number Diff line number Diff line change
@@ -0,0 +1,288 @@
open Gil_syntax
open Semantics
open Debugger.DebuggerTypes
include
Debugger.Gil_to_tl_lifter.Default
(Semantics.Symbolic)
(Js2jsil_lib.JS2GIL_ParserAndCompiler)

let to_str pp = Fmt.to_to_string (Fmt.hbox pp)

(* TODO: All of this node stuff should be refactored to hide the scope id *)
let create_node_var name nodes get_new_scope_id (variables : variables) =
let id = get_new_scope_id () in
let () = Hashtbl.replace variables id nodes in
(id, create_node_variable name id ())

let get_store_vars store =
store
|> List.map (fun (var, value) : variable ->
let value = Fmt.to_to_string (Fmt.hbox Expr.pp) value in
create_leaf_variable var value ())
|> List.sort (fun v w -> Stdlib.compare v.name w.name)

let add_properties_vars properties get_new_scope_id (variables : variables) =
let add_lst_vars name to_string lst get_new_scope_id (variables : variables) =
let list_nodes =
List.mapi
(fun index element ->
create_leaf_variable (string_of_int index) (to_string element) ())
lst
in
let _, node = create_node_var name list_nodes get_new_scope_id variables in
node
in
let property_nodes =
properties |> Expr.Map.to_seq
|> Seq.map (fun (name, value) ->
let name = to_str Expr.pp name in
match value with
| Expr.EList lst ->
add_lst_vars name (to_str Expr.pp) lst get_new_scope_id variables
| Expr.Lit (Literal.LList lst) ->
add_lst_vars name (to_str Literal.pp) lst get_new_scope_id
variables
| _ -> create_leaf_variable name (to_str Expr.pp value) ())
|> List.of_seq
in
let _, node =
create_node_var "properties" property_nodes get_new_scope_id variables
in
node

let add_memory_vars smemory get_new_scope_id (variables : variables) =
let sorted_locs_with_vals = Symbolic.sorted_locs_with_vals smemory in
let value_nodes (loc, ((properties, domain), metadata)) : variable =
let () = ignore properties in
let properties =
add_properties_vars properties get_new_scope_id variables
in
let domain =
create_leaf_variable "domain" (to_str (Fmt.option Expr.pp) domain) ()
in
let metadata =
create_leaf_variable "metadata"
(to_str (Fmt.option ~none:(Fmt.any "unknown") Expr.pp) metadata)
()
in
let loc_id = get_new_scope_id () in
let () =
Hashtbl.replace variables loc_id [ properties; domain; metadata ]
in
create_node_variable loc loc_id ()
in
List.map value_nodes sorted_locs_with_vals

let rec add_loc_vars
(loc : string)
smemory
get_new_scope_id
(variables : variables)
(loc_to_scope_id : (string, int) Hashtbl.t) : unit =
let rec add_lit_vars name lit : variable =
match lit with
| Literal.Loc loc ->
let () =
add_loc_vars loc smemory get_new_scope_id variables loc_to_scope_id
in
let id = Hashtbl.find loc_to_scope_id loc in
create_node_variable name id ()
| LList lst ->
let nodes =
List.mapi
(fun index element ->
let name = string_of_int index in
add_lit_vars name element)
lst
in
let _, node = create_node_var name nodes get_new_scope_id variables in
node
| _ -> create_leaf_variable name (to_str Literal.pp lit) ()
in
let add_expr_vars name expr =
match expr with
| Expr.ALoc loc ->
let () =
add_loc_vars loc smemory get_new_scope_id variables loc_to_scope_id
in
let id = Hashtbl.find loc_to_scope_id loc in
create_node_variable name id ()
(* TODO: The below causes a stack overflow error in large pieces of
code, so they is probably a more efficient way to write this algorithm
or something else is just incorrect*)
(* | Expr.EList lst ->
let nodes =
List.mapi
(fun index element ->
let name = string_of_int index in
add_expr_vars name element)
lst
in
let _, node = create_node_var name nodes get_new_scope_id variables in
node
| Expr.Lit lit -> add_lit_vars name lit *)
| _ -> create_leaf_variable name (to_str Expr.pp expr) ()
in
let add_properties_vars properties =
let property_nodes =
properties |> Expr.Map.to_seq
|> Seq.map (fun (name, value) ->
let name = to_str Expr.pp name in
let field_names =
[
"descriptor_type";
"value";
"enumerable";
"writable";
"configurable";
]
in
match value with
| Expr.EList lst ->
let nodes =
if List.length lst == 5 then
(* TODO: Not sure if this is always the case *)
List.map2
(fun name element -> add_expr_vars name element)
field_names lst
else
List.mapi
(fun index element ->
let name = string_of_int index in
add_expr_vars name element)
lst
in
let _, node =
create_node_var name nodes get_new_scope_id variables
in
node
| Expr.Lit (Literal.LList lst) ->
let nodes =
if List.length lst == 5 then
List.map2
(fun name element -> add_lit_vars name element)
field_names lst
else
List.mapi
(fun index element ->
let name = string_of_int index in
add_lit_vars name element)
lst
in

let _, node =
create_node_var name nodes get_new_scope_id variables
in
node
| _ -> add_expr_vars name value)
|> List.of_seq
in
let _, node =
create_node_var "properties" property_nodes get_new_scope_id variables
in
node
in
match Hashtbl.find_opt loc_to_scope_id loc with
| None ->
let loc_id = get_new_scope_id () in
let vars =
match SHeap.get smemory loc with
| None -> []
| Some ((properties, domain), metadata_opt) ->
let metadata_node metadata_opt : variable =
let name = "metadata" in
match metadata_opt with
| None -> create_leaf_variable name "unknown" ()
| Some metadata -> (
match metadata with
| Expr.ALoc child_loc ->
let () =
add_loc_vars child_loc smemory get_new_scope_id
variables loc_to_scope_id
in
let id = Hashtbl.find loc_to_scope_id child_loc in
create_node_variable name id ()
| _ -> create_leaf_variable name
(to_str Expr.pp metadata) ())
in
let properties = add_properties_vars properties in
(* let properties =
add_properties_vars properties get_new_scope_id variables
in *)
let domain =
create_leaf_variable "domain"
(to_str (Fmt.option Expr.pp) domain)
()
in
[ properties; domain; metadata_node metadata_opt ]
in

let () = Hashtbl.replace variables loc_id vars in
Hashtbl.replace loc_to_scope_id loc loc_id
| Some _ -> ()

let add_variables
~store ~memory ~is_gil_file ~get_new_scope_id (variables : variables) =
if is_gil_file then
let store_id = get_new_scope_id () in
let memory_id = get_new_scope_id () in
let scopes : scope list =
[ { id = store_id; name = "Store" }; { id = memory_id; name = "Memory" } ]
in
let store_vars = get_store_vars store in
let memory_vars = add_memory_vars memory get_new_scope_id variables in
let vars = [ store_vars; memory_vars ] in
let () =
List.iter2
(fun (scope : scope) vars -> Hashtbl.replace variables scope.id vars)
scopes vars
in
scopes
else
let sorted_locs_with_vals = Symbolic.sorted_locs_with_vals memory in
let loc_to_scope_id = Hashtbl.create 0 in
let () =
List.iter
(fun (loc, _) ->
add_loc_vars loc memory get_new_scope_id variables loc_to_scope_id)
sorted_locs_with_vals
in
(* TODO: probably better if we got a hash map of the store *)
let local_scope =
List.filter_map
(fun (var, value) ->
if var = Js2jsil_lib.JS2JSIL_Helpers.var_sc_first then
Some (var, value)
else None)
store
in
let local_scope_loc =
if List.length local_scope == 0 then ""
else
match List.hd local_scope with
| _, Expr.EList [ _; ALoc loc ] -> loc
| _ -> ""
in
let local_id : int =
match Hashtbl.find_opt loc_to_scope_id local_scope_loc with
| None ->
let local_id = get_new_scope_id () in
let () = Hashtbl.replace variables local_id [] in
local_id
| Some local_id -> local_id
in
let global_id : int =
match Hashtbl.find_opt loc_to_scope_id "$lg" with
| None ->
let global_id = get_new_scope_id () in
let () = Hashtbl.replace variables global_id [] in
global_id
| Some global_id -> global_id
in
let scopes : scope list =
[
{ id = local_id; name = "Local Scope" };
{ id = global_id; name = "Global Scope" };
]
in
scopes
5 changes: 5 additions & 0 deletions Gillian-JS/lib/Debugging/JSLifter.mli
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
include
Gillian.Debugger.Gil_to_tl_lifter.S
with type memory = Semantics.Symbolic.t
and type memory_error = Semantics.Symbolic.err_t
and type tl_ast = Js2jsil_lib.JS2GIL_ParserAndCompiler.tl_ast
3 changes: 3 additions & 0 deletions Gillian-JS/lib/Debugging/dune
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
(library
(name debugging)
(libraries gillian semantics js2jsil_lib))
6 changes: 5 additions & 1 deletion Gillian-JS/lib/Semantics/JSILSMemory.ml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module PFS = Gillian.Symbolic.PureContext
module TypEnv = Gillian.Symbolic.TypEnv
open Gillian.Logic

module M : Gillian.Symbolic.Memory_S = struct
module M = struct
type vt = SVal.t [@@deriving yojson]

(** Type of JSIL general states *)
Expand Down Expand Up @@ -831,4 +831,8 @@ module M : Gillian.Symbolic.Memory_S = struct
List.iter (fun f -> PFS.extend pfs f) new_pfs;
mem
| _ -> raise (Failure "Bi-abduction: cannot fix cell."))

let sorted_locs_with_vals (smemory : t) =
let sorted_locs = Containers.SS.elements (SHeap.domain smemory) in
List.map (fun loc -> (loc, Option.get (SHeap.get smemory loc))) sorted_locs
end
4 changes: 2 additions & 2 deletions Gillian-JS/lib/Semantics/SFVL.mli
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
* Interface for JSIL Symbolic FV-lists *
*****************************************)

type t [@@deriving yojson]

type field_name = Gillian.Gil_syntax.Expr.t

type field_value = Gillian.Gil_syntax.Expr.t

type t = field_value Gillian.Gil_syntax.Expr.Map.t [@@deriving yojson]

val add : field_name -> field_value -> t -> t

val empty : t
Expand Down
4 changes: 2 additions & 2 deletions Gillian-JS/lib/Semantics/SHeap.ml
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ type t = {
sfvl : (string, SFVL.t) Hashtbl.t;
sdom : (string, Expr.t option) Hashtbl.t;
smet : (string, Expr.t option) Hashtbl.t;
cdmn : Var.Set.t ref;
sdmn : Var.Set.t ref;
cdmn : SS.t ref;
sdmn : SS.t ref;
}
[@@deriving yojson]

Expand Down
4 changes: 2 additions & 2 deletions Gillian-JS/lib/Semantics/dune
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
(library
(name semantics)
(libraries gillian jsil_syntax javert_utils js2jsil_lib str)
(flags :standard -open Utils -open Gillian.Utils -open Gillian.Utils.Prelude)
(preprocess
(pps ppx_deriving_yojson)))
(pps ppx_deriving_yojson))
(flags :standard -open Utils -open Gillian.Utils -open Utils.Prelude))
1 change: 1 addition & 0 deletions Gillian-JS/lib/Semantics/semantics.ml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
module Symbolic = JSILSMemory.M
module Concrete = JSILCMemory.M
module External = External.M
module SHeap = SHeap
Loading