Skip to content

Commit a6435ac

Browse files
kleinesfilmroellchennico
authored andcommitted
Base: Add CrashReporter(1), dbgputstr(2), dump_backtrace(2) manpages
Importantly, these document two nonstandard system calls that Serenity provides.
1 parent 3375f7d commit a6435ac

File tree

5 files changed

+109
-0
lines changed

5 files changed

+109
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Name
2+
3+
![Icon](/res/icons/16x16/app-crash-reporter.png) CrashReporter - information about crashed programs
4+
5+
[Open](file:///bin/CrashReporter)
6+
7+
## Synopsis
8+
9+
```sh
10+
$ CrashReporter [--unlink] <coredump-path>
11+
```
12+
13+
## Description
14+
15+
CrashReporter informs about crashed programs by providing a GUI to examine the crashed program's last state.
16+
17+
![](CrashReporter.png)
18+
19+
The four main tabs display the call stack (or backtrace) when the program crashed, the CPU registers just before crashing, the environment variables and the mapped memory regions. For registers and backtrace, there is one tab per thread.
20+
21+
The buttons allow to open the relevant files in HackStudio, or to save the text of the backtrace to a file.
22+
23+
If CrashDaemon is running, CrashReporter is automatically opened when a program crashes.
24+
25+
## Options
26+
27+
- `--help`: Display help message and exit
28+
- `--version`: Print version
29+
- `--unlink`: Delete the coredump after it's parsed
30+
31+
## Arguments
32+
33+
- `coredump-path`: Path to the core dump file to display
34+
35+
## See Also
36+
37+
- [`dump_backtrace`(2)](help://man/2/dump_backtrace)
13.2 KB
Loading

Base/usr/share/man/man1/crash.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,7 @@ $ crash -F
5757
Testing: "Write to freed memory"
5858
Shell: Job 1 (crash -F) Segmentation violation
5959
```
60+
61+
## See Also
62+
63+
- [`dump_backtrace`(2)](help://man/2/dump_backtrace)
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
## Name
2+
3+
dbgputstr - print logs to the serial console
4+
5+
## Synopsis
6+
7+
```**c++
8+
#include <stdio.h>
9+
10+
void dbgputstr(char const* characters, size_t length);
11+
```
12+
13+
## Description
14+
15+
`dbgputstr` is Serenity's generic kernel-supported logging facility. Currently, logging submitted to `dbgputstr` is directly printed to the serial console.
16+
17+
`dbgputstr` takes as arguments a pointer to a string to be written, and the length of that string.
18+
19+
Users should access logging functionality via the `dbg`/`dbgln` functions, which add additional process information to the log output.
20+
21+
## Errors
22+
23+
The C library function does not propagate errors.
24+
25+
The system call itself can fail with the following errors:
26+
27+
- `EFAULT`: Invalid or inaccessible string.
28+
29+
No error is reported if the output cannot be written to a serial device.
30+
31+
If the return value is positive, this indicates the actual number of characters written, in case the provided string was null-terminated before the length was reached.
32+
33+
## See Also
34+
35+
- [`dump_backtrace`(2)](help://man/2/dump_backtrace)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
## Name
2+
3+
dump_backtrace - dump the process's current kernel backtrace
4+
5+
## Synopsis
6+
7+
```**c++
8+
#include <unistd.h>
9+
10+
void dump_backtrace();
11+
```
12+
13+
## Description
14+
15+
`dump_backtrace` prints the process's kernel backtrace to the serial console. This is most useful for information about a process crash. Note that the userspace backtrace, which in general is more useful, is not printed by this syscall, since it can be printed entirely by userspace examining its own stack.
16+
17+
The output may look something like this:
18+
19+
```
20+
254.838 [#0 crash(55:55)]: Kernel + 0x000000000052b9f4 Kernel::Process::crash(int, AK::Optional<Kernel::RegisterState const&>, bool) +0x394
21+
254.838 [#0 crash(55:55)]: Kernel + 0x000000000050f1d4 Kernel::handle_crash(Kernel::RegisterState const&, char const*, int, bool) +0x2ec
22+
254.838 [#0 crash(55:55)]: Kernel + 0x000000000059e648 illegal_instruction_asm_entry +0x30
23+
```
24+
25+
## Errors
26+
27+
This syscall does not return any errors to the user.
28+
29+
## See Also
30+
31+
- [`dbgputstr`(2)](help://man/2/dbgputstr)
32+
- [`crash`(2)](help://man/1/crash)
33+
- [`CrashReporter(1)`](help://man/1/Applications/CrashReporter)

0 commit comments

Comments
 (0)