svn commit: r273266 - in head: lib/libkvm sys/compat/freebsd32 sys/kern sys/sys
Adrian Chadd
adrian at freebsd.org
Tue Nov 11 17:59:24 UTC 2014
On 10 November 2014 23:22, Dimitry Andric <dim at freebsd.org> wrote:
> It is indeed used to calculate an address offset, but as it is already
> checked against NOCPU, it should be good:
>
> gnu/usr.bin/gdb/kgdb/kthr.c: kt->cpu = td.td_oncpu;
> gnu/usr.bin/gdb/kgdb/trgt_i386.c: if (kt == NULL || kt->cpu == NOCPU)
> gnu/usr.bin/gdb/kgdb/trgt_i386.c: addr += (kt->cpu * NGDT + GPROC0_SEL) * sizeof(sd);
>
> Maybe the test could be strengthened to check that kt->cpu >= 0, but it
> might be overkill.
Ok, cool.
Yeah, please do check that; it shouldn't ever be used as an address
offset calculator if it's NOCPU.
Thanks!
-adrian
More information about the svn-src-head
mailing list