stack trace in exception
Here is the !pe output from WinDbg when there is an exception. It shows exactly the function name where exception occurs.
My question is, how to show the line in the source code which triggers the exception?
Here is WinDbg output.
Exception object: 0000000002651ac0
Exception type: System.Exception
Message: Hello Exception Debug
SP IP Function
000000000012EFF0 00000642801501F4 TestDebug!TestDebug.Program.foo()+0x64
000000000012F030 000006428015014D TestDebug!TestDebug.Program.Main(System.String)+0x2d
thanks in advance,
Looks like 100 (0x64) bytes into the function foo(). As to what line number that is, I'd view a mixed source and assembly listing and see what turns up at [roughly - stack trace is not always 100% accurate, so the suspect could be one or three instructions above where it's reported from] 100 bytes into the function.
I am very interested in your solution. Any idea about how to get the source code for the 100bytes of the function?
Originally Posted by matsp
Just look at the disassembly. The "u" command will list assembly code. If the function is relatively short, "u function" or "u address" will be fine. If it's a long function, there's a way to limit the number of lines disassembled - I can't quite remember what that is, but if you do "help u" it will show you the information of that command.