Can I translate ADDRESS in a code line?
I receive from an application a message like this: "The instruction at 0xA.... referenced memory at 0xB..... The memory could not be "written". Click on OK to terminate the program"
the address 0xA looks valid: 0x10001053. Exe is mapped in memory by default开发者_运维问答 at 0x40000000 and dlls at 0x10000000 so it's in the first loaded dll at offset 1053h.
Does someone knows a method to transform this address into source line ?
You should be able to locate it with the help of a map file. You may need to tweak some of your compiler/linker options to get the map file generated with sufficient detail.
If you are using the MS compiler then you need /MAP linker option.
If you have an interactive debugger, open the disassembler window and look for the code label that precedes the assembler line. That should correspond to a function in the source code (or to a function that has inlined the code that caused the problem).
Another trick is to use the call stack window, that way you could see all calls from the main
function down to the function that caused the crash.
精彩评论