[fpc-devel] no break and stepping if ctheads is used (Lazarus)

Graeme Geldenhuys graemeg.lists at gmail.com
Thu Mar 4 13:21:15 CET 2010

Michael Schnell het geskryf:
> Doing another command line tool I found that if I enable cthreads, the
> debugger stops working correctly.
> I set -dUseCThreads or otherwise enable "use cthreads".
> If I start the program with F7 I get to the "begin" in the source code
> but the next F7 just runs the program without a break.
> If I set a breakpoint and start the program with F9 the program just
> runs but does not break.

I use cthreads in our applications and it is enabled. I have no problems
stepping through my program or stopping at breakpoints.

I use FPC 2.4.1 r13804 with Lazarus IDE (GTK2) v0.9.29 r23696. All 64-bit
versions running on Ubuntu 8.04.2 LTS.

> I tested this with a new "Program" that just contains two writeln();
> Of course everything works fine if "cthreads" is not used.

Are you running the program with console output (terminal) enabled via the
Lazarus IDE? If so, then breakpoints or debugging will not work at all
because Lazarus IDE is then debugging the 'xterm' application instead of
your application running inside that xterm session. A known bug in Lazarus IDE.

Try debugging from the command line using GDB directly.

  - Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal

More information about the fpc-devel mailing list