2017-05-08 11:08:52 +00:00
|
|
|
if {!([have_spec nova])} {
|
|
|
|
puts "\nThe Noux GDB scenario is only supported for NOVA\n"
|
2012-09-17 12:15:39 +00:00
|
|
|
exit 0
|
2012-07-12 19:25:55 +00:00
|
|
|
}
|
|
|
|
|
2018-04-11 12:14:20 +00:00
|
|
|
create_boot_directory
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
|
2018-04-11 12:14:20 +00:00
|
|
|
import_from_depot genodelabs/src/[base_src] \
|
|
|
|
genodelabs/pkg/[drivers_interactive_pkg] \
|
|
|
|
genodelabs/pkg/terminal \
|
|
|
|
genodelabs/src/init \
|
|
|
|
genodelabs/src/libc \
|
|
|
|
genodelabs/src/noux \
|
|
|
|
genodelabs/src/posix \
|
|
|
|
genodelabs/src/ncurses
|
2012-07-12 19:25:55 +00:00
|
|
|
|
2018-04-11 12:14:20 +00:00
|
|
|
source ${genode_dir}/repos/ports/run/noux_gdb.inc
|
|
|
|
|
|
|
|
if {[have_spec arm]} { set tool_prefix "genode-arm-" }
|
|
|
|
if {[have_spec x86]} { set tool_prefix "genode-x86-" }
|
2012-07-12 19:25:55 +00:00
|
|
|
|
|
|
|
#
|
|
|
|
# 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/'.
|
|
|
|
#
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
#exec rm -rf noux-pkg/[noux_gdb_pkg_name]/ bin/[noux_gdb_pkg_name]/
|
2012-07-12 19:25:55 +00:00
|
|
|
|
|
|
|
set build_components {
|
2018-04-11 12:14:20 +00:00
|
|
|
server/terminal_crosslink
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
app/gdb_monitor
|
2012-07-12 19:25:55 +00:00
|
|
|
}
|
2013-11-13 13:10:49 +00:00
|
|
|
|
2017-02-25 22:58:37 +00:00
|
|
|
lappend build_components "lib/gdbserver_platform-$::env(KERNEL)"
|
|
|
|
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
# the application to be debugged with GDB
|
|
|
|
lappend build_components test/gdb_monitor
|
|
|
|
set gdb_target_binary_name test-gdb_monitor
|
2012-07-12 19:25:55 +00:00
|
|
|
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
build $build_components
|
2012-07-12 19:25:55 +00:00
|
|
|
|
2017-05-29 14:50:12 +00:00
|
|
|
# GDB loads symbols from 'debug/ld.lib.so'
|
2017-01-04 10:38:39 +00:00
|
|
|
if { [have_spec nova] } {
|
2017-05-29 14:50:12 +00:00
|
|
|
exec ln -sf ld-nova.lib.so debug/ld.lib.so
|
2017-01-04 10:38:39 +00:00
|
|
|
}
|
|
|
|
if { [have_spec foc] } {
|
2017-05-29 14:50:12 +00:00
|
|
|
exec ln -sf ld-foc.lib.so debug/ld.lib.so
|
2017-01-04 10:38:39 +00:00
|
|
|
}
|
|
|
|
|
2012-07-12 19:25:55 +00:00
|
|
|
# names of the binaries needed for the GDB monitor test
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
set gdb_target_binaries {
|
2012-07-12 19:25:55 +00:00
|
|
|
test-gdb_monitor
|
|
|
|
ld.lib.so
|
2018-04-23 08:49:21 +00:00
|
|
|
libc.lib.so vfs.lib.so
|
2017-01-04 10:38:39 +00:00
|
|
|
libm.lib.so
|
2017-05-14 19:55:57 +00:00
|
|
|
posix.lib.so
|
2012-07-12 19:25:55 +00:00
|
|
|
}
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
lappend gdb_target_binaries ${gdb_target_binary_name}
|
2012-07-12 19:25:55 +00:00
|
|
|
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
create_binary_and_source_tars ${gdb_target_binary_name} ${gdb_target_binaries}
|
2012-07-12 19:25:55 +00:00
|
|
|
|
|
|
|
create_boot_directory
|
|
|
|
|
|
|
|
append config {
|
|
|
|
<config verbose="yes">
|
|
|
|
<parent-provides>
|
|
|
|
<service name="ROM"/>
|
|
|
|
<service name="LOG"/>
|
|
|
|
<service name="RM"/>
|
|
|
|
<service name="CPU"/>
|
|
|
|
<service name="PD"/>
|
|
|
|
<service name="IRQ"/>
|
|
|
|
<service name="IO_PORT"/>
|
|
|
|
<service name="IO_MEM"/>
|
|
|
|
</parent-provides>
|
2018-04-11 12:14:20 +00:00
|
|
|
|
2012-07-12 19:25:55 +00:00
|
|
|
<default-route>
|
2015-09-17 12:15:28 +00:00
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
2012-07-12 19:25:55 +00:00
|
|
|
</default-route>
|
2018-04-11 12:14:20 +00:00
|
|
|
|
2017-05-07 20:36:11 +00:00
|
|
|
<default caps="100"/>
|
2018-04-11 12:14:20 +00:00
|
|
|
|
2012-07-12 19:25:55 +00:00
|
|
|
<start name="timer">
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides><service name="Timer"/></provides>
|
2018-04-11 12:14:20 +00:00
|
|
|
</start>
|
2012-07-12 19:25:55 +00:00
|
|
|
|
2018-04-11 12:14:20 +00:00
|
|
|
<start name="drivers" caps="1000">
|
|
|
|
<resource name="RAM" quantum="32M" constrain_phys="yes"/>
|
|
|
|
<binary name="init"/>
|
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="drivers.config"/> </service>
|
|
|
|
<service name="Timer"> <child name="timer"/> </service>
|
|
|
|
<any-service> <parent/> </any-service>
|
|
|
|
</route>
|
2012-07-12 19:25:55 +00:00
|
|
|
<provides>
|
2018-04-11 12:14:20 +00:00
|
|
|
<service name="Input"/> <service name="Framebuffer"/>
|
2012-07-12 19:25:55 +00:00
|
|
|
</provides>
|
2018-04-11 12:14:20 +00:00
|
|
|
</start>
|
2012-07-12 19:25:55 +00:00
|
|
|
|
|
|
|
<start name="terminal_noux">
|
|
|
|
<binary name="terminal"/>
|
|
|
|
<resource name="RAM" quantum="2M"/>
|
|
|
|
<provides><service name="Terminal"/></provides>
|
2018-04-11 12:14:20 +00:00
|
|
|
<route>
|
|
|
|
<service name="ROM" label="config"> <parent label="terminal.config"/> </service>
|
|
|
|
<any-service> <parent/> <any-child/> </any-service>
|
|
|
|
</route>
|
2012-07-12 19:25:55 +00:00
|
|
|
</start>
|
2018-04-11 12:14:20 +00:00
|
|
|
|
2012-07-12 19:25:55 +00:00
|
|
|
<start name="terminal_gdb">
|
|
|
|
<binary name="terminal_crosslink"/>
|
|
|
|
<resource name="RAM" quantum="1M"/>
|
|
|
|
<provides> <service name="Terminal"/> </provides>
|
|
|
|
</start>
|
2018-04-11 12:14:20 +00:00
|
|
|
|
2017-05-29 14:50:12 +00:00
|
|
|
<start name="gdb_monitor" caps="200">
|
2016-05-17 14:13:23 +00:00
|
|
|
<resource name="RAM" quantum="16M"/>
|
2012-07-12 19:25:55 +00:00
|
|
|
<route>
|
|
|
|
<service name="Terminal"><child name="terminal_gdb"/></service>
|
|
|
|
<any-service><parent/><any-child/></any-service>
|
|
|
|
</route>
|
2014-05-20 15:23:09 +00:00
|
|
|
<config>
|
2017-05-29 14:50:12 +00:00
|
|
|
<vfs> <dir name="dev"> <log/> </dir> </vfs>
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log"/> }
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
append config "
|
2014-05-20 15:23:09 +00:00
|
|
|
<target name=\"${gdb_target_binary_name}\"> "
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
append config {
|
2014-05-20 15:23:09 +00:00
|
|
|
<config>
|
2017-05-29 14:50:12 +00:00
|
|
|
<vfs> <dir name="dev"> <log/> </dir> </vfs>
|
|
|
|
<libc stdout="/dev/log" stderr="/dev/log"/>
|
2014-05-20 15:23:09 +00:00
|
|
|
</config>
|
|
|
|
</target>
|
2012-07-12 19:25:55 +00:00
|
|
|
<preserve name="RAM" quantum="5M"/>
|
|
|
|
</config>
|
|
|
|
</start>
|
2017-05-29 14:50:12 +00:00
|
|
|
<start name="noux" caps="300">
|
2012-07-12 19:25:55 +00:00
|
|
|
<resource name="RAM" quantum="1G"/>
|
|
|
|
<route>
|
2017-01-18 16:10:07 +00:00
|
|
|
<service name="Terminal" label="">
|
|
|
|
<child name="terminal_noux"/>
|
2012-07-12 19:25:55 +00:00
|
|
|
</service>
|
2017-01-18 16:10:07 +00:00
|
|
|
<service name="Terminal" label="/dev/gdb">
|
|
|
|
<child name="terminal_gdb"/>
|
2012-07-12 19:25:55 +00:00
|
|
|
</service>
|
|
|
|
<any-service><parent/><any-child/></any-service>
|
|
|
|
</route>
|
|
|
|
<config>
|
2017-05-29 14:50:12 +00:00
|
|
|
<fstab> }
|
|
|
|
append config "
|
|
|
|
<tar name=\"[noux_gdb_pkg_name].tar\" at=\"/\"/>"
|
|
|
|
append config {
|
2014-05-20 15:23:09 +00:00
|
|
|
<dir name="dev"><terminal name="gdb" label="/dev/gdb"/></dir>
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
<dir name="gdb"> }
|
|
|
|
append config "
|
|
|
|
<tar name=\"${gdb_target_binary_name}.tar\"/>
|
|
|
|
<dir name=\"src\"> <tar name=\"${gdb_target_binary_name}-src.tar\"/> </dir> "
|
|
|
|
append config {
|
2012-07-12 19:25:55 +00:00
|
|
|
</dir>
|
|
|
|
</fstab> }
|
|
|
|
append config "
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
<start name=\"/bin/${tool_prefix}gdb\">
|
2016-05-17 14:13:23 +00:00
|
|
|
<arg value=\"/gdb/ld.lib.so\"/> "
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
append config {
|
|
|
|
<arg value="-ex" /><arg value="set interactive-mode off" />
|
|
|
|
<arg value="-ex" /><arg value="directory /gdb/src" />
|
|
|
|
<arg value="-ex" /><arg value="target remote /dev/gdb" />
|
2016-05-17 14:13:23 +00:00
|
|
|
<arg value="-ex" /><arg value="b binary_ready_hook_for_gdb" />
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
<arg value="-ex" /><arg value="c" />
|
|
|
|
<arg value="-ex" /><arg value="delete 1" /> }
|
|
|
|
append config "
|
2016-05-17 14:13:23 +00:00
|
|
|
<arg value=\"-ex\" /><arg value=\"file /gdb/${gdb_target_binary_name}\" /> "
|
2012-07-12 19:25:55 +00:00
|
|
|
append config {
|
2016-05-17 14:13:23 +00:00
|
|
|
<arg value="-ex" /><arg value="b main" />
|
cli_monitor: add a 'gdb' command
This patch adds a 'gdb' command to 'cli_monitor', which makes it possible
to debug an application with GDB.
The command works similarly to the 'start' command, but instead of
starting the subsystem binary directly, an 'init' subsystem gets
started, which then starts 'terminal_crosslink', 'noux', GDB and
'gdb_monitor' (which starts the application binary as its target).
So, for the 'gdb' command to work, these additional components need to
be available, too. 'terminal_crosslink', 'noux', 'gdb_monitor' and the
file 'gdb_command_config' are expected to be ROM modules. The Noux GDB
client needs to get mounted at '/bin' in Noux and the target binaries need
to be available as ROM modules (loaded by 'gdb_monitor') and also mounted
at '/gdb' in Noux (loaded by the GDB client).
Additionally, the source code of the target application can be provided
at '/gdb/src/ in Noux. How the Noux mountings get established can
be configured in the 'gdb_command_config' file. The default configuration
in 'os/src/server/cli_monitor/gdb_command_config' mounts GDB from a tar
archive named 'gdb.tar', the GDB target binaries from a tar archive named
'gdb_target.tar' and the target source code from a tar archive named
'gdb_target-src.tar'.
The patch includes an 'expect' include file (ports/run/noux_gdb.inc)
which provides functions that help to create those tar files:
- 'create_gdb_tar' creates a tar archive for the 'gdb' client
- 'create_binary_tar' creates a tar archive for the target application
- 'create_source_tar' creates a tar archive for the source code of
the target application
- 'create_binary_and_source_tars' is a convenience wrapper for the previous
two functions
The patch also includes an example run script
(ports/run/noux_gdb_dynamic.run).
The 'gdb' command supports the following command line options:
- --ram: the initial RAM quota provided to the whole subsystem
(including the GDB-related components)
- --ram-limit: limit for expanding RAM quota
- --gdb-ram-preserve: the RAM quota that 'gdb_monitor' ahould preserve
for itself
Fixes #928.
2013-10-25 20:28:55 +00:00
|
|
|
<arg value="-ex" /><arg value="set solib-search-path /gdb" />
|
|
|
|
<arg value="-ex" /><arg value="sharedlibrary" />
|
|
|
|
<arg value="-ex" /><arg value="c" />
|
|
|
|
<arg value="-ex" /><arg value="delete 2" />
|
|
|
|
<arg value="-ex" /><arg value="set interactive-mode auto" />
|
2012-07-12 19:25:55 +00:00
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
</start>
|
|
|
|
</config>
|
|
|
|
}
|
|
|
|
|
|
|
|
install_config $config
|
|
|
|
|
|
|
|
|
|
|
|
#
|
|
|
|
# Boot modules
|
|
|
|
#
|
|
|
|
|
2017-02-25 22:58:37 +00:00
|
|
|
# evaluated by the run tool
|
|
|
|
proc binary_name_gdbserver_platform_lib_so { } {
|
|
|
|
return "gdbserver_platform-$::env(KERNEL).lib.so"
|
|
|
|
}
|
|
|
|
|
2018-04-11 12:14:20 +00:00
|
|
|
set boot_modules {
|
|
|
|
terminal_crosslink
|
|
|
|
expat.lib.so
|
|
|
|
libc_pipe.lib.so libc_terminal.lib.so
|
2017-02-25 22:58:37 +00:00
|
|
|
gdb_monitor gdbserver_platform.lib.so test-gdb_monitor
|
2017-05-29 14:50:12 +00:00
|
|
|
test-gdb_monitor.tar test-gdb_monitor-src.tar
|
2018-04-11 12:14:20 +00:00
|
|
|
}
|
2012-07-12 19:25:55 +00:00
|
|
|
|
2018-04-11 12:14:20 +00:00
|
|
|
lappend boot_modules [noux_gdb_pkg_name].tar
|
2015-06-08 07:05:32 +00:00
|
|
|
|
2012-07-12 19:25:55 +00:00
|
|
|
build_boot_image $boot_modules
|
|
|
|
|
|
|
|
run_genode_until forever
|