I know of otool -tv, but I would much rather use the Intel syntax rather than AT&Ts, mainly to easily follow along in a book and not have to look over thousands of %‘s and $‘s.
I’d also appreciate any tips to where I might find gdb‘s config file.
EDIT: I forgot: I’m running a 64bit processor, but was wondering if it would be possible to also disassemble into 32 bit assembly? Not only that, but does OSX’s gdb‘s list command work differently than the standard GNU version?
Thanks so much!
(Also, if you have any idea where I might find a little disassembler from C -> MIPS, that’d be very fun to play with. But not necessary!)
To answer your second question, if the code has been compiled into a fat binary with both 64-bit and 32-bit, you can use
otool -arch i386 -tvto disassemble the 32-bit slice of the binary;otool -arch x86_64 -tvwill give you the 64-bit portion (on SnowLeopard, this is also the default behavior if no-archflag is passed).Also note that while otool doesn’t support the Intel syntax, gdb (
set disassembly-flavor intel) and XCode (Preferences -> Debugging -> Disassembly Style) do.