I added .SUNW_ldynsym sections to our ELF files last fall to add the local function symbol information, and dladdr() uses them. That was PSARC 2006/526.
walkcontext()/printstack() sit on top of dladdr(), so they automatically gained visibility on local function names as a result. A backtrace() implementation based on that some code would also see them without having to do anything special. However, it is going to a while before this gets backported to S10. Don't toss away that pstack based version too quickly. - Ali Alan Coopersmith wrote: > Bart Smaalders wrote: >> >> Some time ago (Solaris 9 development) I put walkcontext() >> and printstack() into Solaris. Linux introduced backtrace() >> at some point; there are now programs that will use either >> one (dovecot, for example), but there are others that confine >> themselves to backtrace() only. >> >> It's fairly simple to support for backtrace, backtrace_symbols, >> and backtrace_symbols_fd for Solaris using the existing >> walkcontext and support code for printstack(). Is this worth >> doing? > > Xorg uses backtrace() on Linux to print a stack trace to Xorg.0.log > when crashing - I originally added code to use walkcontext() to do > the same, but ended up replacing it with pipe/fork/exec of pstack, > since that was the only way to see function names of private symbols. > I seem to remember seeing a recent fasttrack from the linker aliens to > fix this - it would be good if any new backtrace() function could take > advantage of it. > > The previous discussion is archived at: > http://www.opensolaris.org/jive/thread.jspa?threadID=2887&tstart=75 > > (and now that I see that thread again, I see that fork/exec pstack > was actually your suggestion). >
