bonefish+mmlr:
* Add an AbstractTraceEntryWithStackTrace that includes stack trace handling. * Add a selector macro/template combo to conveniently select the right base class depending on whether stack traces are enabled or not. * Minor style cleanups. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@43045 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -737,17 +737,6 @@ TraceEntry::operator new(size_t size, const std::nothrow_t&) throw()
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
AbstractTraceEntry::AbstractTraceEntry()
|
||||
{
|
||||
Thread* thread = thread_get_current_thread();
|
||||
if (thread != NULL) {
|
||||
fThread = thread->id;
|
||||
if (thread->team)
|
||||
fTeam = thread->team->id;
|
||||
}
|
||||
fTime = system_time();
|
||||
}
|
||||
|
||||
AbstractTraceEntry::~AbstractTraceEntry()
|
||||
{
|
||||
}
|
||||
@@ -777,6 +766,38 @@ AbstractTraceEntry::AddDump(TraceOutput& out)
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AbstractTraceEntry::_Init()
|
||||
{
|
||||
Thread* thread = thread_get_current_thread();
|
||||
if (thread != NULL) {
|
||||
fThread = thread->id;
|
||||
if (thread->team)
|
||||
fTeam = thread->team->id;
|
||||
}
|
||||
fTime = system_time();
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark - AbstractTraceEntryWithStackTrace
|
||||
|
||||
|
||||
|
||||
AbstractTraceEntryWithStackTrace::AbstractTraceEntryWithStackTrace(
|
||||
size_t stackTraceDepth, size_t skipFrames, bool kernelOnly)
|
||||
{
|
||||
fStackTrace = capture_tracing_stack_trace(stackTraceDepth, skipFrames + 1,
|
||||
kernelOnly);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
AbstractTraceEntryWithStackTrace::DumpStackTrace(TraceOutput& out)
|
||||
{
|
||||
out.PrintStackTrace(fStackTrace);
|
||||
}
|
||||
|
||||
|
||||
// #pragma mark -
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user