Skip to content

Improve dap command execution #920

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

Merged
merged 2 commits into from
Mar 24, 2023
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
3 changes: 2 additions & 1 deletion lib/debug/server_dap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -437,10 +437,11 @@ def process
expr = req.dig('arguments', 'expression')
if /\A\s*,(.+)\z/ =~ expr
dbg_expr = $1
dbg_expr.split(';;') { |cmd| @q_msg << cmd }

send_response req,
result: "",
variablesReference: 0
debugger do: dbg_expr
else
@q_msg << req
end
Expand Down
13 changes: 13 additions & 0 deletions test/protocol/eval_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,19 @@ def test_eval_evaluates_arithmetic_expressions
req_terminate_debuggee
end
end

def test_eval_executes_commands
run_protocol_scenario PROGRAM, cdp: false do
req_add_breakpoint 3
req_continue
assert_repl_result({value: '', type: nil}, ",b 5 ;; b 6")
req_continue
assert_line_num 5
req_continue
assert_line_num 6
req_terminate_debuggee
end
end
end

class EvaluateOnSomeFramesTest < ProtocolTestCase
Expand Down