frysk.dwfl
Class DwflCache
java.lang.Object
frysk.dwfl.DwflCache
public class DwflCache
- extends Object
Cache of most-recently opened Dwfl-s. This class ensures that code
requiring dwfl always accesses the most recently opened version.
If a process changes, and the Dwfl needs to be updated, this class
will re-open the dwfl returning a new object.
Method Summary |
static void |
clear()
|
static Dwfl |
getDwfl(Task task)
return a Dwfl for a Task . |
private static File |
getRelativeSysRoot(String execPathParm,
File sysroot)
Given: a mock generated /sys/root/dir/usr/bin/program
/sys/root/dir/usr/lib/debug/usr/bin/program.debug
Elfutils can be given an absolute or relative path to look for program.debug. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
fine
private static final Log fine
modMap
private static WeakHashMap modMap
- Map from a Task to its most recent Dwfl object.
allDwfls
private static WeakHashMap allDwfls
- Cache of all Dwfl objects.
DwflCache
public DwflCache()
getRelativeSysRoot
private static File getRelativeSysRoot(String execPathParm,
File sysroot)
- Given: a mock generated /sys/root/dir/usr/bin/program
/sys/root/dir/usr/lib/debug/usr/bin/program.debug
Elfutils can be given an absolute or relative path to look for program.debug.
It will look in:
1. /sys/root/dir/usr/bin/program.debug
2. /sys/root/dir/usr/bin/a/relative/path/program.debug
3. /an/absolute/path/sys/root/dir/usr/bin/program.debug
It would be helpful if it also looked in /an/absolute/path/program.debug
so it could be given /sys/root/dir/usr/lib/debug/usr/bin. Lacking that we
need to generate a relative path that has the same effect.
- Parameters:
pathname
- of executable
- Returns:
- a path where elfutils can find program.debug for separate debuginfo.
getDwfl
public static Dwfl getDwfl(Task task)
- return a Dwfl for a
Task
.
- Parameters:
task
- the given Task
.
- Returns:
- a Dwfl created using the tasks maps.
clear
public static void clear()