【发布时间】:2021-05-05 10:59:10
【问题描述】:
我想让我的堆栈跟踪包含单元名称/方法/行。任何可以真正帮助使其更具可读性的东西。我知道这在过去有效,但它已经停止工作......
我已启用
{$DEFINE FullDebugMode}
{$DEFINE RawStackTraces}
{$DEFINE CheckHeapForCorruption}
{$DEFINE EnableMemoryLeakReporting}
{$DEFINE ClearLogFileOnStartup}
{$DEFINE UseOutputDebugString}
我在可执行编译目录中有 32+64bit dll。
我已为 32 位/64 位启用了项目选项中的所有调试选项(符号引用设置为引用信息)。
我使用的是最新版本。
我在项目 dpr 文件的 uses 子句中将 FastMM 列为第一个单元。
我使用 Delphi XE4。
我 100% 检查了正确的定义组,通过输入乱码以引发编译时错误(即,我在发布/调试构建时没有做错)
我还能尝试什么?
....
@fpiette 建议我发布一个测试项目。我会把它包括在这里...
Project1.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“瞄准”相同类型的构建。
解决方案在项目选项-链接选项中启用调试信息/详细地图文件。
【问题讨论】:
-
只是为了确定:您正在构建调试版本?
-
是的。否则在 IDE 中调试可以正常工作。
-
如果您创建一个全新的简单项目会发生什么?
-
这似乎可行...奇怪...相同的项目设置,目标等。
-
很高兴为您提供帮助。我总结了一个答案,以便您接受它:-)