summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2014-11-11 18:54:57 +0000
committerdim <dim@FreeBSD.org>2014-11-11 18:54:57 +0000
commita75d2fd4af17b5b42c49afe06e1b28d268ac3e47 (patch)
tree2031f25afffef41fe4e54bdd32f9d193656a92cc /gnu
parent1929b21119d6af0991d957701f166768e0f49d0a (diff)
downloadFreeBSD-src-a75d2fd4af17b5b42c49afe06e1b28d268ac3e47.zip
FreeBSD-src-a75d2fd4af17b5b42c49afe06e1b28d268ac3e47.tar.gz
Change kbdb's kthr::cpu field into an int, to avoid gcc warnings about
comparing it with NOCPU, which became -1 recently. While here, avoid using it for address calculations if it is negative. Reviewed by: jhb, adrian MFC after: 1 week
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/gdb/kgdb/kgdb.h2
-rw-r--r--gnu/usr.bin/gdb/kgdb/trgt_i386.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/gnu/usr.bin/gdb/kgdb/kgdb.h b/gnu/usr.bin/gdb/kgdb/kgdb.h
index 1a32d8a..379861b 100644
--- a/gnu/usr.bin/gdb/kgdb/kgdb.h
+++ b/gnu/usr.bin/gdb/kgdb/kgdb.h
@@ -41,7 +41,7 @@ struct kthr {
uintptr_t pcb;
int tid;
int pid;
- u_char cpu;
+ int cpu;
};
extern struct kthr *curkthr;
diff --git a/gnu/usr.bin/gdb/kgdb/trgt_i386.c b/gnu/usr.bin/gdb/kgdb/trgt_i386.c
index 02c9918..6d206d5 100644
--- a/gnu/usr.bin/gdb/kgdb/trgt_i386.c
+++ b/gnu/usr.bin/gdb/kgdb/trgt_i386.c
@@ -139,7 +139,7 @@ kgdb_trgt_fetch_tss(void)
uintptr_t addr, cpu0prvpage, tss;
kt = kgdb_thr_lookup_tid(ptid_get_pid(inferior_ptid));
- if (kt == NULL || kt->cpu == NOCPU)
+ if (kt == NULL || kt->cpu == NOCPU || kt->cpu < 0)
return (0);
addr = kgdb_lookup("gdt");
OpenPOWER on IntegriCloud