syscalls: Add get_stack_trace and lookup_symbol syscalls.

The get_stack_trace syscall generates a stack trace using the kernel
debugging facilities and copies the resulting return address array to
the preallocated buffer from userland. It is only possible to get a
stack trace of the current thread.

The lookup_symbol syscall can be used to look up the symbol and image
name corresponding to an address. It can be used to resolve symbols
from a stack trace generated by the get_stack_trace syscall. Only
symbols of the current team can be looked up. Note that this uses
the symbol lookup of the kernel debugger which does not support lookup
of all symbols (static functions are missing for example).

This is meant to be used in situations where more elaborate stack trace
generation, like done in the userland debugging helpers, is not possible
due to constraints.
This commit is contained in:
Michael Lotz
2015-04-10 16:00:49 +02:00
parent e01de52283
commit b959d46dbd
5 changed files with 69 additions and 0 deletions
+1
View File
@@ -289,6 +289,7 @@ status_t _user_set_debugger_breakpoint(void *address, uint32 type,
int32 length, bool watchpoint);
status_t _user_clear_debugger_breakpoint(void *address, bool watchpoint);
ssize_t _user_get_stack_trace(size_t addressCount, addr_t* returnAddresses);
#ifdef __cplusplus
} // extern "C"