+2019-05-17 Alan Hayward <alan.hayward@arm.com>
+
+ * lib/gdb.exp (default_gdb_spawn): Call gdb_write_cmd_file.
+ (gdb_write_cmd_file): New procedure.
+ * lib/gdbserver-support.exp (gdbserver_start): Call
+ gdbserver_write_cmd_file.
+ (gdbserver_write_cmd_file): New procedure.
+
2019-05-17 Alan Hayward <alan.hayward@arm.com>
* lib/gdb.exp (gdb_unload): Mark Y as an answer.
set use_gdb_stub [target_info exists use_gdb_stub]
verbose "Spawning $GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
+ gdb_write_cmd_file "$GDB $INTERNAL_GDBFLAGS $GDBFLAGS"
if [info exists gdb_spawn_id] {
return 0
puts -nonewline $in_file "$message"
}
+# Write the command line used to invocate gdb to the cmd file.
+
+proc gdb_write_cmd_file { cmdline } {
+ set logfile [standard_output_file_with_gdb_instance gdb.cmd]
+ set cmd_file [open $logfile w]
+ puts $cmd_file $cmdline
+ catch "close $cmd_file"
+}
+
# Always load compatibility stuff.
load_lib future.exp
append gdbserver_command " $arguments"
}
+ gdbserver_write_cmd_file $gdbserver_command
+
global server_spawn_id
set server_spawn_id [remote_spawn target $gdbserver_command]
return [expr { $gdbserverdebug == "debug" || $gdbserverdebug == "remote"
|| $gdbserverdebug == "all" }]
}
+
+# Write the command line used to invocate gdbserver to the cmd file.
+
+proc gdbserver_write_cmd_file { cmdline } {
+ set logfile [standard_output_file_with_gdb_instance gdbserver.cmd]
+ set cmd_file [open $logfile w]
+ puts $cmd_file $cmdline
+ catch "close $cmd_file"
+}