aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2025-04-14 18:53:36 -0400
committerBruce Hill <bruce@bruce-hill.com>2025-04-14 18:53:36 -0400
commitc1ae3ad9f42d510650f972671fcb0df0c3aa8388 (patch)
tree17fcf2d7c4baa0b612e2c07059e9e263fcf665ab
parent2a080063a6d62d4f26b1fc9f1ec671bd184c3eac (diff)
Remap source information in debugging info
-rw-r--r--src/tomo.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/tomo.c b/src/tomo.c
index 523e0b9d..61f2ed3d 100644
--- a/src/tomo.c
+++ b/src/tomo.c
@@ -500,6 +500,12 @@ void build_library(Text_t lib_dir_name)
system("mkdir -p ~/.local/share/tomo/lib/");
system(String("ln -f -s ../installed/'", lib_dir_name, "'/lib'", lib_dir_name, SHARED_SUFFIX,
"' ~/.local/share/tomo/lib/lib'", lib_dir_name, SHARED_SUFFIX, "'"));
+ // If we have `debugedit` on this system, use it to remap the debugging source information
+ // to point to the installed version of the source file. Otherwise, fail silently.
+ system(String("debugedit -b ", library_directory,
+ " -d ~/.local/share/tomo/installed/", lib_dir_name,
+ " ~/.local/share/tomo/installed/", lib_dir_name, "/lib", lib_dir_name, ".so"
+ " 2>/dev/null >/dev/null"));
print("Installed \033[1m", lib_dir_name, "\033[m to ~/.local/share/tomo/installed");
}
}