[PATCH v2] gdb: don't pass TARGET_WNOHANG to targets that can't async (PR 26642)
Pedro Alves
pedro@palves.net
Tue Oct 13 15:44:02 GMT 2020
On 10/13/20 4:31 PM, Simon Marchi via Gdb-patches wrote:
>> +standard_testfile
>> +
>> +save_vars { GDBFLAGS } {
>> + # Enable target-async off this way, because with board
>> + # native-extended-gdbserver, the remote target is already open when
>> + # returning from prepare_for_testing, and that would be too late to toggle
>> + # it.
>> + append GDBFLAGS { -ex "maintenance set target-async off" }
>> +
>> + if { [prepare_for_testing "failed to prepare" ${testfile} ${srcfile}] } {
>> + return
>> + }
>> +
>> + # Make sure our command-line flag worked.
>> + gdb_test "maintenance show target-async" "Controlling the inferior in asynchronous mode is off\\."
>> +
>> + if { ![runto_main] } {
>> + fail "can't run to main"
>> + return
>> + }
>> +
>> + gdb_continue_to_end
>> +}
Note the save_vars scope only needs to be around prepare_for_testing.
Anyway, LGTM.
More information about the Gdb-patches
mailing list