Delphi poor mans debugging trick: approximate the source location of an exception address
Posted by jpluimers on 2014/09/24
A while ago, I had a client with an exception on a workstation.
There was no permission to run a debugger on their system, or use something like MadExcept or Exceptional Magic in their code base.
The exception looked like this:
--------------------------- Application Error --------------------------- Exception EInOutError in module MyApplication.exe at 001656B1.File access denied. --------------------------- OK ---------------------------
These are the steps to get at the source line in an x86 Delphi program (I still have to try the x64, but presume it works similarly):
- Go to the Project Options dialog
- Browse to Delphi Compiler; Linking
- Note the value of the Image Base setting (in this case $400000
- Add that to the value from the error dialog ($001656B1 + $400000 = $005656B1)
- Use F7 to step into your executable
- In the menu goto View; Debug Windows; CPU Windows; Entire CPU
- Press Ctrl-G then enter $005656B1
- Press Ctrl-V to go to the source code line
Convoluted, but it works (:
–jeroen






Новости из мира Delphi 22.09 – 28.09 2014 | Delphi 2010 ru said
[…] Delphi poor mans debugging trick: approximate the source location of an exception address […]
LDS said
Even eaiser… run the program, pause it, Search -> Go to address (it appears in the Search menu only while debugging) – of course you need the same executable for which the error address was recorded.
jpluimers said
That doesn’t always work. Hence my trick.