From 2c1b8f4807fd5e90bf260792a656200e90e0c74f Mon Sep 17 00:00:00 2001 From: Stefan Kalkowski Date: Mon, 28 Oct 2013 16:42:28 +0100 Subject: [PATCH] l4lx: extend l4linux_dynamic run script Add a graphical scenario to the cli_monitor setup, which includes a more complex GDB debugging scenario. --- ports-foc/run/l4linux_dynamic.run | 387 ++++++++++++++++++++++++++---- 1 file changed, 337 insertions(+), 50 deletions(-) diff --git a/ports-foc/run/l4linux_dynamic.run b/ports-foc/run/l4linux_dynamic.run index 9b3c08abba..8d936e033a 100644 --- a/ports-foc/run/l4linux_dynamic.run +++ b/ports-foc/run/l4linux_dynamic.run @@ -5,30 +5,43 @@ assert_spec arm # Build # set build_components { + app/cli_monitor + app/gdb_monitor + app/launchpad + app/scout core - init + drivers/ahci + drivers/framebuffer drivers/platform - drivers/usb + drivers/sd_card drivers/timer drivers/uart - drivers/sd_card - drivers/ahci - server/terminal_mux - server/terminal_log - server/nic_bridge - server/part_blk + drivers/usb + init + l4linux + lib/libc_noux + noux server/ffat_fs - drivers/framebuffer - app/cli_monitor + server/fs_rom + server/nic_bridge + server/liquid_framebuffer + server/nitpicker + server/part_blk + server/tar_fs + server/terminal + server/terminal_crosslink + server/terminal_log + server/terminal_mux test/affinity + test/block + test/gdb_monitor test/input test/lwip/http_srv - test/block - l4linux - noux + test/nitpicker } lappend build_components noux-pkg/vim +lappend build_components noux-pkg/gdb_arm build $build_components create_boot_directory @@ -111,6 +124,16 @@ set config { + + + + + + + + + + @@ -142,7 +165,7 @@ set config { - + @@ -160,25 +183,46 @@ set config { - - + + + + + + + + + - - + + + + + + + + + - + - + - + + + + + + + + @@ -187,15 +231,11 @@ set config { - - - + + + - - - - - + @@ -257,6 +297,115 @@ set config { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -269,7 +418,13 @@ set config { - + + + + + + + @@ -278,47 +433,179 @@ set config { } - append config { } - install_config $config +set gdb_config_fd [open "bin/gdb_command_config" w] +puts $gdb_config_fd { + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +} +close $gdb_config_fd + +set gdb_binaries { + test-gdb_monitor + testnit + scout + libc.lib.so + ld.lib.so + libc_log.lib.so +} +set gdb_stripped_binaries { + expat.lib.so + gdb_monitor + init + launchpad + libc_lock_pipe.lib.so + libc_noux.lib.so + libc_terminal.lib.so + libm.lib.so + liquid_fb + ncurses.lib.so + noux + terminal + terminal_crosslink +} + +exec sh -c "find bin/gdb_arm/ -type f | (xargs [cross_dev_prefix]strip || true) 2>/dev/null" +exec mkdir -p bin/gdb/src +foreach binary ${gdb_binaries} { + set source_files [ exec [cross_dev_prefix]objdump -dl bin/${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/gdb/src${dirname} + exec ln -sf ${source_file} bin/gdb/src${source_file} + } + } +} +foreach binary ${gdb_stripped_binaries} { + exec sh -c "cp bin/${binary} bin/gdb/${binary}" + exec sh -c "[cross_dev_prefix]strip bin/gdb/${binary}" +} +foreach binary ${gdb_binaries} { + exec ln -s ../${binary} bin/gdb/${binary} +} +exec ln -s ../gdb_command_config bin/gdb/gdb_command_config +exec tar cfh bin/gdb.tar -C bin gdb +exec tar ufh bin/gdb.tar -C bin/gdb_arm bin +exec rm -rf bin/gdb + # # Boot modules # set boot_modules { + ahci + cli_monitor core + fb_drv + ffat_fs + fs_rom init - timer + initrd.gz kdb_uart_drv - platform_drv - terminal_mux - terminal_log + l4linux ld.lib.so libc.lib.so - libm.lib.so - libc_terminal.lib.so libc_log.lib.so libc_noux.lib.so + libc_terminal.lib.so + libm.lib.so lwip.lib.so ncurses.lib.so - cli_monitor - l4linux - initrd.gz - test-affinity - usb_drv - test-input - test-lwip_httpsrv nic_bridge - sd_card_drv - ahci - test-block - part_blk - ffat_fs + liquid_fb + nitpicker noux + part_blk + platform_drv + sd_card_drv + tar_fs + terminal + terminal_log + terminal_mux + test-affinity + test-block + timer + usb_drv vim.tar + gdb.tar } set uri "http://genode.org/files/l4linux/initrd-arm-mdev.gz"