ottokb
asked on
Debug doesn't want to stop at a breakpoint
I am working with delphi 2.0 for sometime now, and for no reason(as it appears to me) the debugger does not seem to function properly anymore!
Whenever I run my program in the delphi environment, it will only stop at the first breakpoint it encounters. Pressing F7 or F8 (step into or step over) gives the same result as F9 (run). The next time it passes the same breakpoint it won't stop.(I put one in the oncreate of a mdi child, and only at the first mdi I created the program stops, on all other created mdi childs, the program won't stop, as if the break (all the breaks by the way) has disappeared!) So debugging gets irritating.
If I load an other project (a demo one for instance) the debugger works fine.(it stop at every break I put into it) So I expect I did something wrong during the programming I did (which is just forms, dialogs, and straight forward programming, no low level things).
Has anyone encountered this as well, and if you did, how did you solve this problem?
Whenever I run my program in the delphi environment, it will only stop at the first breakpoint it encounters. Pressing F7 or F8 (step into or step over) gives the same result as F9 (run). The next time it passes the same breakpoint it won't stop.(I put one in the oncreate of a mdi child, and only at the first mdi I created the program stops, on all other created mdi childs, the program won't stop, as if the break (all the breaks by the way) has disappeared!) So debugging gets irritating.
If I load an other project (a demo one for instance) the debugger works fine.(it stop at every break I put into it) So I expect I did something wrong during the programming I did (which is just forms, dialogs, and straight forward programming, no low level things).
Has anyone encountered this as well, and if you did, how did you solve this problem?
ASKER
Edited text of question
ASKER
Appearently the question led to a miscommunication, so I extended the question a bit.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
While we're on the subject of breakpoints, there is a further bug in delphi 2 which you probably know about, but here it is for completeness. It occurs when you delete a line that has a breakpoint on it. The breakpoint seems to vanish, but infact it doesn't ,it moves to the next line and doesn't display itself. Your code subsequently breaks at this line despite the apparent absence of a breakpoint. The best solution here is to use the View|Breakpoints menu to clean up the mess. Apparently this bug is sorted in Delphi 3.
Steven.
Steven.
If I'm correct and this is whats causing your problem then the best solution is to learn which lines always generate executable code and always put your breakpoints on these sort of lines. The best example of a line which always generates code is an assign statement such as : a := 12; or conditionals: if {..} then {..}. Lines to avoid are comments, begins and ends.
Steven.