cdebugginggdbtclmsys2

How to get debuginfod for GDB MSYS2?


I have been trying to run GDP to debug a Tcl C extension using the command gdb tclsh - but the MSYS2 version of GDB says that Support for debuginfod is not compiled into GDB. and outputs Reading symbols from tclsh.exe... (No debugging symbols found in tclsh.exe) so it doesn't work. I am trying to copy the details in this GitHub comment - but I am doing it on Windows not Linux and I can't find anything on debuginfod for MSYS2 or Windows, there doesn't see to be anything on it online.

Is there any way I can get it for my version of GDB so it can work like it does in the comment I linked?

Here is the console output if you want to see it:

GNU gdb (GDB) 15.1
Copyright (C) 2024 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-w64-mingw32".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
    <http://www.gnu.org/software/gdb/documentation/>.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from tclsh.exe...
(No debugging symbols found in tclsh.exe)
[New Thread 23524.0x78e4]
[New Thread 23524.0x5a50]
[New Thread 23524.0x3394]
[New Thread 23524.0x4cd4]
[Thread 23524.0x4cd4 exited with code 0]
[Thread 23524.0x3394 exited with code 0]
[Thread 23524.0x5a50 exited with code 0]
[Thread 23524.0x78e4 exited with code 0]
[Inferior 1 (process 23524) exited normally]
(gdb) set debuginfod enabled on
Support for debuginfod is not compiled into GDB.
(gdb)

What I compiled:

Building Tkhtml 3

COMPILE = x86_64-w64-mingw32-gcc -g -DUSE_TCL_STUBS=1 -DUSE_TK_STUBS=1 -IC:/Users/billa/OneDrive/Documents/test1/htmlwidget/tkhtml/src/ -O -
TCLSH   = tclsh


$(COMPILE) -c C:/Users/billa/OneDrive/Documents/test1/htmlwidget/tkhtml//src/htmldraw.c -o htmldraw.o
x86_64-w64-mingw32-gcc -shared  htmlparse.o htmldraw.o htmltcl.o htmlimage.o htmltree.o htmltagdb.o css.o cssprop.o csssearch.o htmlstyle.o mlutil.o cssparser.o htmlPs.o "/mingw64/lib/libtclstub86.a"  "/mingw64/lib/libtkstub86.a"  -LC:/Tcl/lib -o Tkhtml30g.dll
strip Tkhtml30g.dll
echo 'package ifneeded Tkhtml 3.0 [list load [file join $dir Tkhtml30g.dll]]' > pkgIndex.tcl

Solution

  • Turns out that strip Tkhtml30g.dll was removing all the debug symbols from the shared library (as @cyan-ogilvie kindly pointed out), so I edited the Makefile to change the strip value to true and after that it seems to be working fine.