How to get anything useful out of kgdb?

Dimitry Andric dim at FreeBSD.org
Tue May 19 22:25:57 UTC 2015


On 19 May 2015, at 21:32, NGie Cooper <yaneurabeya at gmail.com> wrote:
> 
> On Mon, May 18, 2015 at 5:29 PM, NGie Cooper <yaneurabeya at gmail.com> wrote:
> 
>> As a sidenote, this has been broken for over a decade:
>> https://svnweb.freebsd.org/base?view=revision&revision=127204 :(...
> 
> -O is synonymous with -O2 (both on clang and gcc) :(...

No, for gcc -O has always meant -O1.  For clang, it means -O2.  If you
want -O1, please specify it. :)

Though with clang I don't think you will see too much difference
regarding variables which have been put in registers, or eliminated
altogether, making it harder to follow for gdb (especially the ancient
version in base).

If you want to have everything fully traceable, use -O0, and increase
your kernel stack size, otherwise it is likely to blow up.

-Dimitry

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 194 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.freebsd.org/pipermail/freebsd-hackers/attachments/20150520/17cf55e6/attachment.sig>


More information about the freebsd-hackers mailing list