make debug() output more useful

This change does several things. First, and most important, it allows
dumping the "n" most recent stack frames on each debug() call. Second,
it demangles the C++ symbols. Third, it prepends each debug() message
with the debug level.

Unrelated to the above I've replaced all `assert(!is_forked_child());`
statements with `ASSERT_IS_NOT_FORKED_CHILD()` for consistency.
This commit is contained in:
Kurtis Rader
2016-05-15 19:45:02 -07:00
parent d55113b5b5
commit 73f2992a2e
7 changed files with 114 additions and 44 deletions

View File

@@ -948,7 +948,7 @@ void exec_job(parser_t &parser, job_t *j) {
bool builtin_io_done = do_builtin_io(outbuff.data(), outbuff.size(),
errbuff.data(), errbuff.size());
if (!builtin_io_done && errno != EPIPE) {
show_stackframe();
show_stackframe(L'E');
}
fork_was_skipped = true;
}