tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: UVM typedef struct



On Wed, Aug 12, 2009 at 04:50:08PM +0000, David Holland wrote:
> On Wed, Aug 12, 2009 at 11:42:07AM -0500, Eric Haszlakiewicz wrote:
>  > > > > struct proc {
>  > > > >      ...details, private to the implementation...
>  > > > > };
>  > > > 
>  > > > If anything like this is done, I'd like to kindly request that
>  > > > there be an option to expose the contents of the structure with a 
>  > > > config or compile flag.  It is very annoying to try to debug a
>  > > > program where you can't print out a structure unless you're in
>  > > > the "right" stack frame.
>  > > 
>  > > gdb is usually pretty good about this, IME. If ddb needs fixing, let's
>  > > fix it.
>  > 
>  > I *was* using gdb, but maybe it was due to it being an old version.
> 
> It's been a long while since I noticed this problem, and given my
> general coding practices I think I'd trip on it regularly. I haven't
> had any problem looking inside the opaque structs in the code I've
> been working on recently, anyhow.
> 
>  > argh, and now gdb just hangs when I try to debug anything so I can't 
>  > try it out.   something must be messed up with my machine. :(
> 
> Not necessarily. It's probably PR 40594, and note that there's a
> workaround.
ah, yes that appears to be my hanging problem.  Thanks!

I guess you're right about gdb working.  The case I ran into before where
it wasn't was where I was compiling my program with debugging turned on,
but the library that actually had the structure definition in it wasn't
compiled with -g, so I suppose gdb didn't have anywhere to get the actual
structure definition from.
Obviously, that case can't happen when debugging a kernel (unless modules
are involved).

eric


Home | Main Index | Thread Index | Old Index