Sign in Join

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

Mailing lists / lazarus / 2009-02

Debugger problems

24 messages · 13 people · –

Reply by email Subscribe to this list Your subscription

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

Alex du Plessis

Hello List

I am having trouble trying to debug any application from Lazarus. Any pointers to what could be wrong.

Lazarus is running on a Windows XP (SP2) box. The application is a newly created project. and I get the error : "Project raised exception class 'External:SIGSEGV' ". When I click on the message box Lazarus shows another window (Backtrace - I think) and dies. When I restart - the main IDE window position has been changed and is hardly visible at the bottom of the screen.

I am using

Date: 2009-02-05
FPC Version: 2.2.3
SVN Revision: 18572

Any pointers on how to get the debugger going?

Regards

Alex du Plessis

Reply by email

Bee
to Alexander Klenin
Currently a debugger in Lazarus is barely usable.

I don't know in Windows, but I use it on Linux and Mac in daily basis. Yes, it has glitches here and there, but mostly it works to me. I can't imagine writing a program without a proper debugger. ;)

-Bee-

Reply by email

Graeme Geldenhuys
to Alexander Klenin: Currently a debugger in Lazarus is barely usable. However, if you submit a bug report…
Alexander Klenin wrote
On Wed, Feb 18, 2009 at 22:03, Alex du Plessis wrote: > Any pointers on how to get the debugger going? Currently a debugger in Lazarus is barely usable.

Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly enough to make me switch back). Is there no way we can hook (tie in) the Kylix or Delphi debugger into Lazarus?

Sorry, all I can do is complain about the debugger as I don't have the skills to implement anything better. I'm an application/database/gui toolkit developer by trade.

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Bee: I don't know in Windows, but I use it on Linux and Mac in daily basis. Yes, it has…
Bee wrote
I don't know in Windows, but I use it on Linux and Mac in daily basis. Yes, it has glitches here and there, but mostly it works to me. I can't imagine writing a program without a proper debugger. ;)

What do you do different to me then. I also use Linux. Most of the times, break points don't trigger, tooltip on identifiers don't work, selected code with tooltip evaluation never works, variable watches never work etc....

Thank goodness 99% of my applications are tiOPF based, so I use the tiLog unit to log debug information to a file, console or separate log window. And for those non-tiOPF based apps, I'm stuck with:

    writeln('>> SomeProcname');
    ....code goes here
    writeln('variable = ', somevariable);
   ....code goes here
   writeln('<< SomeProcname');

PS:
Yes I know toolip evaluation or tooltip debugging over properties etc are dangerous, but it's a damn sight better than not having it. Plus the Delphi developers are perfectly happy with the way it works for them.

Regards,
- Graeme -

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

Reply by email

Marc Weustink
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
On Fri, Feb 20, 2009 at 2:06 PM, Bee wrote: > I don't know in Windows, but I use it on Linux and Mac in daily basis. > Yes, it has glitches here and there, but mostly it works to me. I can't > imagine writing a program without a proper debugger. ;) What do you do different to me then.

I wonder too what you do differently. How do you think I develop lazarus myself ?

I also use Linux. Most of the

Check

times, break points don't trigger,

Always. Sometimes more than I want.

tooltip on identifiers don't work,

Always, unless used on properties. In that case I use the Evaluation dialog to inspect the membervar.

selected code with tooltip evaluation never works,

Most cases they do work.

variable watches never work etc....

All work.

Marc

Reply by email

Alexander Klenin
to Marc Weustink
Marc Weustink wrote
I wonder too what you do differently. How do you think I develop lazarus myself ?

I agree that issues Graeme mentioned are tolerable, although inconvenient. For me, however, debugger, just crashes of freezes after 2-3 runs.

Alexander S. Klenin

Reply by email

Hans-Peter Diettrich
to Graeme Geldenhuys: Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly…
Show quoted text 5 lines
> Currently a debugger in Lazarus is barely usable. Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly enough to make me switch back). Is there no way we can hook (tie in) the Kylix or Delphi debugger into Lazarus?

Which debugger for what platform? IMO the integration of the GNU/FPC debugger is the only way to cover all cannot sort out what's FreePascal and what's Lazarus specific with debugger problems. But I wonder about random popups from the debugger at start of my applications - it looks like uninitialized variables to me, somewhere in the LCL/RTL?

DoDi

Reply by email

