Re: verbose exception
- From: Paul Davis <paul linuxaudiosystems com>
- To: Paul Davis <pjdavis engineering uiowa edu>
- Cc: gtkmm-list gnome org
- Subject: Re: verbose exception
- Date: Fri, 22 Sep 2006 18:15:56 -0400
On Fri, 2006-09-22 at 16:01 -0500, Paul Davis wrote:
> I've know of a guy that did something with similar functionality but a
> better implementation.
>
> http://www.slamb.org/svn/repos/trunk/projects/atoms/atoms/debug.cc
>
> This is an implementation of a Backtrace class that can be
> conditionally included in throw exceptions ( He has it compile
> conditional )
c/o glibc, which the vast majority of us are using, i suspect:
void
stacktrace (std::ostream& out)
{
void *array[200];
size_t size;
char **strings;
size_t i;
size = backtrace (array, 200);
strings = backtrace_symbols (array, size);
if (strings) {
for (i = 0; i < size; i++) {
out << strings[i] << std::endl;
}
free (strings);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]