Stopping delphi program in an infinite loop
问题 When an indefinite loop occurs in Delphi, the debugger will not even give me a stack trace when I hit the stop button. If I have a suspicion of where the program is stalling, I can put a breakpoint and it will stop if that is the correct indefinite loop. Here is a sample program to deliberately cause an indefinite loop: procedure TForm1.btnDebugInfiniteLoopClick(Sender: TObject); var I: Integer; begin I:=0; while I<100 do begin I:=1+1; if I>64 then I:=I div 2; end; end; When stopped, I get