// Open FastMM_FullDebugMode.dpr ____________________________________________________________ // -== Find ==- {$define JCLDebug} {.$define madExcept} {.$define EurekaLog} // -== Replace with ==- {.$define JCLDebug} {.$define madExcept} {.$define EurekaLog} // EurekaLog 5/EurekaLog 6 {.$define EurekaLog_Ver7} // EurekaLog 7+ ____________________________________________________________ // -== Find ==- uses {$ifdef JCLDebug}JCLDebug{$endif} {$ifdef madExcept}madStackTrace{$endif} {$ifdef EurekaLog}ExceptionLog{$endif}, SysUtils, Windows; // -== Replace with ==- {$ifdef EurekaLog_Ver7} {$define EurekaLog_NEW} {$undef EurekaLog_OLD} {$else} {$ifdef EurekaLog} {$undef EurekaLog_NEW} {$define EurekaLog_OLD} {$endif} {$endif} uses {$ifdef JCLDebug}JCLDebug{$endif} {$ifdef madExcept}madStackTrace{$endif} {$ifdef EurekaLog_NEW}EFastMM4Support{$endif} {$ifdef EurekaLog_OLD}ExceptionLog{$endif} , SysUtils, Windows; ____________________________________________________________ // -== Find ==- {$ifdef EurekaLog} // -== Replace with ==- {$ifdef EurekaLog_OLD} ____________________________________________________________ // -== Find ==- {$endif} {-----------------------------Exported Functions----------------------------} exports GetFrameBasedStackTrace, GetRawStackTrace, LogStackTrace; // -== Replace with ==- {$endif} {$ifdef EurekaLog_NEW} function LogStackTrace(AReturnAddresses: PNativeUInt; AMaxDepth: Cardinal; ABuffer: PAnsiChar): PAnsiChar; begin {Needs EurekaLog 7.0.7.15 or a newer build} Result := Pointer(EFastMM4Support.FastMM_LogStackTrace(Pointer(AReturnAddresses), AMaxDepth, Pointer(ABuffer), MaxInt { TODO: buffer limitation? }, [ddModule, ddUnit, ddProcedure, ddSourceCode], // which entries to show True, // show module names True, // show offset from Address to LineNumber symbol location (in bytes) True, // show offset from Address to ProcedureName symbol location (in lines) True, // show offset from module's start = Address - Module (bytes) True, // show RAW pointer True // show line number )); end; {$endif} function FM4AllocMem(const ASize: Integer): Pointer; begin Result := AllocMem(ASize); end; procedure FM4FreeMem(const AMem: Pointer); begin FreeMem(AMem); end; {-----------------------------Exported Functions----------------------------} exports GetFrameBasedStackTrace, GetRawStackTrace, LogStackTrace, FM4AllocMem, FM4FreeMem; ____________________________________________________________