Peter Teoh wrote: > Is there any equivalent function like dump_stack() in Linux kernel, > whereby I can easily just dump the stacktrace at any point in the > kernel source?
getpcstack() will do what you're asking. (There's also traceback(), but that's probably not quite what you want.) getpcstack() stores the stack information in an array so that you can display it later, or just keep it in memory and examine it later with mdb. > And perhaps another macro function to dump all the registers as well? I don't know of one for that. I also don't know why you'd ever want to do that. Why dump the registers? Why not just add dtrace sdts for the information you really want to display? (The only use I can imagine right now would be producing an inscrutable error message, like the blue screen on Windows or "oops" on Linux. I'm not sure why anyone would want that ...) -- James Carlson 42.703N 71.076W <carls...@workingcode.com> _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code