diff --git a/repos/mml/run/hello_mxtask.run b/repos/mml/run/hello_mxtask.run index 65afd02683..80b47f60b6 100644 --- a/repos/mml/run/hello_mxtask.run +++ b/repos/mml/run/hello_mxtask.run @@ -105,4 +105,50 @@ set boot_modules { append_platform_drv_boot_modules build_boot_image $boot_modules -append qemu_args "-nographic -m 64" +# +# Execute test case +# +# +set local_port 5555 + +# qemu config +append qemu_args " -display none -m 8000M " + +# connect comport 0 to stdio +append qemu_args " -serial stdio " + +# connect comport 1 with TCP port $local_port +append qemu_args " -serial chardev:uart " +append qemu_args " -chardev socket,id=uart,port=$local_port,host=localhost,server,nowait,ipv4 " + +run_genode_until {.*Remote debugging using /dev/terminal.*} 30 + +puts "GDB monitor is up, starting GDB in a new terminal" + +source ${genode_dir}/repos/ports/run/gdb_monitor.inc + +# GDB loads symbols from 'debug/ld.lib.so' +if { [have_spec nova] } { + exec ln -sf ld-nova.lib.so debug/ld.lib.so +} +if { [have_spec foc] } { + exec ln -sf ld-foc.lib.so debug/ld.lib.so +} + +set gdb_target_binary "test-gdb_monitor" + +# sequence of GDB commands to execute at startup +set gdb_cmds "" +append gdb_cmds "-ex \"target remote localhost:$local_port\" " + +append gdb_cmds [gdb_initial_breakpoint_cmds $gdb_target_binary] + +# ask the user for confirmations again +append gdb_cmds {-ex "set interactive-mode auto" } + +puts "command: [gdb] debug/ld.lib.so $gdb_cmds" + +exec [terminal] -e "bash -lc \'[gdb] debug/ld.lib.so $gdb_cmds\'" & + +interact -i [output_spawn_id] +