Understand x86_64 on OSX10.6 (but with _Intel_ syntax)

I know otool -tv , but I would rather use Intel syntax rather than AT & Ts, mainly to easily follow in the book and not have to look through thousands of % and $ .,

I would also appreciate any advice where I could find the gdb configuration file.

EDIT: I forgot: I am running a 64-bit processor, but wondered if it can also be parsed into a 32-bit build? Not only that, but does the OSX gdb list command work than the standard GNU version?

Many thanks!

(Also, if you have an idea where I can find a little disassembler from C β†’ MIPS, it would be a lot of fun to play with, but not necessary!)

+7
assembly x86 x86-64 macos
source share
5 answers

To answer the second question, if the code was compiled into a bold binary file with a 64-bit and 32-bit version, you can use otool -arch i386 -tv to otool -arch i386 -tv 32-bit fragment of the binary; otool -arch x86_64 -tv will provide you with the 64-bit part (on SnowLeopard, this is also the default behavior if the -arch flag -arch not passed).

Also note that although otool does not support Intel syntax, gdb ( set disassembly-flavor intel ) and XCode (Preferences β†’ Debugging β†’ Disassembly Style) do.

+8
source share

With Objdump, you can parse with -d -M intel , and apparently -m can be used to specify the architecture.

+1
source share

You can use A2I to translate from AT & T to Intel syntax: http://membres.lycos.fr/placr/a2i.html

0
source share

For gdb in your .gdbinit file add:

install disassembly-taste intel

then this will be the default syntax for gdb.

0
source share

(I know this is an old question, but I want to provide an updated answer for people who come here through search engines).

In recent macOS (I use 10.14.5), the objdump command is available, based on LLVM and not on the GNU project. It offers a (hidden) disassembly option using Intel syntax. For example, /bin/echo can be parsed as follows:

 objdump -disassemble -x86-asm-syntax=intel /bin/echo 
0
source share

All Articles