forked from genodelabs/genode-world
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue genodelabs#304
- Loading branch information
Showing
3 changed files
with
95 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
build "core init timer test/backtrace" | ||
|
||
create_boot_directory | ||
|
||
install_config { | ||
<config> | ||
<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="200"/> | ||
<start name="timer"> | ||
<resource name="RAM" quantum="1M"/> | ||
<provides> <service name="Timer"/> </provides> | ||
</start> | ||
<start name="test-backtrace"> | ||
<resource name="RAM" quantum="16M"/> | ||
<config> | ||
<vfs> | ||
<dir name="dev"> | ||
<log/> | ||
<inline name="rtc">2019-08-20 15:01</inline> | ||
</dir> | ||
<dir name="proc"> | ||
<dir name="self"> | ||
<rom name="exe"/> | ||
</dir> | ||
</dir> | ||
<rom name="binary"/> | ||
<rom name="ld.lib.so"/> | ||
<rom name="libc.lib.so"/> | ||
<rom name="libm.lib.so"/> | ||
<rom name="posix.lib.so"/> | ||
<rom name="vfs.lib.so"/> | ||
</vfs> | ||
<libc stdout="/dev/log" stderr="/dev/log" rtc="/dev/rtc"/> | ||
</config> | ||
<route> | ||
<service name="ROM" label="exe"><parent label="test-backtrace.debug"/></service> | ||
<service name="ROM" label="binary"><parent label="test-backtrace.debug"/></service> | ||
<any-service><parent/><any-child/></any-service> | ||
</route> | ||
</start> | ||
</config> | ||
} | ||
|
||
exec ln -sf ../debug/test-backtrace bin/test-backtrace.debug | ||
|
||
build_boot_image { | ||
core init timer test-backtrace | ||
ld.lib.so libc.lib.so vfs.lib.so libm.lib.so posix.lib.so | ||
test-backtrace.debug | ||
} | ||
|
||
append qemu_args " -nographic " | ||
|
||
run_genode_until "child .* exited with exit value 0.*\n" 30 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* | ||
* \brief libbacktrace test | ||
* \author Christian Prochaska | ||
* \date 2023-01-28 | ||
*/ | ||
|
||
/* | ||
* Copyright (C) 2023 Genode Labs GmbH | ||
* | ||
* This file is part of the Genode OS framework, which is distributed | ||
* under the terms of the GNU Affero General Public License version 3. | ||
*/ | ||
|
||
#include <backtrace.h> | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
struct backtrace_state *state = | ||
backtrace_create_state(NULL, 0, NULL, NULL); | ||
|
||
backtrace_print(state, 0, stdout); | ||
|
||
return 0; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
TARGET = test-backtrace | ||
SRC_CC = main.cc | ||
LIBS = posix backtrace | ||
|
||
CC_CXX_WARN_STRICT = |