headers/bsd: Add sys/queue.h.
[haiku.git] / src / kits / debugger / model / StackTrace.cpp
blobbcedfd14805d70a3e0c56aa21cf8569e9107fb8b
1 /*
2 * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
3 * Distributed under the terms of the MIT License.
4 */
6 #include "StackTrace.h"
9 StackTrace::StackTrace()
14 StackTrace::~StackTrace()
16 for (int32 i = 0; StackFrame* frame = FrameAt(i); i++)
17 frame->ReleaseReference();
21 bool
22 StackTrace::AddFrame(StackFrame* frame)
24 if (fStackFrames.AddItem(frame))
25 return true;
27 frame->ReleaseReference();
28 return false;
32 int32
33 StackTrace::CountFrames() const
35 return fStackFrames.CountItems();
39 StackFrame*
40 StackTrace::FrameAt(int32 index) const
42 return fStackFrames.ItemAt(index);