update README.md

This commit is contained in:
Alexis Pereda 2020-03-26 10:57:52 +01:00
parent 13983f9a6e
commit 44b8a07a42
1 changed files with 10 additions and 4 deletions

View File

@ -8,7 +8,7 @@ These examples codes are **not** for production and often are simplified with re
```bash ```bash
mkdir build mkdir build
cd build cd build
cmake .. cmake -DCMAKE_BUILD_TYPE=Release ..
make make
``` ```
@ -19,10 +19,16 @@ then run any example binary, located inside the `build/examples/` directory.
### Assembler code ### Assembler code
Some examples are meant to show the assembler code they generate. Some examples are meant to show the assembler code they generate.
To see that, one can use for example https://godbolt.org/ or GDB. To see that, one can use for example https://godbolt.org/ or objdump or GDB.
With GDB: As objdump cannot only dump a specific function, here is the GDB version:
```bash ```bash
gdb -q -ex 'disassemble main' -ex q "${program_to_execute}" gdb -batch -ex 'set disassembly-flavor intel' -ex 'set print asm-demangle on' -ex 'disassemble main' "${program_to_execute}"
```
One can create an alias to ease the usage of GDB:
```bash
alias disas="gdb -batch -ex 'set disassembly-flavor intel' -ex 'set print asm-demangle on' -ex 'disassemble main'"
disas "${program_to_execute}"
``` ```
Important note: Important note: