if {![have_spec foc] || ![have_spec 32bit]} { puts "\nThe Noux GDB scenario is supported on 32-bit Fiasco.OC only\n" exit 0 } if {[have_spec arm]} { set gdb "gdb_arm" set tool_prefix "genode-arm-" } if {[have_spec x86]} { set gdb "gdb_x86" set tool_prefix "genode-x86-" } # # Uncomment the following line when working on the GDB source code. Otherwise, # the package may get recompiled, yet it does not get reinstalled into 'bin/'. # #exec rm -rf noux-pkg/$gdb/ bin/$gdb/ set build_components { core init drivers/timer noux lib/libc_noux drivers/framebuffer drivers/pci drivers/input drivers/usb server/terminal server/terminal_crosslink server/ram_fs app/gdb_monitor test/gdb_monitor } lappend build_components noux-pkg/$gdb build $build_components # tar archive for GDB exec sh -c "find bin/$gdb/ -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" exec tar cfhv bin/gdb.tar -C bin/$gdb . # names of the binaries needed for the GDB monitor test set test_binaries { test-gdb_monitor ld.lib.so libc.lib.so libc_log.lib.so } # tar archive for the unstripped binaries of the GDB monitor test foreach test_binary $test_binaries { exec tar ufv bin/test-gdb_monitor.tar -h -C bin $test_binary } # tar archive for the source code of the GDB monitor test # currently, directories need to have their own tar records exec mkdir -p bin/test-gdb_monitor-src foreach test_binary $test_binaries { set source_files [ exec [cross_dev_prefix]objdump -dl bin/$test_binary | grep "^/.*:.*" | sed -e "s/:.*//" | uniq ] foreach source_file $source_files { # resolve '..' to avoid problems with 'tar' with parts like '/a/b/../' # where '/a' exists, but '/a/b' does not set source_file [file normalize $source_file] if [file exists $source_file] { set dirname [ exec dirname $source_file] exec mkdir -p bin/test-gdb_monitor-src$dirname exec ln -sf $source_file bin/test-gdb_monitor-src$source_file } } } exec tar chf bin/test-gdb_monitor-src.tar -C bin/test-gdb_monitor-src . create_boot_directory append config { } append_if [have_spec sdl] config { } append_if [have_spec pci] config { } append_if [have_spec framebuffer] config { } append_if [have_spec ps2] config { } append_if [expr ![have_spec ps2] && [have_spec usb]] config { } append config { set interactive-mode off directory /gdb/src target remote /dev/gdb symbol-file /gdb/ld.lib.so b call_main c delete 1 symbol-file /gdb/test-gdb_monitor b main set solib-search-path /gdb sharedlibrary c delete 2 set interactive-mode auto } append config " " append config { } install_config $config # # Boot modules # # generic modules set boot_modules { core init timer ld.lib.so noux terminal terminal_crosslink libc.lib.so libm.lib.so libc_noux.lib.so ncurses.lib.so expat.lib.so libc_lock_pipe.lib.so libc_log.lib.so libc_terminal.lib.so ram_fs gdb_monitor test-gdb_monitor gdb.tar test-gdb_monitor.tar test-gdb_monitor-src.tar } # platform-specific modules lappend_if [have_spec linux] boot_modules fb_sdl lappend_if [have_spec pci] boot_modules pci_drv lappend_if [have_spec framebuffer] boot_modules fb_drv lappend_if [have_spec ps2] boot_modules ps2_drv lappend_if [have_spec usb] boot_modules usb_drv build_boot_image $boot_modules run_genode_until forever exec rm bin/gdb.tar