0% found this document useful (0 votes)
44 views2 pages

D PTR (Ebp+0xc) ) That Is Popular Among Windows Users.: Default Mode

This document discusses the disassembly flavor setting in GDB, which determines whether code is disassembled using AT&T or Intel syntax. It provides examples of disassembling the same function using both styles. It also notes that VisualGDB by default uses Intel syntax for compatibility with Visual Studio disassembly output.

Uploaded by

John Sherchan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views2 pages

D PTR (Ebp+0xc) ) That Is Popular Among Windows Users.: Default Mode

This document discusses the disassembly flavor setting in GDB, which determines whether code is disassembled using AT&T or Intel syntax. It provides examples of disassembling the same function using both styles. It also notes that VisualGDB by default uses Intel syntax for compatibility with Visual Studio disassembly output.

Uploaded by

John Sherchan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

D PTR [ebp+0xc]) that is popular among Windows users.

Default mode

The default value for the disassembly-flavor setting is 'att'.


Examples

In this example we will disassemble a simple function using both AT&T and Intel styles:
int func(int a, int b)
{
return a + b;
}

We will compile it without optimization and load into GDB:


(gdb) show disassembly-flavor
The disassembly flavor is "att".
(gdb) disassemble func
Dump of assembler code for function func:
0x080483ed <+0>: push %ebp
0x080483ee <+1>: mov %esp,%ebp
0x080483f0 <+3>: mov 0xc(%ebp),%eax
0x080483f3 <+6>: mov 0x8(%ebp),%edx
0x080483f6 <+9>: add %edx,%eax
0x080483f8 <+11>: pop %ebp
0x080483f9 <+12>: ret
End of assembler dump.
(gdb) set disassembly-flavor intel
(gdb) disassemble func
Dump of assembler code for function func:
0x080483ed <+0>: push ebp
0x080483ee <+1>: mov ebp,esp
0x080483f0 <+3>: mov eax,DWORD PTR [ebp+0xc]
0x080483f3 <+6>: mov edx,DWORD PTR [ebp+0x8]
0x080483f6 <+9>: add eax,edx
0x080483f8 <+11>: pop ebp
0x080483f9 <+12>: ret
End of assembler dump.
(gdb) x/2i func
0x80483ed <func>: push ebp
0x80483ee <func+1>: mov ebp,esp
Compatibility with VisualGDB

VisualGDB automatically sets the disassembly flavor to Intel so that the disassembly
output similar to the native Visual Studio disassembly. You can change this by adding
the set disassembly-flavor command in the GDB Startup Commands list for your
project.
See also
Disassembly-related commands

,
disassemble

,
set disassemble-next

You might also like