[all-commits] [llvm/llvm-project] d63eca: [llvm-objdump] Add --substitute-path and --source-...
VladimirMedic via All-commits
all-commits at lists.llvm.org
Wed Jun 24 09:00:47 PDT 2026
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: d63ecaa12cc1fa204b54e7c3b1520d004041e9b8
https://github.com/llvm/llvm-project/commit/d63ecaa12cc1fa204b54e7c3b1520d004041e9b8
Author: VladimirMedic <Vladimir.Medic at amd.com>
Date: 2026-06-24 (Wed, 24 Jun 2026)
Changed paths:
M llvm/docs/CommandGuide/llvm-objdump.rst
A llvm/test/tools/llvm-objdump/X86/source-path.test
M llvm/tools/llvm-objdump/ObjdumpOpts.td
M llvm/tools/llvm-objdump/SourcePrinter.cpp
M llvm/tools/llvm-objdump/llvm-objdump.cpp
M llvm/tools/llvm-objdump/llvm-objdump.h
Log Message:
-----------
[llvm-objdump] Add --substitute-path and --source-dir for --source (#201096)
When the code object was compiled on a different machine that does not
have the same directory structure, or the source code has been moved, we
are seeing a warning with the disassembler, stating that the files
embedded in the code object were not found on disk.
This patch introduces a command line options for llvm-objdump, which
provide alternate directory locations to locate the source files on
disk. These options are inspired by GDB commands _set directory_ and
_set substitute-path_.
--substitute-path — Takes two strings, _from_ and _to_, and do a simple
string replacement of from with to at the start of the directory part of
the source file name, then use that result instead of the original file
name to look up the sources. A rule applies only if _from_ ends at a
directory separator.
--source-dir — Add directories to the source search path. Directories
are searched in following order: original recorded path, source-dir +
relative recorded path or absolute path without root, source-dir +
basename.
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list