首页 > 解决方案 > 在 FastMM 堆栈跟踪中看不到单元名称/方法

问题描述

我想让我的堆栈跟踪包含单元名称/方法/行。任何可以真正帮助使其更具可读性的东西。我知道这在过去有效,但它已经停止工作......

我已启用

  {$DEFINE FullDebugMode}
  {$DEFINE RawStackTraces}
  {$DEFINE CheckHeapForCorruption}
  {$DEFINE EnableMemoryLeakReporting}
  {$DEFINE ClearLogFileOnStartup}
  {$DEFINE UseOutputDebugString}

我在可执行编译目录中有 32+64bit dll。

我已经为 32 位/64 位启用了项目选项中的所有调试选项(符号引用设置为引用信息)。

我正在使用最新版本。

我将 FastMM 列为项目 dpr 文件中 uses 子句的第一个单元。

我使用德尔福 XE4。

我 100% 检查了正确的定义组,通过输入乱码以引发编译时错误(即,我没有在发布/调试版本中做错什么)

我还能尝试什么?

在此处输入图像描述

……

@fpiette 建议我发布一个测试项目。我将在此处包括...

项目1.dpr

program Project1;
uses
  FastMM4,
  Vcl.Forms,
  testmem in 'testmem.pas' {Form1};
{$R *.res}
begin
  Application.Initialize;
  Application.MainFormOnTaskbar := True;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.

testmem.pas

unit testmem;
interface
uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Buttons, Vcl.ExtCtrls, Vcl.StdCtrls;
type
  TForm1 = class(TForm)
    BitBtn1: TBitBtn;
    Panel1: TPanel;
    BitBtn2: TBitBtn;
    SpeedButton1: TSpeedButton;
    procedure FormCreate(Sender: TObject);
  private
  public
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.FormCreate(Sender: TObject);
var
b: TButton;
begin
b := TButton.Create(nil);
b.Parent := Self;
b.Free;
b.Free;
end;

这在我将预编译的 dll 移到目录中之后起作用了……不知道为什么它对我自己的项目不起作用,因为我做的完全一样……只是检查了项目选项中的调试设置和我在 Delphi 中的“目标” “同类型的构建。

解决方案在项目选项中启用调试信息/详细映射文件 - 链接选项。

标签: delphifastmm

解决方案


不知何故,您的项目已损坏。

从头开始重新创建项目(dpr 和 dproj,添加您手动添加到 dpr 的所有 pas 文件和代码)并确保选项如如何从 FastMM 获取堆栈跟踪中所述


推荐阅读