#ifndef Breakpoint_h
#define Breakpoint_h
#include "DebuggerPrimitives.h"
#include <wtf/DoublyLinkedList.h>
#include <wtf/RefCounted.h>
#include <wtf/text/WTFString.h>
namespace JSC {
struct Breakpoint : public DoublyLinkedListNode<Breakpoint> {
Breakpoint()
{
}
Breakpoint(SourceID sourceID, unsigned line, unsigned column, const String& condition, bool autoContinue, unsigned ignoreCount)
: sourceID(sourceID)
, line(line)
, column(column)
, condition(condition)
, autoContinue(autoContinue)
, ignoreCount(ignoreCount)
{
}
Breakpoint(const Breakpoint& other)
: id(other.id)
, sourceID(other.sourceID)
, line(other.line)
, column(other.column)
, condition(other.condition)
, autoContinue(other.autoContinue)
, ignoreCount(other.ignoreCount)
, hitCount(other.hitCount)
{
}
BreakpointID id { noBreakpointID };
SourceID sourceID { noSourceID };
unsigned line { 0 };
unsigned column { 0 };
String condition;
bool autoContinue { false };
unsigned ignoreCount { 0 };
unsigned hitCount { 0 };
static const unsigned unspecifiedColumn = UINT_MAX;
private:
Breakpoint* m_prev;
Breakpoint* m_next;
friend class WTF::DoublyLinkedListNode<Breakpoint>;
};
class BreakpointsList : public DoublyLinkedList<Breakpoint>,
public RefCounted<BreakpointsList> {
public:
~BreakpointsList()
{
Breakpoint* breakpoint;
while ((breakpoint = removeHead()))
delete breakpoint;
ASSERT(isEmpty());
}
};
}
#endif // Breakpoint_h