From 7a3659bcace0c9568e3b414fffc639fb9d8d15d8 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Tue, 11 Nov 2014 18:54:57 +0000 Subject: [PATCH] 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 --- gnu/usr.bin/gdb/kgdb/kgdb.h | 2 +- gnu/usr.bin/gdb/kgdb/trgt_i386.c | 2 +- 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 1a32d8a125ab..379861b0cadb 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 02c99182fcfc..6d206d5ab1a0 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");