Find current runtime in Delphi at runtime

I wrote a delphi program that grew to some complexitiy. Now I am faced with the problem that I presented an endless loop somewhere, but I cannot find the location. The program is a real-time application and hangs indefinitely. Is it possible to pause the exhumation and find out where my program is currently?

When I use the delphi debugger pause button, it always breaks in the cpu window in a line called ntdll.RtlUserThreadStart , it seems to be a kind of os method, but I have no idea what that means. Even going through assembler doesn't return me in any line of my code. Is it possible to say that the debugger stops at a harsh line in my code, where is it running?

+4
source share
2 answers

The debugger can show the stack trace of another thread, and then what you expect when the program pauses. You can check this from the Status Status window (Ctrl + Alt + T).

+11
source

When you pause the debugger, it will not necessarily show you the "main" thread, but all threads will be suspended. Use the stream debug window to select a different stream.

The current execution point may not be in your code. Use the debug window in the call stack to find out how your program got to where it is and select that point in the stack that interests you. You can use the "exit" command to leave the current function and return to the caller. This is useful when the debugger pauses your program in a library function for which you have no source.

+9
source

Source: https://habr.com/ru/post/1490717/


All Articles