update README.md

This commit is contained in:
Alexis Pereda 2020-03-26 10:57:52 +01:00
parent 13983f9a6e
commit 44b8a07a42

View File

@ -8,7 +8,7 @@ These examples codes are **not** for production and often are simplified with re
```bash
mkdir build
cd build
cmake ..
cmake -DCMAKE_BUILD_TYPE=Release ..
make
```
@ -19,10 +19,16 @@ then run any example binary, located inside the `build/examples/` directory.
### Assembler code
Some examples are meant to show the assembler code they generate.
To see that, one can use for example https://godbolt.org/ or GDB.
With GDB:
To see that, one can use for example https://godbolt.org/ or objdump or GDB.
As objdump cannot only dump a specific function, here is the GDB version:
```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: