mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-23 03:29:47 +08:00
gdb/testsuite/dap: use gdb_assert in gdb.dap/basic-dap.exp
Use gdb_assert instead of manual pass/fail. Change-Id: I71fbc4e37a0a1ef4783056c7424e932651fa397f
This commit is contained in:
@ -75,12 +75,7 @@ set obj [dap_check_request_and_response "reset breakpoint by line number" \
|
|||||||
[format {o source [o path [%s]] breakpoints [a [o line [i %d]]]} \
|
[format {o source [o path [%s]] breakpoints [a [o line [i %d]]]} \
|
||||||
[list s $srcfile] $line]]
|
[list s $srcfile] $line]]
|
||||||
set new_line_bpno [dap_get_breakpoint_number $obj]
|
set new_line_bpno [dap_get_breakpoint_number $obj]
|
||||||
|
gdb_assert {$new_line_bpno == $line_bpno} "re-setting kept same breakpoint number"
|
||||||
if {$new_line_bpno == $line_bpno} {
|
|
||||||
pass "re-setting kept same breakpoint number"
|
|
||||||
} else {
|
|
||||||
fail "re-setting kept same breakpoint number"
|
|
||||||
}
|
|
||||||
|
|
||||||
# This uses "&address_breakpoint_here" as the address -- this is a
|
# This uses "&address_breakpoint_here" as the address -- this is a
|
||||||
# hack because we know how this is implemented under the hood.
|
# hack because we know how this is implemented under the hood.
|
||||||
@ -131,21 +126,13 @@ dap_match_values "global value in main" [lindex $obj 0] \
|
|||||||
set obj [dap_request_and_response "evaluate non-existing variable" \
|
set obj [dap_request_and_response "evaluate non-existing variable" \
|
||||||
evaluate {o expression [s nosuchvariable]}]
|
evaluate {o expression [s nosuchvariable]}]
|
||||||
set d [namespace eval ton::2dict [lindex $obj 0]]
|
set d [namespace eval ton::2dict [lindex $obj 0]]
|
||||||
if {[dict get $d success] == "false"} {
|
gdb_assert { [dict get $d success] == "false" } "result of invalid request"
|
||||||
pass "result of invalid request"
|
|
||||||
} else {
|
|
||||||
fail "result of invalid request"
|
|
||||||
}
|
|
||||||
|
|
||||||
set obj [dap_check_request_and_response "disassemble one instruction" \
|
set obj [dap_check_request_and_response "disassemble one instruction" \
|
||||||
disassemble \
|
disassemble \
|
||||||
[format {o memoryReference [s %s] instructionCount [i 1]} \
|
[format {o memoryReference [s %s] instructionCount [i 1]} \
|
||||||
$insn_pc]]
|
$insn_pc]]
|
||||||
set d [namespace eval ton::2dict [lindex $obj 0]]
|
set d [namespace eval ton::2dict [lindex $obj 0]]
|
||||||
if {[dict exists $d body instructions]} {
|
gdb_assert { [dict exists $d body instructions] } "instructions in disassemble output"
|
||||||
pass "instructions in disassemble output"
|
|
||||||
} else {
|
|
||||||
fail "instructions in disassemble output"
|
|
||||||
}
|
|
||||||
|
|
||||||
dap_shutdown
|
dap_shutdown
|
||||||
|
Reference in New Issue
Block a user