When to use assembly language to debug a c/c++ program?

By : Kim
Source: Stackoverflow.com
Question!

When to use the assembly to debug a c/c++ program?

Does it help to learn some assembly to debug programs?

By : Kim


Answers

I think you will need to learn assembly some time or the other. Knowing assembly is the only way out if a bug is reproducible in a release build only or while debugging a third party library where you don't have the source code. There are more reasons to learn assembly than not to.

You may also want to have a look at my recent articles on debugging in assembly better - http://mohit.io/blog/assembly-and-the-art-of-debugging/

Update -> If you would like to change the behavior of your code at runtime without recompilation, then learning assembly is a must. Have a look at http://mohit.io/blog/debugging-modifying-code-at-runtime/

By : mohit


It's useful for debugging optimized release builds; in particular, when a customer sends you a minidump from your application out in the field. In these cases many debuggers are quite weak at keeping track of local variables, and you have to go fish them out of the stack (or registers) by hand.



I have has some use for my assembly skills searching for bugs that was cause by a new release of the compiler we were using. But compiler bugs are very rare so my answer would be no not for debugging.

It is interesting to look at how the compiler solves a problem in assembly from your source but that is not really debugging.

By : Gerhard


This video can help you solving your question :)
By: admin