summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSerhei Makarov <serhei@serhei.io>2023-01-10 11:20:13 -0500
committerSerhei Makarov <serhei@serhei.io>2023-01-13 15:49:13 -0500
commita724bae8320c64d7af6d1acfc09327445180715e (patch)
tree40c08c6e350513558d2583683c8c5563e685b7e3
parentdcb40f9caa7ca30f6cae0f237c627bb5e4e4931c (diff)
downloadelfutils-a724bae8320c64d7af6d1acfc09327445180715e.tar.gz
debuginfod-find.1: note on how to find a comp_dir
doc/ChangeLog: * debuginfod-find.1: add a note to DESCRIPTION section for the 'source' subcommand, clarifying where to find the CU compilation-directory. I'm looking at how to improve and document the workflow for using debuginfod-find to study the behaviour of packaged software on a system, e.g. in conjunction with a tracing tool like SystemTap. You can read the exact compiled source code with debuginfod-find source and use that to figure out which source code locations are interesting to trace. But that process has several non-obvious or inconvenient steps. This patch is a clarification to the debuginfod-find source man page pointing out the eu-readelf command that can show the comp_dir in downloaded debuginfo. Since debuginfod-find source could be picked up and used by a developer unfamiliar with DWARF terminology, I think such a clarification saves time for newbies figuring out what a CU compilation-directory is. Signed-off-by: Serhei Makarov <serhei@serhei.io>
-rw-r--r--doc/debuginfod-find.113
1 files changed, 13 insertions, 0 deletions
diff --git a/doc/debuginfod-find.1 b/doc/debuginfod-find.1
index 957ec7e7..7d577bab 100644
--- a/doc/debuginfod-find.1
+++ b/doc/debuginfod-find.1
@@ -92,6 +92,19 @@ is made up of multiple CUs. Therefore, to disambiguate, debuginfod
expects source queries to prefix relative path names with the CU
compilation-directory, followed by a mandatory "/".
+Note: for software packaged by distributions, the CU
+compilation-directory may not be obvious. It can be found by
+inspecting AT_comp_dir values in downloaded debuginfo. For example,
+the comp_dir of the Fedora 37 version of /bin/ls can be found as
+follows:
+
+.SAMPLE
+% debuginfod-find debuginfo /bin/ls
+~/.cache/debuginfod_client/03529d48345409576cd5c82a56ad08555088d353/
+% eu-readelf -w ~/.cache/debuginfod_client/03529d48345409576cd5c82a56ad08555088d353/debuginfo | grep comp_dir
+ comp_dir (line_strp) "/usr/src/debug/coreutils-9.1-6.fc37.x86_64/separate"
+.ESAMPLE
+
Note: the caller may or may not elide \fB../\fP or \fB/./\fP or extraneous
\fB///\fP sorts of path components in the directory names. debuginfod
accepts both forms. Specifically, debuginfod canonicalizes path names