I have a large project consisting of one exe (C++) and several dlls (C++) and bpl (delphi ). My target architecture is x64. I ran into a problem in bpl - package. When I tried to debug it, I saw that the breakpoints do not work:
I made a minimal reproducible example. I made three clean projects (exe c++, exe delphi, bpl delphi) and wrote the code for them:
exe c++:
#include <vcl.h>
#include "Unit2.hpp"
#pragma comment(lib, "Package1")
int WINAPI _tWinMain(HINSTANCE, HINSTANCE, LPTSTR, int)
{
TComponent* cmp = nullptr;
Unit2::TForm2* frm = new Unit2::TForm2(cmp);
frm->Button1Click(nullptr);
return 0;
}
exe delphi:
unit Unit4;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Unit2;
type
TForm4 = class(TForm)
procedure FormCreate(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form4: TForm4;
implementation
{$R *.dfm}
procedure TForm4.FormCreate(Sender: TObject);
var
frm: TForm2;
begin
frm := TForm2.Create(nil);
frm.Button1Click(nil);
end;
end.
bpl delphi:
unit Unit2;
interface
uses
Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls;
type
TForm2 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form2: TForm2;
implementation
{$R *.dfm}
procedure TForm2.Button1Click(Sender: TObject);
var
i: integer;
begin
i := 678;
end;
end.
I tested 4 debug combinations:
- exe (C++ x86) and bpl(delphi x86) - debug working
- exe (delphi x86) and bpl(delphi x86) - debug working
- exe (delphi x64) and bpl(delphi x64) - debug working
- exe (C++ x64) and bpl(delphi x64) - debug not working
Why doesn't the combination exe (C++ x64) and bpl(delphi x64) allow me to debug bpl? I don't know how to defeat my problem.
OS: Windows 10 x64
IDE: Embarcadero RAD Studio 11.2