guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Loading debug symbols for load-foreign-library


From: Artyom Bologov
Subject: Loading debug symbols for load-foreign-library
Date: Thu, 12 Sep 2024 02:15:48 +0400

Hi y'all,

I'm working on a Guile-based tool (https://github.com/aartaka/mgamma)
reliant on (system foreign-library) FFI. So I'm doing multiple
load-foreign-library for the libraries used. But when I need to debug
the code at the intersection of Guile and these libraries in GDB, I
can't get debug symbols.

I'm on Guix, which complicates things a bit. I've followed the
instructions for GDB setup from
https://guix.gnu.org/manual/en/html_node/Separate-Debug-Info.html It
makes C programs I compile debuggable with all the symbols present. But
it doesn't propagate to Guile somewhy, even though I'm loading the same
libraries C programs are linked against.

The only thing that differs between C and Guile seems to be dlopen/dlsym
used in Guile instead of linking libraries into the binary C compiler
does. Might this be the reason? How do I fix that and get my debug
symbols, if anyhow?

See
https://github.com/aartaka/guile-gsl/blob/608200e604fe910fc7cd9e23675fe739d62990fd/modules/gsl/core.scm#L14
for an example of how I'm binding libraries on Guile side, and the
attached file for the C program that ends up with debug symbols in GDB.

Attachment: gsl.c
Description: GSL bindings executable that works with symbols

Thanks a lot,
-- 
Artyom Bologov
https://aartaka.me

reply via email to

[Prev in Thread] Current Thread [Next in Thread]