![]() |
DesignTime-Package debuggen?
n'abend, aktuell funktioniert mal wieder garnichts.
Normale EXE Debuggen ... kein Problem, aber DLL und vorallem RuntimePackages nerven nur noch. Aber ganz speziell die DesignTime-Packages. Ich hab's bei mir jetzt mal auf einen ganz einfachen Test reduziert. Hier die Anleitung, welche ich schonmal anfing für Emba zu schreiben. Funktioniert es so bei euch? Und mal ganz im Ernst, wer lässt wirklich die DebugDCUs aktiv, oder debuggt ihr niemals? Zitat:
Zitat:
und 'nen ganz einfaches Windows 11 Pro 23H2, ohne viel drauf. Mein Problem fing damit an, dass ich mir einen Komponenteneditor schreiben wollte, der bei ExecuteVerb einen Dialog anzeigen sollte. Meine TForm hab ich inzwischen auch schon komplett entmistet (kein Code und nur noch paar Comboboxen und Buttons drauf), aber (vermutlich) beim ShowModal bleibt die IDE hängen und macht nichts mehr, außer Beep, wenn ich versuche das IDE-Fenster anzuklicken. Per se wäre das so weit OK, bei einem modalen Fenster, aber Dieses ist nunmal nicht sichtbar und lässt sich auch nicht finden. Der Debugger hilft leider auch nicht, da ich nichts debuggen kann und wenn ich einfach an der Stelle "pausiere" dann seh ich im Stacktrace auch nicht viel, außer einen Eintrag mit meinem Package, aber da eben auch nur den Dateinamen, ohne Unit/Prozedur/Zeile/... Mit DebugDCUs seh ich aber natürlich die Codestellen von den Exceptions, in den RTL-Units, welche Delphi selber beim Start massenhaft wirft. |
AW: DesignTime-Package debuggen?
I want to share my experience with older versions like XE8 with something similar that might be relevant or not, just food for thought.
Zitat:
If you build and saved new and simple a project les say project1.exe, then it will work fine and debug fine and you can put break points and more importantly you can see symbols being resolved like method names... Now if you run this project1.exe by Windows Explorer then click choose to attach to process then we have two output: 1) if the project1.dpr is opened in the IDE then symbols will be resolved. 2) If no projects are opened or another project is opened, then the Debugger ignore all TDS info and no symbols will be resolved or shown, the debugger can't recognize the project1.exe and handle it as unknown without any debug info.. This is strange and frustrating, and it is a failure... the debugger had it all in TDSinfo yet it don't try. Anyways, i just wanted to give you hint about this behavior which very likely to be the case with lost debug info and symbols recognition. To confirm if this is the case, i suggest to repeat your steps, then use VMMap from ![]() Now, back to the paths, i don't know if this will help or not but it might be failing/confusing the opened dpr project with running BDS file instead of loaded package/library, so try to attach the bds.exe instead of loading it, who knows... it might resolve the loaded package project and resolve it, hence allowing you to debug, while losing the starting point, but this can be tweaked or workaround with different hacks, might be later talk for different situation. |
AW: DesignTime-Package debuggen?
Yes one more thing, the IDE is in capable handle project group the right way, so don't forget to try with single opened project (your package) and don't use project group, see if that help.
|
AW: DesignTime-Package debuggen?
Das Problem ist schon seit einer Weile bekannt. Eine Lösung dafür gibt es aber offenbar noch nicht.
![]() |
AW: DesignTime-Package debuggen?
oh neeeee :wall:
Wir sind grade eben erst von XE auf 11 umgestiegen. Und wir nutzen viele DLL und statische Packages. Anfangs ging dort das Debuggen. Aber inzwischen auch nicht mehr. Und ganz pervers ist, dass ein Kollege es geschafft hat, dass immer mit DebugDCUs kompiliert wird. (die Option ist aus und ich vermute verpfuschte Suchpfade) Auf dem Büro-Notebook konnte ich es so lösen, dass ich die DebugDCUs mit den ReleaseDCUs überschrieben hab, aber das ist auf dem Entwicklungs-Server keine Lösung. Eigentlich sollte FinalBuilder (MSBuild) das selbe erzeugen, was auch in der IDE erzeugt wird, aber anfangs ging es eben, aber nun auch wieder nicht. Manchmal geht es, wenn die Packages nochmal in der IDE kompiliert wird, aber eben auch nur noch auf knapp 50% der Entwicklerrechner ... sonst lassen sich Packages nicht mehr debuggen. Mein privates Ursprungsproblem wird immer schlimmer und ohne Debuggen weiß ich nur, dass es bis ins ShowModal geht und danach stochere ich im Dunklen. Das Einfache geht alles,
Delphi-Quellcode:
aber verusche ich es selbst, dann friert die IDE ein.
MessageBox(0, '123', nil, 0);
ShowMessage('123'); UseLatestCommonDialogs := False; ShowMessage('123');
Delphi-Quellcode:
OptionsDialog := {TOptionsDialog}TForm.Create(Self);
Result := OptionsDialog.ShowModal = mrOk;
Delphi-Quellcode:
Dabei macht doch ShowMessage mit UseLatestCommonDialogs=False auch "bloß" TForm.Create + ShowModal? :freak:
OutputDebugString('ShowOptionsDialog:1');
OptionsDialog := {TSerialComPortOptionsDialog}TForm.Create(Self); try OptionsDialog.Caption := 'TestTest123'; OptionsDialog.Position := poScreenCenter; OptionsDialog.ShowInTaskBar := True; OutputDebugString('ShowOptionsDialog:2'); Result := OptionsDialog.ShowModal = mrOk; OutputDebugString('ShowOptionsDialog:3'); finally OutputDebugString('ShowOptionsDialog:4'); OptionsDialog.Free; OutputDebugString('ShowOptionsDialog:5'); end; OutputDebugString('ShowOptionsDialog:6');
Delphi-Quellcode:
procedure ShowMessage(const Msg: string);
procedure ShowMessagePos(const Msg: string; X, Y: Integer); function MessageDlgPos(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer): Integer; function MessageDlgPosHelp(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; HelpCtx: Longint; X, Y: Integer; const HelpFileName: string): Integer; {} if ... and UseLatestCommonDialogs then {} else {} Result := DoMessageDlgPosHelp(CreateMessageDialog(Msg, DlgType, Buttons), HelpCtx, X, Y, HelpFileName); function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons): TForm; function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; DefaultButton: TMsgDlgBtn): TForm; function CreateMessageDialog(const Msg: string; DlgType: TMsgDlgType; Buttons: TMsgDlgButtons; DefaultButton: TMsgDlgBtn; CustomButtonCaptions: array of string): TForm; {} Result := TMessageForm.CreateNew(Application); function DoMessageDlgPosHelp(MessageDialog: TForm; HelpCtx: Longint; X, Y: Integer; const HelpFileName: string): Integer; {} {with do.}Position := poScreenCenter; {} Result := {with do.}ShowModal; |
AW: DesignTime-Package debuggen?
path means the working directory
and source comes from the currently opened project. Original in a project group, but the simple test without a project group. |
AW: DesignTime-Package debuggen?
Zumindest ist jetzt ein Problem gelöst.
Man muß innerhalb der IDE unbedingt Application als Owner für Forms verwenden. Ich hatte hier meine Komponente genommen, um darüber im OptionsDialog auf deren Einstellungen zuzugreifen. |
AW: DesignTime-Package debuggen?
Zitat:
wenn ICH ja die Speicherverwaltung übernehme, also vor allem beim Try-Finally, wo ich es selbst "gleich" wieder freigebe. |
AW: DesignTime-Package debuggen?
Ich compiliere im Debug Mode immer mit debug DCUs.
(nur, weil du das am Anfang gefragt hattest) Wenn man aus Versehen irgendwo reinspringt, geht man halt mit Shift+F8 wieder raus. Das ist mir lieber als wenn ich im Debugger gar nicht in die RTL springen kann. |
AW: DesignTime-Package debuggen?
Ich schalte des eigentlich nur an, wenn ich es brauche.
Wir kompilieren auf Arbeit nahezu alles über den FinalBuilder. Da hab ich es inzwischen mit Debuginfos, aber in externen TDS ... die werden standardmäßig in eine ZIP verschoben, so dass es normal ohne Debuginfos ist, aber notfalls können wir dann einfach die ZIP auspacken und haben dann mit. Früher hatten wir die Fremdkomponenten teilweise mit und ohne Debuginfos kompiliert und dann unsere Projekte mit einer Version davon ... zum Aktivieren mußte dann alles mit der anderen Version neu kompiliert werden. :freak: |
Alle Zeitangaben in WEZ +1. Es ist jetzt 11:08 Uhr. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz