Autor Beitrag
Marco D.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 19.05.07 15:20 
Ich bekomme ständig eine AV:
Zitat:
---------------------------
Benachrichtigung über Debugger-Exception
---------------------------
Im Projekt Glass.exe ist eine Exception der Klasse EAccessViolation aufgetreten. Meldung: 'Zugriffsverletzung bei Adresse 0045A32D in Modul 'Glass.exe'. Lesen von Adresse 00000014'. Prozess wurde angehalten. Mit Einzelne Anweisung oder Start fortsetzen.
---------------------------
OK Hilfe
---------------------------


Wie bekomme ich denn anhand dessen die Zeile heraus, in der sie ausgelöst wird?

Moderiert von user profile iconTino: Quote-Tags hinzugefügt

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
F34r0fTh3D4rk
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 5284
Erhaltene Danke: 27

Win Vista (32), Win 7 (64)
Eclipse, SciTE, Lazarus
BeitragVerfasst: Sa 19.05.07 15:28 
anhand dessen nicht, aber du kannst breakpoints setzen, wenn du wissen willst, woher der Fehler kommt.

mfg
Chryzler
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1097
Erhaltene Danke: 2



BeitragVerfasst: Sa 19.05.07 15:43 
Auf torry.net gabs mal ne Werbung für eine Software (Plug-in für Delphi oder Kompo, kA), mit der man bequem die genaue Zeile herausfinden konnte, sobald eine AV auftritt.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 19.05.07 16:08 
Wozu? Nennt sich Delphi-IDE und ist zu finden unter Suchen --> Laufzeitfehler ...

Lediglich Debug-Infos müssen aktiv sein UND der Debugger muss grad laufen.

Ggf. einfach unter Ansicht --> Debug-Fenster mal den Call-Stack herauskramen und ein wenig rumklicken ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
arj
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 378

Win XP/Vista, Debian, (K)Ubuntu
Delphi 5 Prof, Delphi 7 Prof, C# (#Develop, VS 2005), Java (Eclipse), C++, QT, PHP, Python
BeitragVerfasst: Sa 19.05.07 16:08 
Naja, diese Software gabs, wie die heißt weis ich auch nicht mehr, war aber nicht ganz billig.

Aber es sollte ja auch möglich sein ohne die Software rauszubekommen wo die AV geschmissen wird.
Geh mal so vor. Debug mal deine Anwendung und setzt alle 20 - 30 Zeilen (oder auch weniger, je nachdem wie
groß dein Code ist) einen Breakpoint. Dann lässt du immer stückweise laufen.
So kannst du es enger eingrenzen. Dann weißt du zwischen welchen der Fehler liegt,
jetzt die Breakpoints dort enger machen.

Kann sein, dass das allerdings nichts zutage fördert, da da dann eine harmlose Anweisung steht.
In diesem Falle mal prüfen, ob du irgendwo einen uninitialisierten Pointer oder sonst irgendwas in
die Richtung machst.

Oder eben so wie gerade oben gepostet.
Martok
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 3661
Erhaltene Danke: 604

Win 8.1, Win 10 x64
Pascal: Lazarus Snapshot, Delphi 7,2007; PHP, JS: WebStorm
BeitragVerfasst: Sa 19.05.07 16:24 
user profile iconBenBE hat folgendes geschrieben:
Wozu? Nennt sich Delphi-IDE und ist zu finden unter Suchen --> Laufzeitfehler ...

Lediglich Debug-Infos müssen aktiv sein UND der Debugger muss grad laufen.

Und das wichtigste: in PE-Versionen gibt's das nicht. Nur Pro/Ent/usw.

Aber eigentlich sollte, wenn er denn Debug-Infos hat, der Debugger doch selber ungefähr die Zeile anzeigen...

_________________
"The phoenix's price isn't inevitable. It's not part of some deep balance built into the universe. It's just the parts of the game where you haven't figured out yet how to cheat."
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: Sa 19.05.07 16:57 
Alternativ (für die armen PE-Benutzer): Detailliertes MAP-File erzeugen lassen (Projekt --> Optionen --> Linker --> Mapfile --> Detailliert)

Dort dann einfach nach der Adresse suchen:

Hinweise:
- Die Basisadresse der EXE muss abgezogen werden (meist $00400000)
- Die Start-Adresse des Code-Segments muss abgezogen werden (meist $00001000)
- Gesucht ist die größte Adresse im Mapfile, die kleiner oder gleich der Fehler-Adresse ist.

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 19.05.07 20:40 
user profile iconBenBE hat folgendes geschrieben:
Wozu? Nennt sich Delphi-IDE und ist zu finden unter Suchen --> Laufzeitfehler ...

Lediglich Debug-Infos müssen aktiv sein UND der Debugger muss grad laufen.

Ggf. einfach unter Ansicht --> Debug-Fenster mal den Call-Stack herauskramen und ein wenig rumklicken ...

Wenn ich Suchen => Laufzeitfehler suchen verwende und die Adresse 0045A32D eingebe, komme ich ins CPU-Fenster. Wie schließe ich denn daraus auf die entsprechende Codezeile?

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
Marco D. Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 2750

Windows Vista
Delphi 7, Delphi 2005 PE, PHP 4 + 5 (Notepad++), Java (Eclipse), XML, XML Schema, ABAP, ABAP OO
BeitragVerfasst: Sa 19.05.07 21:00 
Thema hat sich erledigt: Ich hatte im Konstruktor einer von TImage abgeleiteten Klasse inherited Create(Aowner); vergessen. :lol:

_________________
Pascal keeps your hand tied. C gives you enough rope to hang yourself. C++ gives you enough rope to shoot yourself in the foot
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 20.05.07 09:03 
prinzipiell kann ich dir für sowas das Tool MadExcept empfehlen.
Damit kannst du in vielen Fällen bei Exceptions oder Acces Violation sogar die Quellcodezeile rausbekommen, die das Problem verursacht hat. Das vereinfacht das Debuggen schon erheblich!

_________________
In the beginning was the word.
And the word was content-type: text/plain.
BenBE
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 8721
Erhaltene Danke: 191

Win95, Win98SE, Win2K, WinXP
D1S, D3S, D4S, D5E, D6E, D7E, D9PE, D10E, D12P, DXEP, L0.9\FPC2.0
BeitragVerfasst: So 20.05.07 12:41 
madExcept kostet (und nicht grad wenig) und bläht die EXE auf ... Wenn man's kostenlos haben will, nimmt man aus Omorphia das Debug-Interface (ODbgIntf.pas), schreibt sich seinen Handler und kann die Meldung sogar noch vor Delphi abfangen, bekommt vollständige Debug-Infos (vorausgesetzt MAP-File ist erzeugt, ...) und nen vollständigen Stacktrace. UND hat den Vorteil, dass man nem Endkunden ne EXE ohne Debug-Infos geben kann, womit dieser keine Rückschlüsse auf den Programmaufbau ziehen kann, außer er zerlegt das Teil vollständig, man aber leicht anhand der EXE und der MAP-File die genaue Fehlerzeile rausbekommt.

Außerdem hat madExcept (zumindest in den Versionen, wo ich's getestet hatte) einige Nebenwirkungen gehabt, weil es sich einfach überall reingehängt hat.

Einziger wesentlicher Nachteil am ODbgIntf ist, dass es jegliche Exceptions abfängt, was aber, da Exceptions eh die Ausnahme sein sollten, kein Problem ist. Und das ODbgIntf ist nichts für Leute, die nicht wissen, was sie tun ...

_________________
Anyone who is capable of being elected president should on no account be allowed to do the job.
Ich code EdgeMonkey - In dubio pro Setting.
matze
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 4613
Erhaltene Danke: 24

XP home, prof
Delphi 2009 Prof,
BeitragVerfasst: So 20.05.07 16:09 
ja da hat BenBE schon recht, dass Mad Except die EXE sehr aufbläht.
Ich denke, dass das für die persönlichen Zwecke umsonst ist...? Naja auf jeden Fall kann man das ja lokal zum Testen in die EXE mit hineinkompliieren und wenn man das Produkt dann ausliefert wieder rausnehmen.

_________________
In the beginning was the word.
And the word was content-type: text/plain.