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

Rethink Exec Map #306

Merged
merged 2 commits into from
Aug 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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 .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"request": "launch",
"args": [
"--extensionDevelopmentPath=${workspaceFolder}/debugger-vscode-extension",
"${workspaceFolder}/debugger-vscode-extension/sampleWorkspace"
"${workspaceFolder}/debug-ui/examples"
],
"outFiles": [
"${workspaceFolder}/debugger-vscode-extension/out/**/*.js"
Expand Down
6 changes: 2 additions & 4 deletions GillianCore/debugging/adapter/lifecycle.ml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ module Make (Debugger : Debugger.S) = struct
(module Configuration_done_command)
(fun _ ->
let open Launch_command.Arguments in
if not launch_args.stop_on_entry then (
if not launch_args.stop_on_entry then
let stop_reason = Debugger.run ~launch:true dbg in
match stop_reason with
| Step ->
Expand All @@ -34,9 +34,7 @@ module Make (Debugger : Debugger.S) = struct
Stopped_event.Payload.(
make ~reason:Stopped_event.Payload.Reason.Exception
~thread_id:(Some 0) ())
| reason ->
dbg |> Debugger.jump_to_start;
send_stopped_events dbg rpc reason)
| reason -> send_stopped_events dbg rpc reason
else
Debug_rpc.send_event rpc
(module Stopped_event)
Expand Down
23 changes: 5 additions & 18 deletions GillianCore/debugging/debugger/base_debugger.ml
Original file line number Diff line number Diff line change
Expand Up @@ -462,29 +462,16 @@ struct

let build_final_cmd_data content result prev_id branch_path debug_state =
let cmd = content |> of_yojson_string Logging.ConfigReport.of_yojson in
let proc_name = (List.hd cmd.callstack).pid in
let errors = show_result_errors result in
let matches = match_final_cmd prev_id ~proc_name result debug_state in
let exec_data =
Lift.make_executed_cmd_data Exec_map.Final prev_id cmd ~matches ~errors
let proc_name = (List.hd cmd.callstack).pid in
let errors = show_result_errors result in
let matches = match_final_cmd prev_id ~proc_name result debug_state in
let next_kind = Exec_map.Zero in
Lift.make_executed_cmd_data next_kind prev_id cmd ~matches ~errors
branch_path
in
(exec_data, cmd)

let jump_to_start (state : t) =
let { debug_state; _ } = state in
let proc_state = get_proc_state_exn state in
let result =
let** root_id =
proc_state.lifter_state |> Lifter.get_root_id
|> Option.to_result ~none:"Debugger.jump_to_start: No root id found!"
in
jump_state_to_id root_id debug_state proc_state
in
match result with
| Error msg -> failwith msg
| Ok () -> ()

module Step = struct
open Verification.SAInterpreter.Logging

Expand Down
1 change: 0 additions & 1 deletion GillianCore/debugging/debugger/debugger_intf.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ module type S = sig

val launch : string -> string option -> (t, string) result
val jump_to_id : Logging.Report_id.t -> t -> (unit, string) result
val jump_to_start : t -> unit
val step_in : t -> stop_reason
val step : ?reverse:bool -> t -> stop_reason

Expand Down
5 changes: 0 additions & 5 deletions GillianCore/debugging/lifter/gil_fallback_lifter.ml
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,6 @@ functor
| Some tl -> tl |> TLLifter.get_matches_at_id id
| None -> gil |> Gil_lifter.get_matches_at_id id

let get_root_id { gil; tl; _ } =
match tl with
| Some tl -> tl |> TLLifter.get_root_id
| None -> gil |> Gil_lifter.get_root_id

let memory_error_to_exception_info = TLLifter.memory_error_to_exception_info
let add_variables = TLLifter.add_variables

Expand Down
Loading
Loading