newfs_msdos and DVD-RAM

Ryan Stone rysto32 at gmail.com
Tue Mar 30 03:29:44 UTC 2010


>
> BTW, why can't gdb find any variables?  They are just stack variables whose
> address is easy to find.
>
>  ...
>>>
>>> #14 0xffffffff8042f24e in bread (vp=Variable "vp" is not available.
>>> ) at /usr/src/sys/kern/vfs_bio.c:748
>>>
>>
> ... and isn't vp a variable?  Maybe the bad default -O2 is destroying
> debugging.  Kernels intended for being debugged (and that is almost all
> kernels) shouldn't be compiled with many optimizations.  Post-gcc-3, -O2
> breaks even backtraces by inlining static functions that are called only
> once.
>
>
On amd64 those parameters aren't stack variables.  They're passed in
registers, and gdb is horrible at figuring things out from there.  I'm not
sure if the problem actually exists in gdb or if the debug info provided by
gcc is incomplete.  Sometimes gdb is unable to print the value of the
parameter because the register has been reused and the argument's value has
been lost.


More information about the freebsd-current mailing list