We have a Delphi COM component being called from an ISAPI web app. The COM component is hanging the app because it is trying to display a MessageBox(). We have no MessageBox() call in our user code so it must be located in the Delphi runtime source, probably in exception handler code.
We have an IIS debug diagnostics report that shows our module name + an offset address as the offending code.
We have a .MAP file for our module and we also have produced a .dbg file using MAP2DBG.
Our question is how do we locate the source file line of code using the IIS debug diag hang report containing the offset address, using the .MAP or .DBG file?
We’ve tried to use WinDbg but have not been able to figure out what we need to do to locate the source line.
Firstly you need to find the base address where the process loaded the COM module in to the IIS process – this may be evident by the IIS Debug log. Lets call this BASE.
Then you calculate the MAPoffset = offset – BASE – $1000 and you have an address that can be searched for in the Delphi MAP file.
In the MAP file (which should be detailed to get line number mapping) you will find a section for each source module which list records of “linenumber segment:offset”. Then you check if MAPoffset is either equal to an offset or in between two of the line number offsets. This should give you a direction to which line is the offending line.
The segment is usually 1 – indicating a text segment with generated code – (there is a segment map in the top of the MAP file).
Hope this helps!