Permanently Change Disassembly Flavor in GDB
gdb executes a ~/.gdbinit file when it starts, if present; you should be able to add the line
set disassembly-flavor intel
to it.
How to change the disassembly syntax to intel using gdb?
Please use:
set disassembly-flavor intel
see GDB Manual for more details
How to make Eclipse disassemble the code in Intel syntax
Create a file with set disassembly-flavor intel
in it, you can use ~/.gdbinit
as the file if you want.
Then point your launch configuration at the file you created.
Without the launch configuration change your disassembly may look like:
15 puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
000000000040053a: mov $0x4005d4,%edi
000000000040053f: callq 0x400410 <puts@plt>
With the gdb init file you get the Intel syntax:
15 puts("!!!Hello World!!!"); /* prints !!!Hello World!!! */
000000000040053a: mov edi,0x4005d4
000000000040053f: call 0x400410 <puts@plt>
Note CDT does not pick up ~/.gdbinit
unless you explicitly set it in the launch configuration. Here is a screenshot of the launch configuration:
Globally
You can make the change global (for all new launch configurations at least) by setting the GDB command file in the preferences too:
Credit to Permanently Change Disassembly Flavor in GDB for the GDB part of the change.
Related Topics
Need an Overview of Debugging Process from the Hardware Layer
How to Find a List of Ip Addresses in Another File
Automatic Login on Angstrom Linux
Embedding the Password in the Bash Script
Create a Dedicated Folder for Every Zip Files in a Directory and Extract Zip Files
Bash History Without Line Numbers
Can You Attach Amazon Ebs to Multiple Instances
Signals and Interrupts a Comparison
Starting a Shell in the Docker Alpine Container
How to Append Contents of Multiple Files into One File
Determining the Path That a Yum Package Installed To
How to Configure a Systemd Service to Restart Periodically