Subject: Re: gdb over ktrace
To: None <tech-kern@netbsd.org>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: tech-kern
Date: 04/16/2000 14:22:36
>> <LANGUAGE-LAWYER>Nil pointer != address zero.</LANGUAGE-LAWYER>
> Sure it doesn't need to be the same. But it's good for catching
> problems to have pointers from a struct set to NULL when you bzero
> the struct.
It would be better to have them set to a non-nil-pointer but still
invalid value. That way you can *catch* bugs like using bzero on
pointers. (Yes, it's a bug; what you get when you bzero a pointer is
undefined, and depending on it to be anything at all is therefore a
bug, arguably except in specced-as-machine-dependent code.)
Just as nil-pointer != address-zero, nil-pointer also != all-bits-0.
der Mouse
mouse@rodents.montreal.qc.ca
7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B