Doc: Improve debugging doc with Qemu demo

pull/634/head
Alfred Gedeon 4 years ago committed by alfred gedeon
parent e66c4a93ee
commit 449ad960e2

@ -112,17 +112,26 @@ the string contains “OK” and the current tick count. If an error has been
detected, then the string contains a message that indicates which task
reported the error.
## How to start debugging
1. gdb
<P>
Append the -s and -S switches to the previous command (qemu-system-arm)<br>
-s: allow gdb to be attached to the process remotely at port 1234 <br>
-S: start the program in the paused state <br>
1. Build the debug version by using `DEBUG=1`:
```
$ make DEBUG=1
```
2. Run the binary with `-s` and `-S` flags:
```
$ sudo qemu-system-arm -machine mps2-an385 -monitor null -semihosting \
--semihosting-config enable=on,target=native \
-kernel ./build/RTOSDemo.axf \
-serial stdio -nographic -s -S
```
The options:
`-s` allows gdb to be attached to the process remotely at port 1234
`-S` starts the program in the paused state.
run: (make sure you build the debug version)
3. Open another terminal to run GDB and connect to the process:
```
$ arm-none-eabi-gdb -q ./build/RTOSDemo.axf
(gdb) target remote :1234
(gdb) break main
(gdb) c

Loading…
Cancel
Save