http://coremark.sf.net

What name demangling routines do you use? And where do you get the argument information from?adek336 wrote:Here's an example of panaLiX 0.08. A sysfail (kernel panic) situation results in a stacktrace with C++ name demangling and arguments passed to the functions.
Awesome! I've done a similar thing for Pedigree, here: http://pedigree.googlecode.com/svn/trun ... emangle.cc - You managed to condense your code down a lot more than I did, it seems. Pedigree can get its function arguments in the same way as you - it's pretty damn useful, as I'm sure you've found.Adek336 wrote:thanks lukemwell actually I never really noticed I had anal in my name
thanks for letting me know, though
![]()
I've written the demangler in accordance to http://www.codesourcery.com/public/cxx- ... l#mangling, well I've just checked my code and it's not perfectly beautiful, but then again I wasn't much of a coder back then, code here http://panalix.sourceforge.net/doxygen/ ... ource.html.
I can get to the arguments because I demangle the names in an exception handler and therefore I know the EBP value at the moment of crash http://panalix.sourceforge.net/doxygen/ ... tml#l00049. The argument is fetched from memory at http://panalix.sourceforge.net/doxygen/ ... tml#l00404. Unfortunately, in gcc 4.3 it seems to not work (in 3.3 it did).
My code is condensed, but I can't say it's a total success - I failed to structure and comment it well, it takes me a lot of analysis to just understand what it does. I don't support templates as I didn't care to check what these are when I was coding this part of softwareAwesome! I've done a similar thing for Pedigree, here: http://pedigree.googlecode.com/svn/trun ... emangle.cc - You managed to condense your code down a lot more than I did, it seems. Pedigree can get its function arguments in the same way as you - it's pretty damn useful, as I'm sure you've found.
No support for additional debug information other than function name and arguments on my part... I didn't even think about the possibility to have code which didn't use EBP for frame pointers at that timeI also wrote this, however: http://pedigree.googlecode.com/svn/trun ... tomaton.cc - this parses DWARF-2.0 and 3.0 call frame information (.debug_frame sections) so that I can backtrace on systems without frame pointers, and on x86 with --omit-frame-pointer. Pretty useful too. I also patched gcc to force it to output call-frame instructions in the preamble of every function, so I also know where in memory function parameters are stored (again, for architectures without a navigable stack frame structure).
What architectures do you support, out of interest? (I saw an ::Arch:: somewhere in that stacktrace...)
Hmm, I'm working on the same thing right now for my OS. I previously doing stack dumps by navigating the stack frame on x86 (looking up function addresses from the symbol table, and names from the string table), but as you rightfully pointed out, that relies on the frame pointer (as well as a symbol table) and isn't all that portable between arches. I'm curious why you had to patch GCC to output the CFI, though. I just pass -fasynchronous-unwind-tables to gcc when I compile. This doesn't work for ASM code, you simply have to add the appropriate CFI instructions yourself.JamesM wrote: I also wrote this, however: http://pedigree.googlecode.com/svn/trun ... tomaton.cc - this parses DWARF-2.0 and 3.0 call frame information (.debug_frame sections) so that I can backtrace on systems without frame pointers, and on x86 with --omit-frame-pointer. Pretty useful too. I also patched gcc to force it to output call-frame instructions in the preamble of every function, so I also know where in memory function parameters are stored (again, for architectures without a navigable stack frame structure).
Code: Select all
.eh_frame ALIGN(4) : AT(ADDR(.eh_frame) - PAGE_OFFSET)
{
__start_eh_frame = .;
*(.eh_frame)
__end_eh_frame = .;
}
Which could very well be Linux running in QEMU :). That's one of the reasons I'm not fond of these POSIX OSes...milyges wrote:Some screenshots from IdyllaOS 0.1-dev:
Keep your opinions to yourself, he develops his OS publicly, both source and disk images are available.jal wrote:Which could very well be Linux running in QEMUmilyges wrote:Some screenshots from IdyllaOS 0.1-dev:. That's one of the reasons I'm not fond of these POSIX OSes...
JAL