proc platform_supported { } { if {[have_spec x86_64] && [have_board pc]} { if {[have_spec nova] || [have_spec hw]} { return 1 } } elseif {[have_spec arm_v8a] && [have_board rpi3]} { if {[have_spec hw]} { return 1 } } return 0 } if {![platform_supported]} { puts "Run script is not supported on this platform" exit 0 } proc gdb_pkg_name { } { if {[have_spec arm_64]} { return "gdb_arm_64" } elseif {[have_spec x86]} { return "gdb_x86" } } proc gdb_prefix { } { if {[have_spec arm_64]} { return "genode-aarch64-" } elseif {[have_spec x86]} { return "genode-x86-" } } create_boot_directory import_from_depot [depot_user]/src/[base_src] \ [depot_user]/src/init \ [depot_user]/src/sandbox \ [depot_user]/src/monitor \ [depot_user]/src/vfs \ [depot_user]/src/fs_rom \ [depot_user]/src/vfs_pipe \ [depot_user]/src/terminal_crosslink \ [depot_user]/src/libc \ [depot_user]/src/posix \ [depot_user]/src/socat \ [depot_user]/src/expat \ [depot_user]/src/gmp \ [depot_user]/src/ncurses \ [depot_user]/src/stdcxx \ [depot_user]/src/[gdb_pkg_name] if {[have_include power_on/qemu]} { append build_components { driver/uart } } else { import_from_depot [depot_user]/pkg/[drivers_nic_pkg] \ [depot_user]/src/nic_router \ [depot_user]/src/vfs_lwip } append build_components { lib/ld test/monitor_gdb test/log } build $build_components append config { } if { [have_include power_on/qemu] } { append_if [have_board pc] config { } append_if [have_board rpi3] config { } } else { append config { } } append config { 2018-01-01 00:01 } append_if [have_include power_on/qemu] config { } append config { } if {![have_include power_on/qemu]} { append config { } } append config { } if {[have_include power_on/qemu]} { append config { } } else { append config { } } append config { 2023-01-01 00:01 } install_config $config # GDB loads symbols from 'debug/ld.lib.so' if { [have_spec nova] } { exec ln -sf ld-nova.lib.so debug/ld.lib.so exec tar cf bin/gdb_run_debug.tar -h debug/ld-nova.lib.so.debug } elseif { [have_spec hw] } { exec ln -sf ld-hw.lib.so debug/ld.lib.so exec tar cf bin/gdb_run_debug.tar -h debug/ld-hw.lib.so.debug } exec tar uf bin/gdb_run_debug.tar -h \ debug/ld.lib.so \ debug/test-monitor_gdb \ debug/test-monitor_gdb.debug \ debug/test-log \ debug/test-log.debug build_boot_image "[build_artifacts] gdb_run_debug.tar" set port 5555 if {[have_include power_on/qemu]} { set host "localhost" # qemu config append qemu_args " -display none " if {[have_board rpi3]} { # connect comport 0 with TCP port $port append qemu_args " -serial chardev:uart " # connect comport 1 to stdio append qemu_args " -serial stdio " } else { # connect comport 0 to stdio append qemu_args " -serial stdio " # connect comport 1 with TCP port $port append qemu_args " -serial chardev:uart " } append qemu_args " -chardev socket,id=uart,port=$port,host=$host,server,nowait,ipv4 " run_genode_until {.*monitor ready*} 30 } else { set match_string "nic_router. .uplink. dynamic IP config: interface .*\n" run_genode_until $match_string 30 regexp $match_string $output host regexp {[0-9]+\.[0-9]+\.[0-9]+\.[0-9]+} $host host } set genode_id [output_spawn_id]