I have following basic questions :
When we should involve disassembly in debugging
How to interpret disassembly, For example below what does each segment stands for
00637CE3 8B 55 08 mov edx,dword ptr [arItem]
00637CE6 52 push edx
00637CE7 6A 00 push 0
00637CE9 8B 45 EC mov eax,dword ptr [result]
00637CEC 50 push eax
00637CED E8 3E E3 FF FF call getRequiredFields (00636030)
00637CF2 83 C4 0C add
Language : C++
Platform : Windows
It’s quite useful to estimate how efficient is the code emitted by the compiler.
For example, if you use an
std::vector::operator[]in a loop without disassembly it’s quite hard to guess that each call tooperator[]in fact requires two memory accesses but using an iterator for the same would require one memory access.In your example:
this is a typical sequence for calling a function – paramaters are pushed into stack and then the control is transferred to that function code (
callinstruction).Also using disassembly is quite useful when participating in arguments about “how it works after compilation” – like caf points in his answer to this question.