]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Change kbdb's kthr::cpu field into an int, to avoid gcc warnings about
authordim <dim@FreeBSD.org>
Tue, 11 Nov 2014 18:54:57 +0000 (18:54 +0000)
committerdim <dim@FreeBSD.org>
Tue, 11 Nov 2014 18:54:57 +0000 (18:54 +0000)
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
gnu/usr.bin/gdb/kgdb/trgt_i386.c

index 1a32d8a125aba29f2f18edf9171efd39a393e478..379861b0cadb978c37683c8a5275620cd4937a90 100644 (file)
@@ -41,7 +41,7 @@ struct kthr {
        uintptr_t       pcb;
        int             tid;
        int             pid;
-       u_char          cpu;
+       int             cpu;
 };
 
 extern struct kthr *curkthr;
index 02c99182fcfc4c54fd2deadee8883e1eeba2a34f..6d206d5ab1a00dca77360eade10a4594d0df61b5 100644 (file)
@@ -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");