Dynamically adapt to kernbase changes on crashdumps, falling back to
KERNBASE if the "kernbase" symbol is not present on older kernels.
This commit is contained in:
parent
f85f304006
commit
fd131b1483
@ -449,7 +449,25 @@ xfer_umem (memaddr, myaddr, len, write)
|
||||
return n;
|
||||
}
|
||||
|
||||
#define KERNOFF ((unsigned)KERNBASE)
|
||||
static CORE_ADDR
|
||||
ksym_kernbase()
|
||||
{
|
||||
static CORE_ADDR kernbase;
|
||||
struct minimal_symbol *sym;
|
||||
|
||||
if (kernbase == 0)
|
||||
{
|
||||
sym = lookup_minimal_symbol ("kernbase", NULL, NULL);
|
||||
if (sym == NULL) {
|
||||
kernbase = KERNBASE;
|
||||
} else {
|
||||
kernbase = SYMBOL_VALUE_ADDRESS (sym);
|
||||
}
|
||||
}
|
||||
return kernbase;
|
||||
}
|
||||
|
||||
#define KERNOFF (ksym_kernbase())
|
||||
#define INKERNEL(x) ((x) >= KERNOFF)
|
||||
|
||||
static CORE_ADDR sbr;
|
||||
|
@ -449,7 +449,25 @@ xfer_umem (memaddr, myaddr, len, write)
|
||||
return n;
|
||||
}
|
||||
|
||||
#define KERNOFF ((unsigned)KERNBASE)
|
||||
static CORE_ADDR
|
||||
ksym_kernbase()
|
||||
{
|
||||
static CORE_ADDR kernbase;
|
||||
struct minimal_symbol *sym;
|
||||
|
||||
if (kernbase == 0)
|
||||
{
|
||||
sym = lookup_minimal_symbol ("kernbase", NULL, NULL);
|
||||
if (sym == NULL) {
|
||||
kernbase = KERNBASE;
|
||||
} else {
|
||||
kernbase = SYMBOL_VALUE_ADDRESS (sym);
|
||||
}
|
||||
}
|
||||
return kernbase;
|
||||
}
|
||||
|
||||
#define KERNOFF (ksym_kernbase())
|
||||
#define INKERNEL(x) ((x) >= KERNOFF)
|
||||
|
||||
static CORE_ADDR sbr;
|
||||
|
Loading…
Reference in New Issue
Block a user