Hans-Peter Diettrich
to Marc Weustink: I wonder too what you do differently. How do you think I develop lazarus myself ? Check…
> tooltip on identifiers don't work, Always, unless used on properties. In that case I use the Evaluation dialog to inspect the membervar.

Sorry, Graeme is right :-(

In most cases I cannot inspect local variables, due to "no such symbol in context" errors, even with fully disabled optimizations.

Is this a platform issue? (I'm primarily using Windows)

DoDi

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich: Sorry, Graeme is right :-( In most cases I cannot inspect local variables, due to "no…
Hans-Peter Diettrich wrote
In most cases I cannot inspect local variables, due to "no such symbol in context" errors, even with fully disabled optimizations.

This is exactly the errors I get. I develop under Linux only, so it doesn't seem to be a platform issue. I gave up trying the integrated debugger and simply use Log(..) or Writeln(...) calls now.

Regards,
- Graeme -

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

Reply by email

Marc Weustink
to Graeme Geldenhuys: Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly…
Graeme Geldenhuys wrote 8 lines
On Fri, Feb 20, 2009 at 1:55 PM, Alexander Klenin wrote: > On Wed, Feb 18, 2009 at 22:03, Alex du Plessis wrote: >> Any pointers on how to get the debugger going? > Currently a debugger in Lazarus is barely usable. Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly enough to make me switch back). Is there no way we can hook (tie in) the Kylix or Delphi debugger into Lazarus?

Then you would have even less functionality. The delphi debugger uses its own debug symbol description. It doesn't understand any of the formats FPC produces.

Marc

Reply by email

Martin Friebe
to Graeme Geldenhuys: On Sat, Feb 21, 2009 at 12:49 AM, Hans-Peter Diettrich This is exactly the errors I get.…
Graeme Geldenhuys wrote 11 lines
On Sat, Feb 21, 2009 at 12:49 AM, Hans-Peter Diettrich wrote: > In most cases I cannot inspect local variables, due to "no such symbol > in context" errors, even with fully disabled optimizations. > This is exactly the errors I get. I develop under Linux only, so it doesn't seem to be a platform issue. I gave up trying the integrated debugger and simply use Log(..) or Writeln(...) calls now

It is true that there are cases where GDB does not find Symbols, until this can be fixed in a better way, here are a few cases and workarounds

1) properties

This is apparently the most common case? GDB has no concept of properties. Also properties can refer to functions. Possible workarounds:
a) if a property refers to a Variable, use CodeTools to find the variable name, and expect the Variable. Usually property abc, will point to variable Fabc
b) if the property refers to a method, there is no workaround, since currently you can not force GDB to execute any method. Executing the Method could also change the state of the debugged application.

2) Nested Procedures

GDB does only see the current stack frame.

Procedure SomeObject.ABC
var x: integer;
  Procedure Nested
  begin
  end
begin
end

While in "Nested" gdb can NOT see anything that belongs to ABC. (this is it can not see "x", and it can not see "self" (the object), or any variable on the object)

Possible Workaround:
Open the Stack Window, and change the current frame. I know this is a bit dull, because you have to change it after each execution step.

2a)
The same applies to hints in the source window. *Variables* will only show if the stackframe is correct

3)
Sometimes Variables are pointers in GDB, where they are not in Pascal.

if you type SomeObject as a watch it may just say "TSomeClass 0x23ab76" => try typing SomeObject^

4) Dynamic arrays
See the following post for a workaround (again it is too complex for every day use, but it may help for desperate occasions) http://forum.lazarus.freepascal.org/index.php/topic,4763.msg22954.html#msg22954

Reply by email

Martin Friebe
to Hans-Peter Diettrich: Sorry, Graeme is right :-( In most cases I cannot inspect local variables, due to "no…
Hans-Peter Diettrich wrote 16 lines
Marc Weustink schrieb: >> tooltip on identifiers don't work, >> > Always, unless used on properties. In that case I use the Evaluation > dialog to inspect the membervar. > Sorry, Graeme is right :-( In most cases I cannot inspect local variables, due to "no such symbol in context" errors, even with fully disabled optimizations. Is this a platform issue? (I'm primarily using Windows)

Check my other post, in case you have nested procedures, check the stackframe

Best Regards
Martin

Reply by email

