Open Peter0x44 opened 1 year ago
GNU Make also has some sort of support for Guile scripts embedded. If it is figured out, I suppose that feature should be enabled too: https://www.gnu.org/software/make/manual/html_node/Guile-Integration.html
(though, I have never seen a single Makefile using this feature)
Interesting idea. I'd just sort of mentally dismissed Guile, but it does appear to be a more viable option than CPython. GDB's built-in scripting language is badly neglected, so it would be nice to fill that gap. I spent some time investigating what it would take:
Guile has one of the worst autoconf scripts I've come across. It's very, very slow — a lot of friction when debugging builds. It checks things that it's been asked not to check (e.g. networking), so it cannot be sped up. Dependency checks are unreliable: It found libunicode just fine, but I had to use LIBFFI_LIBS and LIBFFI_CFLAGS for libffi installed to exactly the same location.
Lots of new mandatory dependencies: libunistring, libffi, bdwgc, libatomic_ops, libxcrypt. Maybe more, that's just where I stopped.
Were it Lua instead — a joy and a breeze both to build and embed! — I'd definitely go for it, but Guile seems like a lot more trouble than it's worth. Who knew a Scheme implementation could be so complex and finicky?
I also went ahead and investigated whether it would enable standard C++ container pretty-printers, apparently not. Trying a gdb configured with --without-python could not pretty-print an std::string, despite having Guile. Those all need python, so it wouldn't even solve that. The API mentioned is just if you want to write pretty-printers for your own data structures. I concur it doesn't seem worth the hassle, plus adding those numerous dependencies.
This idea seems like a dead end, but maybe it can change in future.
Who knew a Scheme implementation could be so complex and finicky?
I agree, it's impressive how so much complexity can be crammed into a language seemingly made for embedding and extensions.
Those all need python, so it wouldn't even solve that.
Ah, I suspected that might be the case. Honestly, it would be the main reason to link an extension language. Thanks for the followup.
Currently, the GDB provided doesn't have support for either of the scripting languages GDB supports (Python and Guile)
Python isn't currently supported, because CPython isn't supporting cross-compilation with a windows target, but it seems Guile does. At least, here is one repository claiming to do just that:
https://github.com/Madsy/guile-automatic-build
https://sourceware.org/gdb/current/onlinedocs/gdb.html/Writing-a-Guile-Pretty_002dPrinter.html Here, it's also documented that you can write gdb pretty-printers using Guile. This could potentially be a solution for #16, though I'm not certain about this.
I think it's worth some investigation either way, I figured I'd open this issue in case anyone else has already discovered some info regarding why this may or may not be possible.