Re: debugging inline assembly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08/09/2013 12:55 PM, Christos wrote:
Hi all,

I know that there is an old thread about that but I just found only the
question.

Is it possible to debug inlined assembly.

Yes.

It causes seg fault and I
don't know why...

You do it much like "normal assembly". Run your program under gdb, place a breakpoint before the statement you are interested in, then use gdb's "si" and "ni" commands to step instruction by instruction through the code.

Follow along with what is happening by looking at the register and memory state ("info reg" and "x...").

You should be able to get a dissassembly of the code either with the gdb "xi" command, or the stand-alone objdump program with "objdump -d"

It is also helpful to have an ISA manual for the processor in question close at hand.

David Daney






[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux