Debugging inline assembly



  • If I put a breakpoint before the asm directive when I trace the debugger jumps over the assembly code. Is that limitation of Qt Creator or it is something else? Can I step into the assembly code too?

    @
    int __add(int a, int b)
    {
    int result = 0;

    __asm__(
        "  mov 1,eax\n"
        "  add 2,eax\n"
        "  mov eax,0\n"
        :"=r" (result)
        :"r" (a), "r" (b)
        :"eax"
    );
    return result;
    

    }*/@

    Note: For some reason I cannot put the percent sign, so I had to remove it.

    EDIT: I use MinGW on Windows 7.


  • Lifetime Qt Champion

    Hi,

    You should also add which OS you are running on and which compiler/debugger you are using



  • By default gdb single steps by statement. It seems the assembly block is treated as a single statement. Gdb can single step by machine instruction and Qt Creator provides a toolbar control to switch to this mode (at the top of the debugging panel, at least on Linux).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.