How to enable GDB for l4linux
정복득
bd.jeong at ...60...
Mon Feb 27 03:34:58 CET 2012
Hi,
I'd like to use gdb_monitor to monitor l4linux and processes running on the l4linux.
Could you tell me how to write scripts for that?
I am running Genode l4linux on Fiasco.oc on qemu (pbxa9).
I took references from sample scripts, debug_nitpicker.run and gdb_monitor.run to modify the l4linux script, but failed to run. The script looks like below:
Thanks.
-----------------------------------------------------------------------
assert_spec foc
#
# Build
#
set build_components {
core
init
drivers/timer
drivers/uart
drivers/framebuffer
l4linux
app/gdb_monitor
}
lappend_if [have_spec x86] build_components drivers/nic
lappend_if [have_spec pci] build_components drivers/pci
lappend_if [have_spec ps2] build_components drivers/input/ps2
lappend_if [have_spec lan9118] build_components drivers/nic
build $build_components
create_boot_directory
#
# Config
#
set config {
<config prio_levels="2">
<parent-provides>
<service name="ROM"/>
<service name="RAM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="CAP"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
<service name="SIGNAL"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides><service name="Timer"/></provides>
</start>
<start name="uart_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Terminal"/></provides>
<config><policy label="gdb_monitor" uart="1"/></config>
</start>
}
append_if [have_spec pci] config {
<start name="pci_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="PCI"/></provides>
</start>}
append_if [have_spec vesa] config {
<start name="vesa_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Framebuffer"/></provides>
</start> }
append_if [have_spec pl11x] config {
<start name="pl11x_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Framebuffer"/></provides>
</start> }
append_if [have_spec ps2] config {
<start name="ps2_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Input"/></provides>
</start>}
append_if [have_spec x86] config {
<start name="nic_drv">
<resource name="RAM" quantum="2M"/>
<provides><service name="Nic"/></provides>
</start>}
append_if [have_spec lan9118] config {
<start name="nic_drv">
<resource name="RAM" quantum="1M"/>
<provides><service name="Nic"/></provides>
</start> }
append config {
<start name="gdb_monitor">
<resource name="RAM" quantum="132M"/>
<config><target name="l4linux"/></config>
</start>
</config>}
install_config $config
# <config args="mem=64M console=ttyS0 l4x_rd=initrd.gz"/>
#
# Boot modules
#
set boot_modules { core init timer uart_drv l4linux initrd.gz }
lappend_if [have_spec pci] boot_modules pci_drv
lappend_if [have_spec ps2] boot_modules ps2_drv
lappend_if [have_spec pl11x] boot_modules pl11x_drv
lappend_if [have_spec vesa] boot_modules vesa_drv
lappend_if [have_spec x86] boot_modules nic_drv
lappend_if [have_spec lan9118] boot_modules nic_drv
if {[have_spec x86]} {
set uri "http://genode.org/files/release-11.11/l4lx/initrd-ia32.gz"
} elseif {[have_spec arm]} {
set uri "http://genode.org/files/release-11.11/l4lx/initrd-arm.gz"
}
if {![file exists bin/initrd.gz]} {
puts "Download initramfs ..."
exec >& /dev/null wget -c -O bin/initrd.gz $uri
}
build_boot_image [join $boot_modules " "]
#
# Qemu
#
set local_port 5555
append qemu_args " -m 128 "
append qemu_args " -serial unix:/tmp/qemu-pipe,server,nowait "
append qemu_args " -serial mon:stdio "
append_if [have_spec x86] qemu_args " -net nic,model=e1000 -net user "
append_if [have_spec lan9118] qemu_args " -net nic,model=lan9118 -net user "
#
# Execute test case
#
run_genode_until {.*Remote debugging using /dev/terminal.*} 30
puts "GDB monitor is up, starting GDB in a new terminal"
exec [terminal] -e "[gdb] bin/l4linux -ex \"target remote localhost:$local_port\"" &
interact
More information about the users
mailing list