[Lazarus] Can Lazarus IDE debugger attach to already running process?

Martin lazarus at mfriebe.de
Wed Sep 18 19:30:19 CEST 2013


On 18/09/2013 16:49, Graeme Geldenhuys wrote:
> Hi,
>
> As the subject line says, can Lazarus IDE's debugger attach to a already
> running process? The running process is a program compiler earlier with
> Lazarus IDE. I know GDB [via CLI] can do this, but can you do it via the
> Lazarus IDE, so I have "visual debugging"?
Yes it can, but you mus know the PID. Lazarus will just ask for the pid.

Open the project, so you have the sources, then in the "run" menu you 
find the attach command. It will take 2 or 3 secs, and then popup an 
input for the pid

>
> If one can, how do I do it?
>
> Reason I ask:
> In Delphi it is a common way to debug CGI applications. You define an
> infinite loop in the CGI app. Execute the CGI app via the web browser.
> The infinite loop then gives you a change to attach the Delphi debugger.
> You then modify the variable of the infinite loop so it exits the loop.
> You can then step through the CGI application like any normal GUI or
> Console app. This is much easier than debugging with log files etc.
>

If you use an integer var, you can modify it from the IDE.

Do not modify managed types




More information about the Lazarus mailing list