tech-kern archive

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

Re: CVS commit: src/sys/lib/libunwind



On Wed, Oct 16, 2013 at 05:22:15PM +0200, Martin Husemann wrote:
> On Wed, Oct 16, 2013 at 05:09:25PM +0200, Joerg Sonnenberger wrote:
> > The need was mentioned a number of times in various threads about libc++
> > and clang.
> 
> But for the kernel? And the details?
> Like where to place it and what to use it for?

It will be used (optionally) by DDB to allow backtraces even in the
presence of -fomit-frame-pointer. 

> > >  - why is it placed in src/sys/lib instead of src/sys/external/...?
> > 
> > Because it is not handled as 3rd party source.
> 
> Why not? And what does "heavily modified" (from the import log) mean?

Unnecessary parts like the support for Apple's Compact Unwind format are
ripped out, HP's libunwind interface is not present etc.

> > >  - there is no user in tree yet, why the import upfront?
> > 
> > This is not true.
> 
> Give me hint, please.

Look at lib/libc/Makefile?

> 
> > >  - what are the alternatives to this very ugly, undocumented, templated 
> > > C++
> > >    code?
> > 
> > I won't ever both with this such an opinionated question...
> 
> Very true - but the point is, that it would be realy helpfull if you could
> not drop such "easter eggs" somewhere hidden in the tree, but explain
> reasoning and plans upfront.
> 
> I am not a C++ hater, as you probably know, but C++, with templates, and not
> even a C API, apparently prepared to be used in the kernel -- IMHO deserves
> an introductionary mail, at the very least.

The "user" interface is plain C, the rest is just an implementation
detail. The C interface creates instances of the DWARF logic, the
address space abstraction and the register set abstraction. The address
space is a parameter to allow using it in contexts like core dumps or
separate processes. The register set is a parameter for dealing with
32bit vs 64bit on a platform for example. The template use allows all
this without additional overhead at run time, which would not be
possible without a lot of mess otherwise. HP's libunwind is a nice case
study for that...

Joerg


Home | Main Index | Thread Index | Old Index