Sign in Join

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

Mailing lists / lazarus / 2017-08

Debugger constantly crashing.

5 messages · 3 people ·

Reply by email Subscribe to this list Your subscription

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

Donald Ziesig

Hi All,

I have been having trouble debugging some simple programs using Lazarus 1.9 with FPC 3.0.2 on Linux Mint 18.

When I move my mouse over certain variables the debugger crashes with error messages similar to:

The GDB command:
"-data-evaluate-expression CQ2WORLDDM.CQWORLDDATA^" did not return any result.

The only thing that seems to be consistent with all of the crashes is that the expression being evaluated is dereferencing a pointer. (I might be wrong about this; I just don't recall any other cases).

This is really frustrating. At the point where I think I am getting close to finding the bug, the debugger crashes :'(. Its especially frustrating when I happen to move the cursor over something that I am not interested in and crash!

Has anyone else seen this and come up with a solution, or should I create a bug report?

Thanks,

Don Ziesig

Reply by email

Martin Frb
to Donald Ziesig
Donald Ziesig wrote 11 lines
The GDB command: "-data-evaluate-expression CQ2WORLDDM.CQWORLDDATA^" did not return any result. The only thing that seems to be consistent with all of the crashes is that the expression being evaluated is dereferencing a pointer.  (I might be wrong about this; I just don't recall any other cases). Has anyone else seen this and come up with a solution, or should I create a bug report?

This is a bug in gdb, so we can not fix it on our end.

But a couple of notes that may help.

1) You can turn of the debug hint somewhere in the options (codetools) IIRC

2) Try compiling with dwarf or stabs (project options / debugging). I think the default is stabs, so you should try dwarf.

BUT: You need to apply that to all packages too (each package has an option). Easiest way to do this is "Additions and Overrides"

3) Try a different version of GDB.
I have not tested this on Linux, but on win only. But it may be similar on Linux.
My observation is that gdb at version 7.7 and above crashes more often (and especially with stabs).

Reply by email

Donald Ziesig
to Martin Frb
Martin Frb wrote 33 lines
On 27/08/2017 20:51, Donald Ziesig via Lazarus wrote: > > The GDB command: > "-data-evaluate-expression CQ2WORLDDM.CQWORLDDATA^" > did not return any result. > > The only thing that seems to be consistent with all of the crashes is > that the expression being evaluated is dereferencing a pointer. (I > might be wrong about this; I just don't recall any other cases). > > Has anyone else seen this and come up with a solution, or should I > create a bug report? This is a bug in gdb, so we can not fix it on our end. But a couple of notes that may help. 1) You can turn of the debug hint somewhere in the options (codetools) IIRC 2) Try compiling with dwarf or stabs (project options / debugging). I think the default is stabs, so you should try dwarf. BUT: You need to apply that to all packages too (each package has an option). Easiest way to do this is "Additions and Overrides" 3) Try a different version of GDB. I have not tested this on Linux, but on win only. But it may be similar on Linux. My observation is that gdb at version 7.7 and above crashes more often (and especially with stabs).

Thanks Martin. I'll try these suggestions and let you (and the list) know how they work.

Don

Reply by email

Martin Frb
to Donald Ziesig
Donald Ziesig wrote 9 lines
On 08/27/2017 04:43 PM, Martin Frb via Lazarus wrote: > > 2) Try compiling with dwarf or stabs (project options / debugging). I > think the default is stabs, so you should try dwarf. > > > Thanks Martin.  I'll try these suggestions and let you (and the list) know how they work.

Btw that is dwarf 2  (dwarf 3 is likely going to make it worse) Dwarf 2 + sets, is the recommended one.

There is a wiki http://wiki.lazarus.freepascal.org/GDB_Debugger_Tips

You can run the testcase (components/gdbmidebugger/test) That includes some tests, that will crash some versions of gdb. (but be fine on others).
(You may or may not have to create the config files (see in folder) to run the test / and there is no real benefit in running it, other than if you want to analyse thinks in more detail....)

Reply by email