Use single instance of the identical INKERNEL() and PMC_IN_KERNEL()
macros on amd64 and i386. Move the definition to machine/param.h. kgdb defines INKERNEL() too, the conflict is resolved by renaming kgdb version to PINKERNEL(). On i386, correct the lowest kernel address. After the shared page was introduced, USRSTACK no longer points to the last user address + 1 [*] Submitted by: Oliver Pinter [*] Sponsored by: The FreeBSD Foundation MFC after: 1 week
This commit is contained in:
@@ -76,7 +76,7 @@ kvm_t *kvm;
|
||||
static char kvm_err[_POSIX2_LINE_MAX];
|
||||
|
||||
#define KERNOFF (kgdb_kernbase ())
|
||||
#define INKERNEL(x) ((x) >= KERNOFF)
|
||||
#define PINKERNEL(x) ((x) >= KERNOFF)
|
||||
|
||||
static CORE_ADDR
|
||||
kgdb_kernbase (void)
|
||||
@@ -296,7 +296,7 @@ kgdb_set_proc_cmd (char *arg, int from_tty)
|
||||
|
||||
addr = (CORE_ADDR) parse_and_eval_address (arg);
|
||||
|
||||
if (!INKERNEL (addr)) {
|
||||
if (!PINKERNEL (addr)) {
|
||||
thr = kgdb_thr_lookup_pid((int)addr);
|
||||
if (thr == NULL)
|
||||
error ("invalid pid");
|
||||
@@ -319,7 +319,7 @@ kgdb_set_tid_cmd (char *arg, int from_tty)
|
||||
|
||||
addr = (CORE_ADDR) parse_and_eval_address (arg);
|
||||
|
||||
if (kvm != NULL && INKERNEL (addr)) {
|
||||
if (kvm != NULL && PINKERNEL (addr)) {
|
||||
thr = kgdb_thr_lookup_taddr(addr);
|
||||
if (thr == NULL)
|
||||
error("invalid thread address");
|
||||
|
||||
Reference in New Issue
Block a user