diff options
| author | Peter Wemm <peter@FreeBSD.org> | 2001-08-24 09:12:04 +0000 |
|---|---|---|
| committer | Peter Wemm <peter@FreeBSD.org> | 2001-08-24 09:12:04 +0000 |
| commit | fd131b14832587008e57d3b25487ddcaa9ebdab3 (patch) | |
| tree | 9057b6932374c9ce1ab363d9edaef363e1f62da1 /gnu | |
| parent | f85f3040062dffca6dfcb0c3c2ac64d99cc19db3 (diff) | |
Notes
Diffstat (limited to 'gnu')
| -rw-r--r-- | gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c | 20 | ||||
| -rw-r--r-- | gnu/usr.bin/binutils/gdb/kvm-fbsd.c | 20 |
2 files changed, 38 insertions, 2 deletions
diff --git a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c index 9513af304c03..fdfc6a381a36 100644 --- a/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c +++ b/gnu/usr.bin/binutils/gdb/i386/kvm-fbsd.c @@ -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; diff --git a/gnu/usr.bin/binutils/gdb/kvm-fbsd.c b/gnu/usr.bin/binutils/gdb/kvm-fbsd.c index 9513af304c03..fdfc6a381a36 100644 --- a/gnu/usr.bin/binutils/gdb/kvm-fbsd.c +++ b/gnu/usr.bin/binutils/gdb/kvm-fbsd.c @@ -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; |
