autotest: restart MAVProxy if it exits when running under gdb

this is useful if you are running under GDB and ArduPilot fails early (eg. parameter sanity checks or SITL device configuration issues)
This commit is contained in:
Peter Barker 2024-10-06 12:38:37 +11:00 committed by Peter Barker
parent a8ce43426b
commit b8e84cdcd0
1 changed files with 11 additions and 0 deletions

View File

@ -986,6 +986,17 @@ def start_mavproxy(opts, stuff):
run_cmd_blocking("Run MavProxy", cmd, env=env)
progress("MAVProxy exited")
if opts.gdb:
# in the case that MAVProxy exits (as opposed to being
# killed), restart it if we are running under GDB. This
# allows ArduPilot to stop (eg. via a very early panic call)
# and have you debugging session not be killed.
while True:
progress("Running under GDB; restarting MAVProxy")
run_cmd_blocking("Run MavProxy", cmd, env=env)
progress("MAVProxy exited; sleeping 10")
time.sleep(10)
vehicle_options_string = '|'.join(vinfo.options.keys())