sdb should detect vmlinux version from crash dump #286
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
= Problem
sdb does not automatically determine the vmlinux file from the crash dump
#41
= Solution
When a crash dump is supplied but the vmlinux file is not supplied on the command line, parse the crash dump to find the OS version, then scan /usr/lib/debug and /root for the vmlinux file matching that version. This follows the solution proposed by @prakashsurya. Other options require changes outside of sdb/drgn.
root@ub-20:~/sdb_detect/sdb# sdb -s /root/objs /root/dump-orig/dump.202102031354
sdb using ['/root/dumps/vmlinux-5.8.0-41-generic'] auto-detected from core file
sdb>
Tested with a core referencing a vmlinux that can be found in /root or /usr/lib/debug, and with one that is not located in /root or /usr/lib/debug. Tested existing method of specifying the actual vmlinux still works.
Closes #41