gdbgui/docs/examples.md

81 lines
1.5 KiB
Markdown
Raw Permalink Normal View History

2019-04-01 18:39:31 +02:00
# Examples
## Code Examples
View code examples on [GitHub](https://github.com/cs01/gdbgui/tree/master/examples).
## gdbgui Invocation Examples
launch gdbgui
```
gdbgui
```
set the inferior program, pass argument, set a breakpoint at main
```
gdbgui --args ./myprogram myarg -myflag
2019-04-01 18:39:31 +02:00
```
```
gdbgui "./myprogram myarg -myflag"
2019-04-01 18:39:31 +02:00
```
use gdb binary not on your $PATH
```
gdbgui --gdb-cmd build/mygdb
2019-04-01 18:39:31 +02:00
```
Pass arbitrary arguments directly to gdb when it is launched
2019-04-01 18:39:31 +02:00
```
gdbgui --gdb-cmd="gdb -x gdbcmds.txt"
2019-04-01 18:39:31 +02:00
```
run on port 8080 instead of the default port
2019-04-01 18:39:31 +02:00
```
gdbgui --port 8080
2019-04-01 18:39:31 +02:00
```
2019-04-01 18:39:31 +02:00
run on a server and host on 0.0.0.0. Accessible to the outside world as long as port 80 is not blocked.
```
gdbgui -r
```
Same as previous but will prompt for a username and password
```
gdbgui -r --auth
```
Same as previous but with encrypted https connection.
```
openssl req -newkey rsa:2048 -nodes -keyout private.key -x509 -days 365 -out host.cert
```
```
gdbgui -r --auth --key private.key --cert host.cert
```
2019-08-11 17:56:36 +02:00
Use Mozilla's [record and replay](https://rr-project.org) (rr) debugging supplement to gdb. rr lets your record a program (usually with a hard-to-reproduce bug in it), then deterministically replay it as many times as you want. You can even step forwards and backwards.
2019-04-01 18:39:31 +02:00
```
gdbgui --gdb-cmd "rr replay --"
2019-04-01 18:39:31 +02:00
```
Use recording other than the most recent one
```
gdbgui --gdb-cmd "rr replay RECORDED_DIRECTORY --"
2019-04-01 18:39:31 +02:00
```
Don't automatically open the browser when launching
```
gdbgui -n
```