Doxygen configuration + documented some undocumented classes and functions

This commit is contained in:
mrexodia 2015-12-19 06:00:28 +01:00
parent 439fd82767
commit abc8a41a8d
7 changed files with 2600 additions and 27 deletions

1
.gitignore vendored
View File

@ -5,3 +5,4 @@ Release/
*.opensdf *.opensdf
*.orig *.orig
*.vcxproj.user *.vcxproj.user
docs/

2413
Doxyfile Normal file

File diff suppressed because it is too large Load Diff

View File

@ -49,6 +49,9 @@ namespace GleeBug
Execute Execute
}; };
/**
\brief Structure describing internal breakpoint info.
*/
struct BreakpointInternalInfo struct BreakpointInternalInfo
{ {
union union
@ -74,6 +77,9 @@ namespace GleeBug
}; };
}; };
/**
\brief Structure describing a breakpoint.
*/
struct BreakpointInfo struct BreakpointInfo
{ {
ptr address; ptr address;

View File

@ -13,7 +13,7 @@ enum class F
}; //F }; //F
/** /**
\brief Class that represents a flag. \brief Class that represents a flag. This class provides an abstraction for a flag to allow intuitive operations.
\tparam FlagIndex The enum index of the flag. \tparam FlagIndex The enum index of the flag.
\tparam ThisPtr Pointer to the Registers class. \tparam ThisPtr Pointer to the Registers class.
*/ */
@ -21,34 +21,92 @@ template<F FlagIndex>
class Flag class Flag
{ {
public: public:
/**
\brief Constructor.
\param registers Pointer to the registers object.
*/
explicit Flag(Registers* registers) : _registers(registers) {} explicit Flag(Registers* registers) : _registers(registers) {}
/**
\brief Gets the flag.
\return true if the flag was set, false otherwise.
*/
bool Get() const bool Get() const
{ {
return _registers->GetFlag(FlagIndex); return _registers->GetFlag(FlagIndex);
} }
/**
\brief Sets the flag.
\param value (Optional) True to set the flag, false to unset the flag.
*/
void Set(bool value = true) void Set(bool value = true)
{ {
_registers->SetFlag(FlagIndex, value); _registers->SetFlag(FlagIndex, value);
} }
/**
\brief Gets the flag.
\return true if the flag was set, false otherwise.
*/
///
bool operator()() const bool operator()() const
{ {
return Get(); return Get();
} }
Flag<FlagIndex> & operator=(const bool & other) /**
\brief Assignment operator (sets the flag).
\param value True to set the flag, false to unset the flag.
\return A shallow copy of this object.
*/
Flag<FlagIndex> & operator=(const bool & value)
{ {
Set(other); Set(value);
return *this; return *this;
} }
/**
\brief bool casting operator. Uses the flag status.
*/
operator bool() const operator bool() const
{ {
return Get(); return Get();
} }
/**
\brief Bitwise 'or' assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Flag<FlagIndex> & operator|=(const bool & value)
{
Set(Get() | value);
return *this;
}
/**
\brief Bitwise 'exclusive or' assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Flag<FlagIndex> & operator^=(const bool & value)
{
Set(Get() ^ value);
return *this;
}
/**
\brief Bitwise 'and' assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Flag<FlagIndex> & operator&=(const bool & value)
{
Set(Get() & value);
return *this;
}
private: private:
Registers* _registers; Registers* _registers;
}; };

View File

@ -103,7 +103,7 @@ enum class R
}; //R }; //R
/** /**
\brief Class that represents a register. \brief Class that represents a register. This class provides an abstraction for a register to allow intuitive operations.
\tparam RegisterIndex The enum index of the register. \tparam RegisterIndex The enum index of the register.
\tparam Type Type of the register value. \tparam Type Type of the register value.
\tparam ThisPtr Pointer to the Registers class. \tparam ThisPtr Pointer to the Registers class.
@ -112,96 +112,176 @@ template<R RegisterIndex, typename Type>
class Register class Register
{ {
public: public:
/**
\brief Constructor.
\param registers Pointer to the registers.
*/
explicit Register(Registers* registers) : _registers(registers) {} explicit Register(Registers* registers) : _registers(registers) {}
/**
\brief Gets the register value.
\return The register value.
*/
Type Get() const Type Get() const
{ {
return Type(_registers->Get(RegisterIndex)); return Type(_registers->Get(RegisterIndex));
} }
/**
\brief Sets the register value.
\param value The new register value.
*/
void Set(Type value) void Set(Type value)
{ {
_registers->Set(RegisterIndex, ptr(value)); _registers->Set(RegisterIndex, ptr(value));
} }
/**
\brief Gets the register value.
\return The register value.
*/
Type operator()() const Type operator()() const
{ {
return Get(); return Get();
} }
Register<RegisterIndex, Type> & operator=(const Type & other) /**
\brief Assignment operator.
\param value The new register value.
\return A shallow copy of this object.
*/
Register<RegisterIndex, Type> & operator=(const Type & value)
{ {
Set(other); Set(value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator+=(const Type & other) /**
\brief Addition assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator+=(const Type & value)
{ {
Set(Get() + other); Set(Get() + value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator-=(const Type & other) /**
\brief Subtraction assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator-=(const Type & value)
{ {
Set(Get() - other); Set(Get() - value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator*=(const Type & other) /**
\brief Multiplication assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator*=(const Type & value)
{ {
Set(Get() * other); Set(Get() * value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator/=(const Type & other) /**
\brief Division assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator/=(const Type & value)
{ {
Set(Get() / other); Set(Get() / value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator%=(const Type & other) /**
\brief Modulus assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator%=(const Type & value)
{ {
Set(Get() % other); Set(Get() % value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator^=(const Type & other) /**
\brief Bitwise 'exclusive or' assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator^=(const Type & value)
{ {
Set(Get() ^ other); Set(Get() ^ value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator&=(const Type & other) /**
\brief Bitwise 'and' assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator&=(const Type & value)
{ {
Set(Get() & other); Set(Get() & value);
return *this; return *this;
} }
Register<RegisterIndex, Type> & operator|=(const Type & other) /**
\brief Bitwise 'or' assignment operator.
\param value The value to perform the operation with.
\return The result of the operation.
*/
Register<RegisterIndex, Type> & operator|=(const Type & value)
{ {
Set(Get() | other); Set(Get() | value);
return *this; return *this;
} }
/**
\brief Increment operator.
\return The register before the operation.
*/
Register<RegisterIndex, Type> & operator++() Register<RegisterIndex, Type> & operator++()
{ {
auto ret = *this;
Set(Get() + 1); Set(Get() + 1);
return *this; return ret;
} }
/**
\brief Increment operator.
\return The register before the operation.
*/
Register<RegisterIndex, Type> & operator++(int) Register<RegisterIndex, Type> & operator++(int)
{ {
return operator++(); return operator++();
} }
bool operator==(const Type & other) const /**
\brief Equality operator.
\param value The value to compare with.
\return true if the register is equal to the value.
*/
bool operator==(const Type & value) const
{ {
return Get() == other; return Get() == value;
} }
bool operator!=(const Type & other) const /**
\brief Inequality operator.
\param value The value to compare with.
\return true if the register is not equal to the value.
*/
bool operator!=(const Type & value) const
{ {
return !operator==(other); return !operator==(value);
} }
private: private:

View File

@ -55,36 +55,42 @@ namespace GleeBug
/** /**
\brief Process creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback. \brief Process creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback.
\param createProcess Information about the process created. \param createProcess Information about the process created.
\param process ProcessInfo of the created process.
*/ */
virtual void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const ProcessInfo & process) {}; virtual void cbCreateProcessEvent(const CREATE_PROCESS_DEBUG_INFO & createProcess, const ProcessInfo & process) {};
/** /**
\brief Process termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback. \brief Process termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback.
\param exitProcess Information about the process terminated. \param exitProcess Information about the process terminated.
\param process ProcessInfo of the terminated process.
*/ */
virtual void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const ProcessInfo & process) {}; virtual void cbExitProcessEvent(const EXIT_PROCESS_DEBUG_INFO & exitProcess, const ProcessInfo & process) {};
/** /**
\brief Thread creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback. \brief Thread creation debug event callback. Called after the event is internally processed. Provide an implementation to use this callback.
\param createThread Information about the thread created. \param createThread Information about the thread created.
\param thread ThreadInfo of the created thread.
*/ */
virtual void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const ThreadInfo & thread) {}; virtual void cbCreateThreadEvent(const CREATE_THREAD_DEBUG_INFO & createThread, const ThreadInfo & thread) {};
/** /**
\brief Thread termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback. \brief Thread termination debug event callback. Called before the event is internally processed. Provide an implementation to use this callback.
\param exitThread Information about the thread terminated. \param exitThread Information about the thread terminated.
\param thread ThreadInfo of the terminated thread.
*/ */
virtual void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const ThreadInfo & thread) {}; virtual void cbExitThreadEvent(const EXIT_THREAD_DEBUG_INFO & exitThread, const ThreadInfo & thread) {};
/** /**
\brief DLL load debug event callback. Called after event is internally processed. Provide an implementation to use this callback. \brief DLL load debug event callback. Called after event is internally processed. Provide an implementation to use this callback.
\param loadDll Information about the DLL loaded. \param loadDll Information about the DLL loaded.
\param dll DllInfo of the loaded DLL.
*/ */
virtual void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const DllInfo & dll) {}; virtual void cbLoadDllEvent(const LOAD_DLL_DEBUG_INFO & loadDll, const DllInfo & dll) {};
/** /**
\brief DLL unload debug event callback. Called before event is internally processed. Provide an implementation to use this callback. \brief DLL unload debug event callback. Called before event is internally processed. Provide an implementation to use this callback.
\param unloadDll Information about the DLL unloaded. \param unloadDll Information about the DLL unloaded.
\param dll DllInfo of the unloaded DLL.
*/ */
virtual void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const DllInfo & dll) {}; virtual void cbUnloadDllEvent(const UNLOAD_DLL_DEBUG_INFO & unloadDll, const DllInfo & dll) {};

View File

@ -35,8 +35,17 @@ namespace GleeBug
typedef std::pair<ptr, ptr> Range; typedef std::pair<ptr, ptr> Range;
/**
\brief A range compare (used in std::map).
*/
struct RangeCompare struct RangeCompare
{ {
/**
\brief Returns if range a comes before range b.
\param a First range.
\param b Second range.
\return True if a comes before b, false otherwise.
*/
inline bool operator()(const Range & a, const Range & b) const //a before b? inline bool operator()(const Range & a, const Range & b) const //a before b?
{ {
return a.second < b.first; return a.second < b.first;