Skip to content

Commit bb3ee98

Browse files
jcpetruzzaagastyabahl
authored andcommitted
Add reverse_attach_ref field to DAP server types
Summary: # Context When we receive a `reverse_attach` event in DAP, we check if the ref is the same as the one stored in the DAP server state. # Problem We do not have a field for `reverse_attach_ref` in the configuring and attached states. # This diff Adds a field `reverse_attach_ref` to these states that are `reference() | undefined` Reviewed By: michalmuskala Differential Revision: D81452980 fbshipit-source-id: c7e73454cddb938907e7b61f4ca69f62297cc22c Co-authored-by: Agastya Bahl <agastyabahl@meta.com>
1 parent f0ed8a0 commit bb3ee98

3 files changed

Lines changed: 4 additions & 1 deletion

File tree

edb/src/edb_dap_internal_events.erl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ paused_impl(#{state := S}, Event) ->
117117
State :: edb_dap_server:state(),
118118
Reaction :: reaction().
119119
reverse_attach_impl({attached, Node}, State0 = #{state := launching}) ->
120-
State1 = maps:without([reverse_attach_ref, shell_process_id], State0),
120+
State1 = maps:without([shell_process_id], State0),
121121

122122
% elp:ignore W0014 -- debugger relies on dist
123123
ProcessId = list_to_integer(erpc:call(Node, os, getpid, [])),

edb/src/edb_dap_request_attach.erl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@ handle(State0 = #{state := initialized}, Args) ->
8585
process_id => ProcessId
8686
},
8787
node => Node,
88+
reverse_attach_ref => undefined,
8889
cwd => edb_dap_utils:strip_suffix(Cwd, StripSourcePrefix),
8990
subscription => Subscription
9091
},

edb/src/edb_dap_server.erl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ For details see https://microsoft.github.io/debug-adapter-protocol/specification
8888
type := attach_type(),
8989
client_info := client_info(),
9090
node := node(),
91+
reverse_attach_ref := reference() | undefined,
9192
cwd := binary(),
9293
subscription := edb:event_subscription()
9394
}
@@ -97,6 +98,7 @@ For details see https://microsoft.github.io/debug-adapter-protocol/specification
9798
type := attach_type(),
9899
client_info := client_info(),
99100
node := node(),
101+
reverse_attach_ref := reference() | undefined,
100102
cwd := binary(),
101103
subscription := edb:event_subscription()
102104
}

0 commit comments

Comments
 (0)