Skip to content
Snippets Groups Projects
Commit 923edb8b authored by Jorge Aparicio's avatar Jorge Aparicio
Browse files

mention the `disassemble` GDB command

parent 58eb6e02
Branches
No related tags found
No related merge requests found
......@@ -88,7 +88,7 @@ commands check out the [troubleshooting guide][troubleshoot].
$ # fetch the Cargo project template
$ cargo clone cortex-m-quickstart
$ # rename it as you wish
$ # rename it as you wish (remember this name! you'll use it later)
$ mv cortex-m-quickstart app
$ cd app
......@@ -414,6 +414,21 @@ about to execute using the `list` command:
340 #[cfg(not(has_fpu))]
```
And you can print the machine code that the processor is about to execute using the `disassemble`
command.
``` console
(gdb) disassemble
Dump of assembler code for function cortex_m_rt::reset_handler:
0x08000130 <+0>: push {r7, lr}
0x08000132 <+2>: mov r7, sp
0x08000134 <+4>: sub sp, #32
=> 0x08000136 <+6>: movw r0, #0
0x0800013a <+10>: movw r1, #0
0x0800013e <+14>: movt r0, #8192 ; 0x2000
0x08000142 <+18>: movt r1, #8192 ; 0x2000
```
We can skip to our program `main` by creating a breakpoint and then calling `continue`.
``` console
......@@ -461,7 +476,7 @@ xPSR: 0x01000000 pc: 0x08000400 msp: 0x20005000, semihosting
This is the same command we ran before from the `telnet` prompt.
You can find the list of all the GDB commands [here][gdb-commands].
Tip: You can get list of all the GDB commands by entering `help all` in the GDB prompt.
Note that semihosting is *very slow*. Each write operation takes *hundreds* of milliseconds; the
processor will be in a halted state for the duration of the write operation. Semihosting is nice
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment