[gdb_remote_download host ${srcdir}/${subdir}/${gdb_test_file_name}.py]
gdb_test_no_output "source ${remote_python_file}" "load python file"
+set logfile [new_dap_log_file]
+gdb_test_no_output "set debug dap-log-file $logfile" "set dap log file"
+
gdb_test_multiple "python check_everything()" "type checker" {
-re -wrap "OK" {
pass $gdb_test_name
# is restarted.
set dap_seq 1
+# Return the current DAP log file.
+proc current_dap_log_file {} {
+ global dap_gdb_instance
+ return [standard_output_file "dap.log.$dap_gdb_instance"]
+}
+
+# Return a new DAP log file.
+proc new_dap_log_file {} {
+ global dap_gdb_instance
+ incr dap_gdb_instance
+ return [current_dap_log_file]
+}
+
# Start gdb using the DAP interpreter.
proc dap_gdb_start {} {
# Keep track of the number of times GDB has been launched.
gdb_stdin_log_init
- global dap_gdb_instance
- incr dap_gdb_instance
-
global GDBFLAGS stty_init
save_vars { GDBFLAGS stty_init } {
set stty_init "-echo raw"
- set logfile [standard_output_file "dap.log.$dap_gdb_instance"]
+ set logfile [new_dap_log_file]
append GDBFLAGS " -iex \"set debug dap-log-file $logfile\" -q -i=dap"
set res [gdb_spawn]
if {$res != 0} {
# Read the most recent DAP log file and check it for exceptions.
proc dap_check_log_file {} {
- global dap_gdb_instance
-
- set fd [open [standard_output_file "dap.log.$dap_gdb_instance"]]
+ set fd [open [current_dap_log_file]]
set contents [read $fd]
close $fd