@@ -24,7 +24,7 @@ directory. Once we are there we first have to open the binary in gdb like this:
24
24
$ gdb ../../../target/thumbv7em-none-eabihf/debug/examples/init
25
25
```
26
26
27
- > ** NOTE** : Depending on which GDB you installed you will have to use a different command to launch
27
+ > ** NOTE** Depending on which GDB you installed you will have to use a different command to launch
28
28
> it. Check out [ chapter 3] if you forgot which one it was.
29
29
30
30
[ chapter 3 ] : ../03-setup/index.md#tools
@@ -49,9 +49,22 @@ Remote debugging using :1337
49
49
157 # [derive(Copy, Clone, Debug)]
50
50
```
51
51
52
- ** NOTE** : The example in the repository for this chapter may
53
- change over time. Line numbers and other source details may
54
- thus be different from what is shown here and below.
52
+ > ** NOTE** The example in the repository for this chapter may change over time. Line numbers and
53
+ > other source details may thus be different from what is shown here and below.
54
+ >
55
+ > If the program fails to halt after starting, and you end up somewhere deeper in the program like
56
+ > the following, then try running ` monitor reset halt ` to reset. This is due to [ a bug] ( https://github.com/probe-rs/probe-rs/issues/3438 )
57
+ > in ` probe-rs ` , see [ issue #27 ] ( https://github.com/rust-embedded/discovery-mb2/issues/27 ) for
58
+ > more details.
59
+ > ``` shell
60
+ > (gdb) target remote :1337
61
+ > Remote debugging using :1337
62
+ > init::__cortex_m_rt_main () at mdbook/src/05-meet-your-software/examples/init.rs:19
63
+ > 19 asm::nop ();
64
+ > (gdb) monitor reset halt
65
+ > Resetting and halting target
66
+ > Target halted
67
+ > ` ` `
55
68
56
69
Next what we want to do is get to the ` main` function of our program. We will do this by first
57
70
setting a breakpoint there and then continuing program execution until we hit the breakpoint:
@@ -83,7 +96,7 @@ mode, on the GDB shell enter the following command:
83
96
(gdb) layout src
84
97
` ` `
85
98
86
- > ** NOTE** : Apologies Windows users. The GDB shipped with the GNU Arm Embedded Toolchain doesn't
99
+ > ** NOTE** Apologies Windows users. The GDB shipped with the GNU Arm Embedded Toolchain doesn' t
87
100
> support this TUI mode `:-(`.
88
101
89
102

@@ -151,7 +164,7 @@ never pass that statement. Instead, we'll switch to the disassemble view with th
151
164
command and advance one instruction at a time using `stepi`. You can always switch back into Rust
152
165
source code view later by issuing the `layout src` command again.
153
166
154
- > ** NOTE** : If you used the ` next ` or ` continue ` command by mistake and GDB got stuck, you can get
167
+ > **NOTE** If you used the `next` or `continue` command by mistake and GDB got stuck, you can get
155
168
> unstuck by hitting `Ctrl+C`.
156
169
157
170
```
@@ -239,7 +252,7 @@ Ending remote debugging.
239
252
[Inferior 1 (Remote target) detached]
240
253
```
241
254
242
- > ** NOTE** : If the default GDB CLI is not to your liking check out [ gdb-dashboard] . It uses Python
255
+ > **NOTE** If the default GDB CLI is not to your liking check out [gdb-dashboard]. It uses Python
243
256
> to turn the default GDB CLI into a dashboard that shows registers, the source view, the assembly
244
257
> view and other things.
245
258
0 commit comments