Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2009-05

Lazarus ignores my breakpoints

10 messages · 5 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Graeme Geldenhuys

Hi,

Why is Lazarus ignoring my breakpoint? If I put a writeln() statement before line 1466, it is executed and I see console output. So that code is definitely being run. Yet Lazarus think it isn't and simply ignores the breakpoint - for no reason. See attached screenshot.

I'm using FPC 2.2.5, Lazarus 0.9.27 r19685 and GNU gdb 6.8-debian under Ubuntu Linux 9.04.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: Screenshot.png
Type: image/png
Size: 7096 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090505/98cbfe87/attachment.png

Reply by email

Graeme Geldenhuys
to Graeme Geldenhuys
Graeme Geldenhuys wrote
Hi, Why is Lazarus ignoring my breakpoint? ?If I put a writeln() statement before line 1466, it is executed and I see console output. So that

I place the following writeln() statement before line 1466 and below is some sample output, showing the writeln() is being run.

   writeln('******************************************');

==============[ console output ]==================== /home/graemeg/programming/tiOPF2/UnitTests/Text/textrunner -p --suite=TtiObjectTestCase

TtiObjectTestCase:
Owner: ... DONE
Parent_InheritsFromVsIs: ... DONE
Parent_TtiObject: ... DONE
Parent_TtiObjectList: ... DONE
OIDGenerator: ... DONE
GetOID: ... DONE
PropType: ... DONE
IsReadWriteProp: ... DONE
PropCount: ... DONE
SetPropValue: ... DONE
SetBooleanPropValue: ...****************************************** ERROR
GetPropValue: ... DONE
SetPropValueNested: ... DONE
GetPropValueNested: ... DONE
Deleted_TtiObject: ... DONE
......
=======================================

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Vincent Snijders
to Graeme Geldenhuys: Why is Lazarus ignoring my breakpoint? If I put a writeln() statement before line 1466,…
Graeme Geldenhuys wrote 7 lines
Hi, Why is Lazarus ignoring my breakpoint? If I put a writeln() statement before line 1466, it is executed and I see console output. So that code is definitely being run. Yet Lazarus think it isn't and simply ignores the breakpoint - for no reason. See attached screenshot.

The color of the breakpoint seems to indicate there is no line info for that unit. Can you attach the debug output (maybe zipped) (View -> Debug Windows -> Debug Output).

Vincent

Reply by email

Martin Friebe
to Graeme Geldenhuys: On Tue, May 5, 2009 at 1:06 PM, Graeme Geldenhuys I place the following writeln()…
Graeme Geldenhuys wrote 12 lines
On Tue, May 5, 2009 at 1:06 PM, Graeme Geldenhuys wrote: > Hi, > > Why is Lazarus ignoring my breakpoint? If I put a writeln() statement > before line 1466, it is executed and I see console output. So that > I place the following writeln() statement before line 1466 and below is some sample output, showing the writeln() is being run.

While it is not the answer to your question, I had a similar issue and found, that breakpoints only worked, if they here set *before* I started the application to debug. (This was on FreeBSD)

Maybe worth trying until the issue is fixed?

Martin

Show quoted text 42 lines
writeln('******************************************'); ==============[ console output ]==================== /home/graemeg/programming/tiOPF2/UnitTests/Text/textrunner -p --suite=TtiObjectTestCase TtiObjectTestCase: Owner: ... DONE Parent_InheritsFromVsIs: ... DONE Parent_TtiObject: ... DONE Parent_TtiObjectList: ... DONE OIDGenerator: ... DONE GetOID: ... DONE PropType: ... DONE IsReadWriteProp: ... DONE PropCount: ... DONE SetPropValue: ... DONE SetBooleanPropValue: ...****************************************** ERROR GetPropValue: ... DONE SetPropValueNested: ... DONE GetPropValueNested: ... DONE Deleted_TtiObject: ... DONE ...... ======================================= Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Graeme Geldenhuys
to Martin Friebe
Martin Friebe wrote
While it is not the answer to your question, I had a similar issue and found, that breakpoints only worked, if they here set *before* I started the application to debug. (This was on FreeBSD)

This is what I have done. Set the breakpoints, then run the application through the IDE. The IDE then outputs to the debug xterm console.

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Graeme Geldenhuys
to Vincent Snijders: The color of the breakpoint seems to indicate there is no line info for that unit. Can…
Vincent Snijders wrote
The color of the breakpoint seems to indicate there is no line info for

With my color scheme in says: "invalid breakpoint"

that unit. Can you attach the debug output (maybe zipped) (View -> Debug Windows -> Debug Output).

Umm, another new window I didn't know about. :-)

The output has been attached as an archive. The most interesting bit is probably the last few lines which looks like this. I guess that is the problem - though I have no clue how to fix it.

===================================
(gdb)

<-symbol-list-lines
/home/graemeg/programming/3rdParty/tiOPF2/Source/UnitTests/Tests/tiObject_TST.pas> &"mi_cmd_symbol_list_lines: Unknown source file name.\n"

^error,msg="mi_cmd_symbol_list_lines: Unknown source file name."

(gdb)

