genode/repos/ports/run/debug_nitpicker.run
Norman Feske c81af531a3 Turn framebuffer drivers into capture clients
This patch replaces the use of the "Framebuffer" session interface by
the new "Capture" session interface in all framebuffer drivers. Thanks
to this change, those drivers have become mere clients of the nitpicker
GUI server now, and are no longer critical for the liveliness of the GUI
server.

The patch touches the following areas:

- The actual driver components. The new versions of all drivers have
  been tested on the respective hardware. Generally, the drivers
  have become simpler.

- The drivers_interactive packages for various boards. The drivers
  subsystem no longer provides a "Framebuffer" service but needs a
  valid route to the "Capture" service provided by nitpicker.

- The driver manager of Sculpt OS.

- This patch changes the role of the test-framebuffer component from a
  framebuffer client to a capture server so that drivers (capture clients)
  can be directly connected to the test component without the nitpicker
  server.

- Framebuffer driver no longer support the unbuffered mode.

- The fb_bench.run script is no longer very meaningful because it
  interplays solely with nitpicker, not with the driver directly.

- All run scripts for graphical scenarios and the related depot
  archives got adapted to the change.

Fixes #3813
2020-07-13 11:33:15 +02:00

170 lines
4.6 KiB
Tcl

#
# \brief Example for debugging a service
# \author Norman Feske
# \date 2011-09-13
#
# This example shows how GDB monitor can be used to debug a Genode service.
# GDB monitor sits in between the service and the service's parent. Any
# service announcements are transparently propagated through the GDB
# monitor to the parent. This way, the internal state of a service can
# be observed at any time via a remote GDB connection. In the example,
# the remote GDB connection is realized via an UART device. Alternatively,
# 'tcp_terminal' could be used (to attach GDB via a network connection).
#
if {![have_include "power_on/qemu"] ||
!([have_spec nova])} {
puts "Run script is only supported for NOVA in Qemu"; exit 0
}
create_boot_directory
import_from_depot [depot_user]/src/[base_src] \
[depot_user]/pkg/[drivers_interactive_pkg] \
[depot_user]/src/nitpicker \
[depot_user]/src/demo \
[depot_user]/src/init
set build_components {
drivers/uart
app/gdb_monitor
test/gdb_monitor
}
lappend build_components "lib/gdbserver_platform-$::env(KERNEL)"
build $build_components
install_config {
<config verbose="yes">
<parent-provides>
<service name="ROM"/>
<service name="IRQ"/>
<service name="IO_MEM"/>
<service name="IO_PORT"/>
<service name="PD"/>
<service name="RM"/>
<service name="CPU"/>
<service name="LOG"/>
</parent-provides>
<default-route>
<any-service> <parent/> <any-child/> </any-service>
</default-route>
<default caps="100"/>
<start name="timer">
<resource name="RAM" quantum="1M"/>
<provides> <service name="Timer"/> </provides>
</start>
<start name="pc_uart_drv">
<resource name="RAM" quantum="1M"/>
<provides>
<service name="Uart"/>
<service name="Terminal"/>
</provides>
<config>
<policy label_prefix="gdb_monitor" uart="1"/>
</config>
</start>
<start name="drivers" caps="1500">
<resource name="RAM" quantum="64M" constrain_phys="yes"/>
<binary name="init"/>
<route>
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
<service name="Timer"> <child name="timer"/> </service>
<service name="Capture"> <child name="gdb_monitor"/> </service>
<any-service> <parent/> </any-service>
</route>
<provides> <service name="Input"/> </provides>
</start>
<start name="gdb_monitor" caps="200">
<resource name="RAM" quantum="10M"/>
<provides> <service name="Gui"/> <service name="Capture"/> </provides>
<config>
<target name="nitpicker">
<config request_framebuffer="no">
<capture/>
<domain name="pointer" layer="1" xray="no" origin="pointer"
content="client" label="no"/>
<domain name="default" layer="3" content="client"
label="no" hover="always" focus="click"/>
<policy label_prefix="pointer" domain="pointer"/>
<default-policy domain="default"/>
</config>
</target>
<preserve name="RAM" quantum="2M"/>
<vfs> <dir name="dev"> <log/> <terminal/> </dir> </vfs>
<libc stdout="/dev/log" stderr="/dev/log"/>
</config>
</start>
<start name="pointer">
<resource name="RAM" quantum="1M"/>
</start>
<start name="scout">
<resource name="RAM" quantum="32M"/>
</start>
</config>
}
# evaluated by the run tool
proc binary_name_gdbserver_platform_lib_so { } {
return "gdbserver_platform-$::env(KERNEL).lib.so"
}
# generic modules
build_boot_image {
stdcxx.lib.so libc.lib.so libm.lib.so vfs.lib.so libc_pipe.lib.so
pc_uart_drv
gdb_monitor gdbserver_platform.lib.so
}
#
# Execute test case
#
#
set local_port 5555
# qemu config
# 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 {.*\[init -> gdb_monitor\].*} 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 "nitpicker"
# 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]
# vi: set ft=tcl :