Vincent Snijders
to Martin Friebe: It is true that there are cases where GDB does not find Symbols, until this can be fixed…
Martin Friebe wrote 60 lines
Graeme Geldenhuys wrote: > On Sat, Feb 21, 2009 at 12:49 AM, Hans-Peter Diettrich > wrote: > >> In most cases I cannot inspect local variables, due to "no such symbol >> in context" errors, even with fully disabled optimizations. >> > This is exactly the errors I get. I develop under Linux only, so it > doesn't seem to be a platform issue. I gave up trying the integrated > debugger and simply use Log(..) or Writeln(...) calls now > It is true that there are cases where GDB does not find Symbols, until this can be fixed in a better way, here are a few cases and workarounds 1) properties This is apparently the most common case? GDB has no concept of properties. Also properties can refer to functions. Possible workarounds: a) if a property refers to a Variable, use CodeTools to find the variable name, and expect the Variable. Usually property abc, will point to variable Fabc b) if the property refers to a method, there is no workaround, since currently you can not force GDB to execute any method. Executing the Method could also change the state of the debugged application. 2) Nested Procedures GDB does only see the current stack frame. Procedure SomeObject.ABC var x: integer; Procedure Nested begin end begin end While in "Nested" gdb can NOT see anything that belongs to ABC. (this is it can not see "x", and it can not see "self" (the object), or any variable on the object) Possible Workaround: Open the Stack Window, and change the current frame. I know this is a bit dull, because you have to change it after each execution step. 2a) The same applies to hints in the source window. *Variables* will only show if the stackframe is correct 3) Sometimes Variables are pointers in GDB, where they are not in Pascal. if you type SomeObject as a watch it may just say "TSomeClass 0x23ab76" => try typing SomeObject^ 4) Dynamic arrays See the following post for a workaround (again it is too complex for every day use, but it may help for desperate occasions) http://forum.lazarus.freepascal.org/index.php/topic,4763.msg22954.html#msg22954

I think it would be good if these valuable tips were added to the wiki.

Vincent

Reply by email

ik
to Martin Friebe: It is true that there are cases where GDB does not find Symbols, until this can be fixed…

I usually print to log/screen the output of things rather then working with a debugger.
There are rare cases where I actually find the need to use a debugger, when you learn how to work with log files.

Ido

Martin Friebe wrote 70 lines
Graeme Geldenhuys wrote: > On Sat, Feb 21, 2009 at 12:49 AM, Hans-Peter Diettrich > wrote: > >> In most cases I cannot inspect local variables, due to "no such symbol >> in context" errors, even with fully disabled optimizations. >> > > This is exactly the errors I get. I develop under Linux only, so it > doesn't seem to be a platform issue. I gave up trying the integrated > debugger and simply use Log(..) or Writeln(...) calls now > It is true that there are cases where GDB does not find Symbols, until this can be fixed in a better way, here are a few cases and workarounds 1) properties This is apparently the most common case? GDB has no concept of properties. Also properties can refer to functions. Possible workarounds: a) if a property refers to a Variable, use CodeTools to find the variable name, and expect the Variable. Usually property abc, will point to variable Fabc b) if the property refers to a method, there is no workaround, since currently you can not force GDB to execute any method. Executing the Method could also change the state of the debugged application. 2) Nested Procedures GDB does only see the current stack frame. Procedure SomeObject.ABC var x: integer; Procedure Nested begin end begin end While in "Nested" gdb can NOT see anything that belongs to ABC. (this is it can not see "x", and it can not see "self" (the object), or any variable on the object) Possible Workaround: Open the Stack Window, and change the current frame. I know this is a bit dull, because you have to change it after each execution step. 2a) The same applies to hints in the source window. *Variables* will only show if the stackframe is correct 3) Sometimes Variables are pointers in GDB, where they are not in Pascal. if you type SomeObject as a watch it may just say "TSomeClass 0x23ab76" => try typing SomeObject^ 4) Dynamic arrays See the following post for a workaround (again it is too complex for every day use, but it may help for desperate occasions) http://forum.lazarus.freepascal.org/index.php/topic,4763.msg22954.html#msg22954 _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Hans-Peter Diettrich
to ik
I usually print to log/screen the output of things rather then working with a debugger.

That's okay for command line programs.

There are rare cases where I actually find the need to use a debugger, when you learn how to work with log files.

In an event driven application a log file is of little use.

DoDi

Reply by email

Lukas Gradl
to Graeme Geldenhuys: Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly…
Show quoted text 8 lines
On Fri, Feb 20, 2009 at 1:55 PM, Alexander Klenin wrote: > On Wed, Feb 18, 2009 at 22:03, Alex du Plessis wrote: >> Any pointers on how to get the debugger going? > Currently a debugger in Lazarus is barely usable. Yeah, that is one thing I seriously miss about Delphi and Kylix (thought not nearly enough to make me switch back). Is there no way we can hook (tie in) the Kylix or Delphi debugger into Lazarus?

