How to debug assembly code in native mode

How to debug assembly code in native mode

Hi all,

I have a main function written in C and another function written in assembly using binutil assembler syntax (.s file). I can compile and run and debug the program with no problem but I cannot go into the function written in assembly code. I know there is no debug information in the .s file. But is it possible to go into it and run each instruction? I have tried nexti and stepi but no luck. Currently the only way is:

disassemble the main function, find the call instruction in main function and obtain the memory location for the instructions of the function written in assembly, set breakpoints at that location and for each instruction I have set one breakpoint so I can run single instruction in that way. This makes debugging such a nightmare...

My question is: is it possible for idbc to do this automatically? I mean, break the function written in assembly code and run single instruction at one time. Any help is greatly appreciated. Thank you very much!

Best

Deyang Gu

3 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I am certainly no expert at debugging assembly but I would have expected stepi to work. Have you tried using gdb? The idbc debugger has gone into maintenance mode and from here on in, any fixes or new features will be put into gdb.

Quote:

Frances Roth (Intel) wrote:

I am certainly no expert at debugging assembly but I would have expected stepi to work. Have you tried using gdb? The idbc debugger has gone into maintenance mode and from here on in, any fixes or new features will be put into gdb.

Yes. It actually works...I am sorry I made a silly mistake and asked such a stupid question...I am really sorry for that. 

The thing is, I need to run "disassemble Address1 Address2" so I can see all the instructions at the same time. Then by adding a breakpoint at the point of address1, I am able to use ni and si to navigate instruction by instruction.

I haven't got a chance to try gdb yet. I am not the system administrator and I don't even know if GDB is available now. The project is an intensive one. I will report again if I have a chance and time to try it. Thanks Frances.

Best

Deyang Gu

Leave a Comment

Please sign in to add a comment. Not a member? Join today