set insn_pc [dict get [lindex $bplist 0] instructionReference]
dap_check_request_and_response "start inferior" configurationDone
-dap_read_event "inferior started" thread "body reason" started
+dap_wait_for_event_and_check "inferior started" thread "body reason" started
-dap_read_event "stopped at function breakpoint" stopped \
+dap_wait_for_event_and_check "stopped at function breakpoint" stopped \
"body reason" breakpoint \
"body hitBreakpointIds" $fn_bpno
"body result" 23
dap_check_request_and_response step stepIn {o threadId [i 1]}
-dap_read_event "stopped after step" stopped "body reason" step
+dap_wait_for_event_and_check "stopped after step" stopped "body reason" step
set obj [dap_check_request_and_response "evaluate global second time" \
evaluate {o expression [s global_variable]}]
"body result" 24
dap_check_request_and_response "continue to address" continue
-dap_read_event "stopped at address breakpoint" stopped \
+dap_wait_for_event_and_check "stopped at address breakpoint" stopped \
"body reason" breakpoint \
"body hitBreakpointIds" $insn_bpno
dap_check_request_and_response "continue to line" continue
-dap_read_event "stopped at line breakpoint" stopped \
+dap_wait_for_event_and_check "stopped at line breakpoint" stopped \
"body reason" breakpoint \
"body hitBreakpointIds" $line_bpno
# A helper for dap_read_event that reads events, looking for one
# matching TYPE.
-proc _dap_read_event {type} {
+proc _dap_wait_for_event {type} {
while 1 {
# We don't do any extra error checking here for the time
# being; we'll just get a timeout thrown instead.
# between a field name (in "dict get" form) and its expected value.
#
# Returns the dict for the chosen event, or empty string on error.
-proc dap_read_event {name type args} {
+proc dap_wait_for_event_and_check {name type args} {
if {$name == ""} {
set name $type
}
- set result [_dap_read_event $type]
+ set result [_dap_wait_for_event $type]
eval dap_match_values [list $name $result] $args
return $result