Wasn't there a project to build a debugger in FPC? What's the status of that project?

Like Graeme, the thing I miss most in FPC/Lazarus is the debugger I'm used to from Delphi.
At the moment I'm helping myself with Log-Files, but that's far more complicated to use to hunt down a bug in a larger project....

Regards

Lukas

-------------------------- software security networks Lukas Gradl <fpc#ssn.at> Eduard-Bodem-Gasse 9 A - 6020 Innsbruck Tel: +43-512-214040-0 Fax: +43-512-214040-21 --------------------------

Reply by email

ABorka
to Hans-Peter Diettrich: That's okay for command line programs. In an event driven application a log file is of…

Agreed.

Not to mention that it makes development about 50 times faster to have a good debugger. About a third of code typing needed with all the extra log file or console messages (finding a bug with log files is a PITA...). With a good debugger one can go backward and forward in the code while debugging, change variable values, re-run parts of code, optimize the source code after seeing the disassembly view, etc. All been done more than a decade ago in Delphi.
Without a similar debugger it is not RAD (Rapid Application Development) no matter what people say.

There should be more focus on developing a proper debugger for FPC/Lazarus, I agree.

Hans-Peter Diettrich wrote 19 lines
ik schrieb: > I usually print to log/screen the output of things rather then working > with a debugger. That's okay for command line programs. > There are rare cases where I actually find the need to use a debugger, > when you learn how to work with log files. In an event driven application a log file is of little use. DoDi _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email

Graeme Geldenhuys
to Hans-Peter Diettrich: That's okay for command line programs. In an event driven application a log file is of…
Hans-Peter Diettrich wrote 5 lines
> There are rare cases where I actually find the need to use a debugger, > when you learn how to work with log files. In an event driven application a log file is of little use.

I disagree. All my applications, except for three CGI apps, are GUI and event driven. Due to the state of debugger support in FPC/Lazarus, I have to use console output or log files. That's the only way I can reliably debug my programs. Writing unit tests as I do for our work projects, at least narrows down the location of the bug, but it cases like fpGUI Toolkit itself where there are no unit tests, it takes a bit more work and time.

But I do agree with ABorka... having a fully working debugger greatly increases development time.

Regards,
- Graeme -

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

Reply by email

Graeme Geldenhuys
to Lukas Gradl: Wasn't there a project to build a debugger in FPC? What's the status of that project?…
Lukas Gradl wrote
Wasn't there a project to build a debugger in FPC? What's the status of that project?

I remember seeing something like that a while back, but I think it only worked under Win32 platform.

A quick look in the Lazarus directory I also see "<laz>/debugger/fpd/" which seems to be the start of a Object Pascal based debugger.

Regards,
- Graeme -

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

Reply by email

Paul van Helden
to Vincent Snijders

Hi All,

The debugger was working fine for me with the limitations noted in this thread..... until two days ago. Now, like Alex, I get External SIGSEGV. This happens on a new application. File->New->Application->Run (with gdb debugger). I've rebuilt, installed yesterday's snapshot, cleared PATH and tried --primary-config-path= something else. Nothing seems to solve the problem. I'm forced to do my debugging on another computer!

The problem appeared soon after I installed and rebuilt FPC from SVN to a directory outside c:\lazarus, but that has all been renamed to make it disappear and there is no PATH..

Any ideas on how to get the debugger working again?

Thanks,

Paul.

Reply by email

Paul van Helden
to Paul van Helden

External:SIGSEGV on calling OleInitialize on line 111 of win32object.inc

Paul van Helden wrote 24 lines
Hi All, The debugger was working fine for me with the limitations noted in this thread..... until two days ago. Now, like Alex, I get External SIGSEGV. This happens on a new application. File->New->Application->Run (with gdb debugger). I've rebuilt, installed yesterday's snapshot, cleared PATH and tried --primary-config-path= something else. Nothing seems to solve the problem. I'm forced to do my debugging on another computer! The problem appeared soon after I installed and rebuilt FPC from SVN to a directory outside c:\lazarus, but that has all been renamed to make it disappear and there is no PATH.. Any ideas on how to get the debugger working again? Thanks, Paul. _______________________________________________ Lazarus mailing list http://www.lazarus.freepascal.org/mailman/listinfo/lazarus

Reply by email