/*
Copyright (C) 2006 - 2009 Evan Teran
                   eteran@alum.rit.edu

This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
*/

#ifndef X86BREAKPOINT_20060720_H_
#define X86BREAKPOINT_20060720_H_

#include "Breakpoint.h"

class X86Breakpoint : public Breakpoint {
public:
	X86Breakpoint(edb::address_t address, bool onetime = false);
	~X86Breakpoint();
	
public:
	virtual edb::address_t address() const		{ return m_Address; }
	virtual unsigned int hitCount() const		{ return m_HitCount; }
	virtual bool enabled() const				{ return m_Enabled; }
	virtual bool oneTime() const				{ return m_OneTime; }
	virtual bool internal() const				{ return m_Internal; }
	virtual QByteArray originalBytes() const	{ return m_OriginalBytes; }

public:
	virtual bool enable();
	virtual bool disable();
	virtual void hit()					{ m_HitCount++; }
	virtual void setOneTime(bool value)	{ m_OneTime = value; }

public:
	static const int size = 1;
	
private:
	QByteArray		m_OriginalBytes;
	edb::address_t	m_Address;
	unsigned int	m_HitCount;
	unsigned int	m_Enabled	: 1;
	unsigned int	m_OneTime	: 1;
	unsigned int	m_Internal	: 1;
};

#endif

