Search code examples
assemblyx86lldbdisassemblyintel-syntax

Is there a way to specify syntax for x command output?


I want to know whether I can change the syntax of the output of the following command:

x/5i $rip

Now it gives output like that. I guess it is AT&T syntax, correct my if I'm wrong (newbie):

->  0x100000f96: bf 01 00 00 00  movl   $0x1, %edi
    0x100000f9b: be 02 00 00 00  movl   $0x2, %esi
    0x100000fa0: ba 03 00 00 00  movl   $0x3, %edx
    0x100000fa5: b9 04 00 00 00  movl   $0x4, %ecx
    0x100000faa: e8 b1 ff ff ff  callq  0x100000f60               ; test_func at main.c:4

What I want is to something like -F flag in the following command disassemble -n main -F intel. Is there any way to achieve that. I have not found anything neither using help x nor by googling. Thanks in advance!

Note: I am using lldb as a debugger.


Solution

  • Thanks to Jester for a clue. I have found the solution here.

    settings set target.x86-disassembly-flavor intel
    

    This will work for x command as well.