On Mon, Jun 15, 2009 at 02:35:10PM -0700, Steve Gonczi wrote:
> > My experience with the gdb protocol has been very
> > negative; it's
> > very poorly designed, and prone to breakage. 
> 
> And, with a little luck, nobody from the GNU camp is reading this list  :-)

I think my experience is all well-known; the lack of versioning or even
verifying that the architectures both sides are using match, etc.  It's
just the way the protocol grew.

> > While some kind of kmdb(1)-over-ethernet might be
> > very cool...
> 
> Yes.. given that trying to get a KMDB session to work through LOM is such
> a pain and many new x86 hardware platforms do not have a serial port, 
> that would be wonderful.
> 
> > straightforward (if
> > slightly time consuming) to backtrack from the
> > assembly.  
> 
> I have one significant pain point with mdb, perhaps it is just my ignorance:
> 
> I find it difficult to reconstruct stack frames, ie. local variables
> on 64 bit amd.  A bit off topic, but is there an easy way to obtain at
> least the rbp values for the prior stack frames?

Yeah, for any given line of ::findstack -v or $C, you have:

> ffffff014bdab900::findstack -v
stack pointer for thread ffffff014bdab900: ffffff00041dbcc0
[ ffffff00041dbcc0 _resume_from_idle+0xf1() ]
  ^^^^^^^^^^^^^^^^ %rsp ^^^ PC
  ffffff00041dbcf0 swtch+0x147()
  ^ rbp            ^ PC                 (frame 1)
  ffffff00041dbd50 cv_wait_sig_swap_core+0x170(ffffff014bdabade, 
ffffff014bdabae0, 0)
  ^ rbp            ^ PC                 (frame 2)
  ffffff00041dbd70 cv_wait_sig_swap+0x18(ffffff014bdabade, ffffff014bdabae0)
  ^ rbp            ^ PC                 (frame 3)
  ffffff00041dbde0 cv_waituntil_sig+0x13c(ffffff014bdabade, ffffff014bdabae0, 0
  ^ rbp            ^ PC                 (frame 4)
...

etc.

The main problem in AMD64 is backtracking the callee-saved variables, but at
least the function arguments are saved for kernel calls.

Cheers,
- jonathan

> E.g. the AIX kdb has an option for their stack backtrace to print
> register state for each stack frame on the stack.
>
> To be fair, kudos to the folks at SUN for recognizing the need of
> field supportability, and giving us mdb.  Also, dtrace is sheer
> goodness, and I do not have _much_ to complain about.

Understood.

Cheers,
- jonathan


Reply via email to