<-symbol-list-lines tiObject_TST.pas>
&"mi_cmd_symbol_list_lines: Unknown source file name.\n"

^error,msg="mi_cmd_symbol_list_lines: Unknown source file name."

(gdb)

===================================

And for completeness, below is when FPC compiler parameters that Lazarus IDE generates:

===================================
-MObjFPC -O1 -gl -vewnhi -l -Fi../../Core/ -Fu../Common/ -Fu../Tests/ -Fu../../Compilers/FPC/lib/i386-linux/
-Fu../../../../../../../../opt/lazarus/packager/units/i386-linux/ -Fu. -vm5024 -otextrunner -FU_Dcu

....or without relative paths....

-MObjFPC -O1 -gl -vewnhi -l
-Fi/home/graemeg/programming/3rdParty/tiOPF2/Source/Core/ -Fi/home/graemeg/programming/3rdParty/tiOPF2/Source/UnitTests/Text/ -Fu/home/graemeg/programming/3rdParty/tiOPF2/Source/UnitTests/Common/ -Fu/home/graemeg/programming/3rdParty/tiOPF2/Source/UnitTests/Tests/ -Fu/home/graemeg/programming/3rdParty/tiOPF2/Source/Compilers/FPC/lib/i386-linux/ -Fu/opt/lazarus/packager/units/i386-linux/
-Fu/home/graemeg/programming/3rdParty/tiOPF2/Source/UnitTests/Text/ -Fu. -vm5024 -FE/home/graemeg/programming/3rdParty/tiOPF2/Source/UnitTests/Text/ -otextrunner -FU_Dcu
===================================

And here is the directory layout as it is on my system. ===================================
$ tree.sh

/home/graemeg/programming/3rdParty/tiOPF2/Source
.
|-Compilers
|---FPC
|-----lib
|-------i386-linux
|-Core
|-GUI
|---LCL
|---VCL
|-Options
|-UnitTests
|---Common
|---_Data
|---GUI
|-----_Dcu
|-----Log
|---Tests <===== unit tests and unit I want to set breakpoint in |---Text <===== Program executable and source code |-----_Dcu <===== compiled units go here

===================================

Hope this helps!

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: debug_output.txt.tar.gz
Type: application/x-gzip
Size: 2418 bytes
Desc: not available
Url : http://www.lazarus.freepascal.org/pipermail/lazarus/attachments/20090505/dd70942d/attachment.gz

Reply by email

Marc Weustink
to Graeme Geldenhuys: This is what I have done. Set the breakpoints, then run the application through the IDE.…
Graeme Geldenhuys wrote 8 lines
On Tue, May 5, 2009 at 1:33 PM, Martin Friebe wrote: > While it is not the answer to your question, I had a similar issue and > found, that breakpoints only worked, if they here set *before* I started > the application to debug. (This was on FreeBSD) This is what I have done. Set the breakpoints, then run the application through the IDE. The IDE then outputs to the debug xterm console.

You cannot debug console apps with lazarus. If you use an xterm as launching to see your console output, then gdb will debug the xterm and not your app. There is some patch to have a separate console, but I haven't reseached it yet.

Marc

Reply by email

Graeme Geldenhuys
to Marc Weustink
Marc Weustink wrote
You cannot debug console apps with lazarus. If you use an xterm as launching to see your console output, then gdb will debug the xterm and not your app.

Ah, that was it!! I switched to using the LCL based GUI version of the test suite and my breakpoint was working. Thanks for spotting the problem. :-)

Regards,
- Graeme -

_______________________________________________
fpGUI - a cross-platform Free Pascal GUI toolkit
http://opensoft.homeip.net/fpgui/

Reply by email

Leonardo M. Ramé
to Graeme Geldenhuys

Don't tested but, what about adding an Sleep at the start of the console app, then attach lazarus to your console process?.

Leonardo M. Ram?
Griensu S.A. - Medical IT C?rdoba
Tel.: 0351 - 4247979

Graeme Geldenhuys escribi?:

Show quoted text 25 lines
On Tue, May 5, 2009 at 2:28 PM, Marc Weustink wrote: > You cannot debug console apps with lazarus. If you use an xterm as > launching to see your console output, then gdb will debug the xterm and > not your app. > Ah, that was it!! I switched to using the LCL based GUI version of the test suite and my breakpoint was working. Thanks for spotting the problem. :-) Regards, - Graeme - _______________________________________________ fpGUI - a cross-platform Free Pascal GUI toolkit http://opensoft.homeip.net/fpgui/ _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Vincent Snijders
to Graeme Geldenhuys: Ah, that was it!! I switched to using the LCL based GUI version of the test suite and my…
Graeme Geldenhuys wrote 8 lines
On Tue, May 5, 2009 at 2:28 PM, Marc Weustink wrote: > You cannot debug console apps with lazarus. If you use an xterm as > launching to see your console output, then gdb will debug the xterm and > not your app. Ah, that was it!! I switched to using the LCL based GUI version of the test suite and my breakpoint was working. Thanks for spotting the problem. :-)

FWIW, on windows there is no such problem, but I doubt that it incentive enough for you to reboot into windows.

Vincent

Reply by email