Forum > FV/Textmode IDE

No debugger support available

(1/4) > >>

Moody:
Hi folks,

i try to compile fp from source to get debugger support into the textmode ide.
Everything works fine if i add "NOGDB=1" to the build instruction but of course, then the debugger support is missing. When compiling with GDBLIBDIR=/usr/lib set, libgdb.a is recognized but at the end i get a lot of linking errors. It looks like the libgdb.a referes to modules which are not linked.
There were a lot of references to functions of Python so I recompiled gdb without Python support (./configure ... --with-python=no). The references to Python functions are gone.
But there is still stuff missing:

----
...
/usr/lib/libgdb.a(tui-file.o): In Funktion »tui_file::~tui_file()«:
(.text._ZN8tui_fileD0Ev[_ZN8tui_fileD5Ev]+0x1a): Warnung: undefinierter Verweis auf »operator delete(void*, unsigned long)«
/usr/lib/libgdb.a(tui-file.o): Warnung: undefinierter Verweis auf »vtable for __cxxabiv1::__si_class_type_info«
/usr/lib/libgdb.a(cp-name-parser.o): In Funktion »cp_demangled_name_to_comp(char const*, char const**)«:
(.text+0x448f): Warnung: undefinierter Verweis auf »operator delete(void*, unsigned long)«
 Warnung: undefinierter Verweis auf »operator delete(void*, unsigned long)«
 Warnung: undefinierter Verweis auf »_Unwind_Resume«
/usr/lib/libgdb.a(cp-name-parser.o): Warnung: undefinierter Verweis auf »__gxx_personality_v0«
/usr/lib/libgdb.a(f-exp.o): In Funktion »f_parse(parser_state*)«:
(.text+0x1f76): Warnung: undefinierter Verweis auf »_Unwind_Resume«
/usr/lib/libgdb.a(f-exp.o): Warnung: undefinierter Verweis auf »__gxx_personality_v0«
/usr/lib/libbfd.a(compress.o): In Funktion »decompress_contents«:
(.text+0x4c): Warnung: undefinierter Verweis auf »inflateInit_«
 Warnung: undefinierter Verweis auf »inflateReset«
 Warnung: undefinierter Verweis auf »inflate«
 Warnung: undefinierter Verweis auf »inflateEnd«
/usr/lib/libbfd.a(compress.o): In Funktion »bfd_compress_section_contents«:
(.text+0x6ac): Warnung: undefinierter Verweis auf »compressBound«
 Warnung: undefinierter Verweis auf »compress«
fp.pas(581,1) Error: Error while linking
fp.pas(581,1) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted

make[3]: *** [Makefile:2224: all] Fehler 1
make[3]: Verzeichnis „/tmp/fpc/build/fpcbuild-3.0.4/fpcsrc/ide“ wird verlassen
make[2]: *** [Makefile:2657: ide_all] Fehler 2
make[2]: Verzeichnis „/tmp/fpc/build/fpcbuild-3.0.4/fpcsrc“ wird verlassen
make[1]: *** [Makefile:2821: build-stamp.x86_64-linux] Fehler 2
make[1]: Verzeichnis „/tmp/fpc/build/fpcbuild-3.0.4/fpcsrc“ wird verlassen
make: *** [Makefile:2187: fpcsrc/build-stamp.x86_64-linux] Fehler 2
----

So, my question is:
What are the requirements on how gdb has to be installed or where can i add libraries in the FP build system so they get linked into? I'm not that familar with FP's build system. "inflateReset" seems to be defined in zlib, so i might need to link it somehow into FP.

Any ideas on how to touch base on this?

Thanks!

Btw, its on a Linux From Scratch, gdb-8.1, fpc-3.0.4

Cyrax:
Hmm, the textmode IDE should use GDB MI interface automatically. So there should be no need for building GDB library.

What kind of commands and options are you feeding to make utility?

Thaddy:
Indeed, NOGDB=1 is wrong. IF gdb is installed, there should be no need for old style debugger support (libgdb) since fpc3.0.4 uses gdb/mi as default, which calls the external gdb.

What does "whereis gdb" say? It should say something like this:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---~ $ whereis gdbgdb: /usr/bin/gdb /etc/gdb /usr/include/gdb /usr/share/gdbIf it says something like that: leave out the NOGDB=1. If it does not, you have a wrong gdb install or a very old linux installed.
In the last case try also:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---~ $ gdb --versionGNU gdb (Raspbian 7.12-6) 7.12.0.20161007-gitIf the version is below 7.12 you know you have an old linux but it should work provided:
If it is even below 7.0.0  gdb/mi will not work at all. In that case simply install libgdb and libgdb-dev and it will still work with "GDBMI=0".
Note that is not recommended: all the latest major stable Linux distributions including all LTE ones support gdb 7+ for the past two years.

Moody:
gdb is here:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---lfs@lfs-x86_64-1:~$ whereis gdbgdb: /usr/bin/gdb /usr/include/gdb /usr/share/gdb /usr/share/man/man1/gdb.1 /usr/share/info/gdb.info-2 /usr/share/info/gdb.info-1 /usr/share/info/gdb.info-4 /usr/share/info/gdb.info-6 /usr/share/info/gdb.info-7 /usr/share/info/gdb.info /usr/share/info/gdb.info-3 /usr/share/info/gdb.info-5 
version is:

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---lfs@lfs-x86_64-1:~$ gdb --versionGNU gdb (GDB) 8.1...This GDB was configured as "x86_64-pc-linux-gnu"....
Its all pretty new, linux-4.15.3, gcc-7.3.0, glibc-2.27, etc.
The commands i use to rebuild fp is

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---pushd fpcsrc/compilerfpcmake -Tallpopdexport GDBLIBDIR=/usr/libmake buildmake install -j1
When leaving the GDBLIBDIR var unset, fpc builds fine but without debugging support. Doing so, the build log contains

--- Code: ---...
Makefile:2425: Using system default libgdb file located in /usr/lib/libgdb.a
...
[ 47%] Compiled package fv
Start compiling package gdbint for target x86_64-linux.
File libgdb.a not found
       Compiling gdbint/src/gdbint.pp
       Compiling gdbint/src/gdbcon.pp
[ 47%] Compiled package gdbint
...
Installation package fv for target x86_64-linux succeeded
Start compiling package gdbint for target x86_64-linux.
File libgdb.a not found
Compiled package gdbint
Installing package gdbint
Installation package gdbint for target x86_64-linux succeeded
...

--- End code ---
Complete log is at https://pastebin.com/54vReYnk

What does "uses gdb/mi by default" mean? Is that /mi something in addition to gdb or is it a module within fp?

Thaddy:
The export is not necessary.
gdb is installed correctly, simply do:
delete /etc/fpc.cfg (optional), then in the fpc source root directory :

--- Code: Bash  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---make clean all installand everything should be ok.
gdb/mi means it uses the - somewhat newer - scripting feature that uses the API from the gdb executable directly instead of linking to the libgdb.
That has several advantages.  See: https://sourceware.org/gdb/onlinedocs/gdb/GDB_002fMI.html or google gdb/mi. You will find that for other languages the IDE's are moving to it too.

And don't use fpcmake! Use make

Navigation

[0] Message Index

[#] Next page

Go to full version