GetSourceInfoByAddr function

Top  Previous  Next

EurekaLog includes a function called GetSourceInfoByAddr, that enables you to obtain debug information of a specific memory address (ex: the unit name or the line number).

 

Syntax of this function is as follows:

 

function GetSourceInfoByAddr(Addr: DWord; DebugInfo: PEurekaDebugInfo): Boolean;

 

 

Example:

 

 

uses ExceptionLog; // The required unit...

 

function GetSourceCodeStringFromAddr(Addr: DWord): string;

var

  DebugInfo: TEurekaDebugInfo;

begin

  Result := '';

 

  if GetSourceInfoByAddr(Addr, @DebugInfo) then

  begin

    Result := Format('%s.%s.%s.%d[%d]', [

      DebugInfo.UnitName, DebugInfo.ClassName,

      DebugInfo.ProcedureName, DebugInfo.Line,

      DebugInfo.ProcOffsetLine]);

  end;

end;