Bug 243321 - pmcannotate depends on objdump
Summary: pmcannotate depends on objdump
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bin (show other bugs)
Version: CURRENT
Hardware: Any Any
: --- Affects Only Me
Assignee: freebsd-bugs (Nobody)
Depends on:
Blocks: 229046
  Show dependency treegraph
Reported: 2020-01-13 15:05 UTC by Ed Maste
Modified: 2020-01-16 19:44 UTC (History)
1 user (show)

See Also:


Note You need to log in before you can comment on or make changes to this bug.
Description Ed Maste freebsd_committer 2020-01-13 15:05:26 UTC
As reported by Slawa Olhovchenkov on freebsd-arch, pmcannotate relies on objdump, which may be removed.

It passes the --start-address and --end-address command-line args. These are supported by llvm-objdump, so we could check for both objdump and llvm-objdump in $PATH.
Comment 1 Conrad Meyer freebsd_committer 2020-01-13 20:32:45 UTC
Looks like pmcannotate uses those flags to dump disassemblies (-d) and source (-S) of specific address ranges, and parses the text output.  Is llvm-objdump output byte-for-byte compatible here (or compatible enough)?  Would it make more sense to have pmcannotate link part of llvm instead of shelling out and parsing?
Comment 2 Ed Maste freebsd_committer 2020-01-13 20:56:09 UTC
It's not byte-for-byte identical, but I'm sure we could update any parsing/expressions in pmcannotate to handle either case with relative ease.

Linking against libllvm indeed seems like a reasonable 2nd step but I don't want to wait on that happening.
Comment 3 Ed Maste freebsd_committer 2020-01-16 19:05:37 UTC
Mark also found tools/tools/shlib-compat/shlib-compat.py using objdump
Comment 4 Conrad Meyer freebsd_committer 2020-01-16 19:43:11 UTC
tools/tools also contains, e.g., scripts that use Python, which is clearly not in base.  Is shlib-compat something that should be moved out of tools/tools?  If not, I think its dependency on objdump can safely be ignored.
Comment 5 Ed Maste freebsd_committer 2020-01-16 19:44:37 UTC
(In reply to Conrad Meyer from comment #4)
Yes for stuff in tools/ I think it's fair for the user to install both python and GNU binutils