Sign in Join

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

Mailing lists / lazarus / 2015-02

Failing to run GDB via IDE on OpenSUSE 13.2 system

8 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Graeme Geldenhuys

Hi,

Last week I setup a new VM with OpenSUSE 13.2 64-bit. I also installed GDB (v7.8) from the standard package repository.

I manually installed FPC 2.6.4 (tar.gz release archive) and Lazarus trunk. I can compile and run programs without problem. I also configured GDB in the IDE and made sure my program compiles with debug info enabled. But trying to debug an application via Lazarus IDE gives me an instant "Internal Error" and GDB stops. Below is the IDE debugger window output:

==================================================== ...snip...
(gdb)
<set inferior-tty /dev/pts/1>
&"set inferior-tty /dev/pts/1\n"
=cmd-param-changed,param="inferior-tty",value="/dev/pts/1" ^done
(gdb)
<-gdb-set language pascal>
^done
(gdb)
<ptype TObject>
&"ptype TObject\n"
&"../../gdb/minsyms.c:410: internal-error: Section index is uninitialized\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable."
====================================================

I have however installed DDD, and can debug that exact same executable without problems in DDD. So any ideas why Lazarus IDE can't debug?

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Martin Frb
to Graeme Geldenhuys
Graeme Geldenhuys wrote 10 lines
Hi, Last week I setup a new VM with OpenSUSE 13.2 64-bit. I also installed GDB (v7.8) from the standard package repository. I manually installed FPC 2.6.4 (tar.gz release archive) and Lazarus trunk. I can compile and run programs without problem. I also configured GDB in the IDE and made sure my program compiles with debug info enabled. But trying to debug an application via Lazarus IDE gives me an instant "Internal Error" and GDB stops.

With an "oops the debugger ..." message?

Below is the IDE debugger window output:

...

Show quoted text 6 lines
&"../../gdb/minsyms.c:410: internal-error: Section index is uninitialized\nA problem internal to GDB has been detected,\nfurther debugging may prove unreliable." ====================================================

This means gdb crashed.

I noted in my tests that gdb 7.8.0 and gdb 7.8.1 crash way easier than the 7.7 versions. I recommend to downgrade gdb.

Since you use Lazarus trunk, you can also install the package components\lazdebuggers\lazdebuggerfp\lazdebuggerfp.lpk and try to change (in tools / options / debugger) to "fpdebug" (the one that does NOT say "with gdb") which is gdb free. However this is beta, so not yet perfect.

As for it work in ddd. (which use gdb too does it?)

That is possible. Those crashes often happen on specific commands, or when trying to inspect specific data (or a none existing identifier, which may lead to gdb searching through (and touching) all symbols, including those that lead to a crash).
Lazarus issues a lot more (or at least different) commands and queries more info than ddd, because it attempts to make pascal expression, readable to gdb. It also works around other issues of gdb such as explicitly dereferencing the hidden pointers in (dyn) arrays or objects if gdb needs this.
It also sends more initialization, attempting to figure what is possible in your version of gdb, and what not.

As for the particular crash: This is the first time I see it crash at "ptype TObject"
Does your code use any objects/classes at all? If not maybe just add one for debugging?

Reply by email

Graeme Geldenhuys
to Martin Frb
Martin Frb wrote
I noted in my tests that gdb 7.8.0 and gdb 7.8.1 crash way easier than the 7.7 versions. I recommend to downgrade gdb.

I'm new to OpenSUSE, but will google on how to do it. The default packages manager only has 7.8 available, no older versions. But maybe a new package repo needs to be added.

Since you use Lazarus trunk, you can also install the package components\lazdebuggers\lazdebuggerfp\lazdebuggerfp.lpk

Thanks, I'll give that a go either way.

As for the particular crash: This is the first time I see it crash at "ptype TObject" Does your code use any objects/classes at all? If not maybe just add one for debugging?

Yes, it is a large LCL based project.

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Martin Frb
to Graeme Geldenhuys
Graeme Geldenhuys wrote 7 lines
> As for the particular crash: This is the first time I see it crash at > "ptype TObject" > Does your code use any objects/classes at all? If not maybe just add one > for debugging? Yes, it is a large LCL based project.

It might be that gdb does not like the ptype before the run command anymore. Though gdb 7.8 on windows gets through this, so I guess something else is wrong here.

Reply by email

Graeme Geldenhuys
to Martin Schreiber
Martin Schreiber wrote

At least we are moving in the right direction with fpdebug. I managed to follow Martin Frb. instructions on installing 'fpdebug' without any issues. It allowed me to debug under OpenSUSE 13.2 without issue so far (seeing that I don't have a older GDB available yet). I know he said it is in beta, but from what I have seen it is a fantastic start and progress moving away from GDB.

Awesome work Martin Frb!

Regards,
- Graeme -

fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal http://fpgui.sourceforge.net/

Reply by email

Martin Frb
to Martin Schreiber: See also http://bugs.freepascal.org/view.php?id=27188 Martin
Martin Schreiber wrote 9 lines
On Monday 09 February 2015 18:28:59 Graeme Geldenhuys wrote: > Hi, > > Last week I setup a new VM with OpenSUSE 13.2 64-bit. I also installed > GDB (v7.8) from the standard package repository. > See also http://bugs.freepascal.org/view.php?id=27188

Its a bug in gdb https://sourceware.org/bugzilla/show_bug.cgi?id=17835

Note that there are other regressions in gdb.

gdb 7.8 has a higher tenancy to crash.

gdb 7.6.1, 7.7 and 7.8 mix up class and record in answer to ptype https://sourceware.org/bugzilla/show_bug.cgi?id=16016

Reply by email

Martin Frb
to Graeme Geldenhuys: At least we are moving in the right direction with fpdebug. I managed to follow Martin…
Graeme Geldenhuys wrote 12 lines
On 2015-02-10 06:44, Martin Schreiber wrote: > See also > http://bugs.freepascal.org/view.php?id=27188 At least we are moving in the right direction with fpdebug. I managed to follow Martin Frb. instructions on installing 'fpdebug' without any issues. It allowed me to debug under OpenSUSE 13.2 without issue so far (seeing that I don't have a older GDB available yet). I know he said it is in beta, but from what I have seen it is a fantastic start and progress moving away from GDB. Awesome work Martin Frb!

Joost did a major part of it too.
And Marc created the base long ago.

Reply by email