Sign in Join

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

Mailing lists / fpc-pascal / 2008-12

Debugger support for FP (issues with libgdb.a)

10 messages · 3 people · –

Reply by email Subscribe to this list Your subscription

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

Andrea

Hi,

I've tried to use the debugger in FP 2.2.2 and I got this error

"No debugger support available"

The I read online and found that I need to get libgdb.a from a build of gdb and copy it in fpc. I've done that and copied to

/fpcsrc/libgdb/linux/libgdb.a

Now I get this linker error (+ many more similar)

make[3]: Entering directory `/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/ide'

/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/compiler/ppc386 -di386 -Fl/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux -Ur -Xs -O2 -n -Sg -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/rtl/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/fv/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/gdbint/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/regexpr/units/i386-linux -FE. -FUunits/i386-linux -Fl/usr/lib/gcc/i386-redhat-linux/4.3.0 -Flinclude -Flld.so.conf.d/*.conf -k"--build-id -z noexecstack" -gl -dRELEASE fp.pas

/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux/libgdb.a(exec.o): In function `generic_skip_trampoline_code':
/home/andrea/rpmbuild/BUILD/gdb-6.8/build-i386-redhat-linux-gnu/gdb/../../gdb/arch-utils.c:58: multiple definition of `generic_skip_trampoline_code'

/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux/libgdb.a(arch-utils.o):/home/andrea/rpmbuild/BUILD/gdb-6.8/build-i386-redhat-linux-gnu/gdb/../../gdb/arch-utils.c:58: first defined here

Have I done it correctly?
I was wondering if there is a documentation about that.

Andrea

Joost van der Sluis
to Andrea

Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea:

I've tried to use the debugger in FP 2.2.2 and I got this error "No debugger support available"

I see below that you used the Fedora/RHEL fpc-rpm's?

The I read online and found that I need to get libgdb.a from a build of gdb and copy it in fpc. I've done that and copied to /fpcsrc/libgdb/linux/libgdb.a

I don't know if this helps, but you do not only need libgdb.a, but also some other files. You can download them here:
ftp://ftp.freepascal.org/fpc/contrib/libgdb/v6.2.1

Further you have to make sure that there are no other copies of those files somewhere on your system so that the linker may find them.

Show quoted text 23 lines
Now I get this linker error (+ many more similar) make[3]: Entering directory `/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/ide' /home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/compiler/ppc386 -di386 -Fl/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux -Ur -Xs -O2 -n -Sg -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/rtl/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/fv/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/gdbint/units/i386-linux -Fu/home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/packages/regexpr/units/i386-linux -FE. -FUunits/i386-linux -Fl/usr/lib/gcc/i386-redhat-linux/4.3.0 -Flinclude -Flld.so.conf.d/*.conf -k"--build-id -z noexecstack" -gl -dRELEASE fp.pas /home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux/libgdb.a(exec.o): In function `generic_skip_trampoline_code': /home/andrea/rpmbuild/BUILD/gdb-6.8/build-i386-redhat-linux-gnu/gdb/../../gdb/arch-utils.c:58: multiple definition of `generic_skip_trampoline_code' /home/andrea/rpmbuild/BUILD/fpcbuild-2.2.2/fpcsrc/libgdb/linux/libgdb.a(arch-utils.o):/home/andrea/rpmbuild/BUILD/gdb-6.8/build-i386-redhat-linux-gnu/gdb/../../gdb/arch-utils.c:58: first defined here Have I done it correctly? I was wondering if there is a documentation about that.

You tried to re-build the rpm, there's no documentation about that. Maybe it's easier to build then ide manually. Extract the source, copy the libgdb-files, go to the ide directory and do a 'make clean all'

But the rpm-approach should also work.

Joost.

Andrea
to Joost van der Sluis
Joost van der Sluis wrote 7 lines
Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: > I've tried to use the debugger in FP 2.2.2 and I got this error > "No debugger support available" I see below that you used the Fedora/RHEL fpc-rpm's?

Yes.
I amended the spec to copy the lib.

Show quoted text 12 lines
> The I read online and found that I need to get libgdb.a from a build of gdb and copy it in fpc. > I've done that and copied to > > /fpcsrc/libgdb/linux/libgdb.a I don't know if this helps, but you do not only need libgdb.a, but also some other files. You can download them here: ftp://ftp.freepascal.org/fpc/contrib/libgdb/v6.2.1 Further you have to make sure that there are no other copies of those files somewhere on your system so that the linker may find them.

I could not find my version of GDB there.
I will take note of which libraries were used and replicate them. And I think you are right, I will first start with the easy compilation procedure and later extend it to rpmbuild.

Show quoted text 6 lines
You tried to re-build the rpm, there's no documentation about that. Maybe it's easier to build then ide manually. Extract the source, copy the libgdb-files, go to the ide directory and do a 'make clean all' But the rpm-approach should also work.

Thanks

Andrea
to Joost van der Sluis: Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: I see below that you…
Joost van der Sluis wrote 7 lines
Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: You tried to re-build the rpm, there's no documentation about that. Maybe it's easier to build then ide manually. Extract the source, copy the libgdb-files, go to the ide directory and do a 'make clean all' But the rpm-approach should also work.

Apparently it cannot work due to some incompatibility with gdb-6.8

http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=12636

will try again in the future.

Andrea

Joost van der Sluis
to Andrea

Op maandag 22-12-2008 om 23:17 uur [tijdzone +0000], schreef Andrea:

Show quoted text 10 lines
Joost van der Sluis wrote: > Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: > > You tried to re-build the rpm, there's no documentation about that. > Maybe it's easier to build then ide manually. Extract the source, copy > the libgdb-files, go to the ide directory and do a 'make clean all' > > But the rpm-approach should also work. Apparently it cannot work due to some incompatibility with gdb-6.8

There is a reason I said that the linker may not find the wrong libgdb.a files.

Or download the right libgdb-version from the link I gave you, place it in the right directory, remove any other libgdb.a etc. files and try again.

Thereafter it will work with your newer version of gdb.

Or did you do this and did it still not work?

Joost.

Andrea
to Joost van der Sluis
Joost van der Sluis wrote 20 lines
Op maandag 22-12-2008 om 23:17 uur [tijdzone +0000], schreef Andrea: > Joost van der Sluis wrote: >> Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: >> > Apparently it cannot work due to some incompatibility with gdb-6.8 There is a reason I said that the linker may not find the wrong libgdb.a files. > http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=12636 > > will try again in the future. Or download the right libgdb-version from the link I gave you, place it in the right directory, remove any other libgdb.a etc. files and try again. Thereafter it will work with your newer version of gdb. Or did you do this and did it still not work?

My gdb is version 6.8, on your link I can only find 6.2.1 Will that be a problem when it runs?

Jonas Maebe
to Andrea
Andrea wrote
My gdb is version 6.8, on your link I can only find 6.2.1 Will that be a problem when it runs?

No: libgdb.a basically contains a complete gdb implementation in that library, and the IDE will use that. It's not an interface to your system-installed gdb

Maybe: that older gdb (6.2.1) may not fully support your system.

Jonas

Joost van der Sluis
to Andrea: My gdb is version 6.8, on your link I can only find 6.2.1 Will that be a problem when it…

Op zondag 04-01-2009 om 15:51 uur [tijdzone +0000], schreef Andrea:

Show quoted text 24 lines
Joost van der Sluis wrote: > Op maandag 22-12-2008 om 23:17 uur [tijdzone +0000], schreef Andrea: >> Joost van der Sluis wrote: >>> Op zondag 21-12-2008 om 17:29 uur [tijdzone +0000], schreef Andrea: >>> >> Apparently it cannot work due to some incompatibility with gdb-6.8 > > There is a reason I said that the linker may not find the wrong libgdb.a > files. > >> http://bugs.freepascal.org/bug_view_advanced_page.php?bug_id=12636 >> >> will try again in the future. > > Or download the right libgdb-version from the link I gave you, place it > in the right directory, remove any other libgdb.a etc. files and try > again. > > Thereafter it will work with your newer version of gdb. > > Or did you do this and did it still not work? My gdb is version 6.8, on your link I can only find 6.2.1 Will that be a problem when it runs?

No

Joost

Andrea
to Jonas Maebe: No: libgdb.a basically contains a complete gdb implementation in that library, and the…
Jonas Maebe wrote 10 lines
On 04 Jan 2009, at 16:51, Andrea wrote: > My gdb is version 6.8, on your link I can only find 6.2.1 > Will that be a problem when it runs? No: libgdb.a basically contains a complete gdb implementation in that library, and the IDE will use that. It's not an interface to your system-installed gdb

Now I understand.

Maybe: that older gdb (6.2.1) may not fully support your system.

will try and let you know

Andrea

Andrea
to Jonas Maebe: No: libgdb.a basically contains a complete gdb implementation in that library, and the…
Jonas Maebe wrote 12 lines
On 04 Jan 2009, at 16:51, Andrea wrote: > My gdb is version 6.8, on your link I can only find 6.2.1 > Will that be a problem when it runs? No: libgdb.a basically contains a complete gdb implementation in that library, and the IDE will use that. It's not an interface to your system-installed gdb Maybe: that older gdb (6.2.1) may not fully support your system.

Ok, I have finally built fpc with gdb support as suggested by you. Now, whenever I try to use the debugger (e.g. F8) fp crashes

"Program generated a signal 11. Save your sources and restart the IDE"

and

"The IDE generated an internal error and will now be closed"

Do you have any more ideas?