update README.md
This commit is contained in:
parent
13983f9a6e
commit
44b8a07a42
14
README.md
14
README.md
@ -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:
|
||||||
|
Loading…
Reference in New Issue
Block a user