On 10 November 2014 23:22, Dimitry Andric <d...@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
_______________________________________________
svn-src-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-all
To unsubscribe, send any mail to "svn-src-all-unsubscr...@freebsd.org"

Reply via email to