Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debugging assembly

How do I debug assembly code? I'm on Linux and have gdb handy. I know I can watch registers. What are some methods for debugging assembly code?

like image 381
Scott Avatar asked Jan 19 '10 08:01

Scott


People also ask

How do I debug an assembly?

You start debugging by clicking Start Debugging on the Debug menu. On the Start Debugging dialog box, check Enable Assembler debugging, then click OK. If you debug the module again during the same session, you can start it by clicking Start Debugging, Run or Debug.

Can you use gdb on assembly?

gdb is the GNU source-level debugger that is standard on linux (and many other unix) systems. It can be used both for programs written in high-level languages like C and C++ and for assembly code programs; this document concentrates on the latter.

What is a breakpoint assembly?

A breakpoint is traditionally defined as a place in your program where you want execution to stop so that you can examine program variables and data structures. A watchpoint causes your program to be executed one instruction or source line at a time, watching for the value of an expression to become true.

How do I get assembly code in Visual Studio?

You can normally see assembly code while debugging C++ in visual studio (and eclipse too). For this in Visual Studio put a breakpoint on code in question and when debugger hits it rigth click and find "Go To Assembly" ( or press CTRL+ALT+D ) Second approach is to generate assembly listings while compiling.


1 Answers

You can of course use breakpoints just as with C or any other compiled language, too. This article describes the process of debugging an assembly program a bit.

like image 174
unwind Avatar answered Sep 21 '22 18:09

unwind