diff --git a/doc/Quickstart.md b/doc/Quickstart.md index 3d1c7b5a21f11307d4851487eff921187cb6b585..44fbc180c0935f101bb12cf390d9f71aa20425f9 100644 --- a/doc/Quickstart.md +++ b/doc/Quickstart.md @@ -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