diff --git a/GleeBug/Debugger.Thread.cpp b/GleeBug/Debugger.Thread.cpp index 41264bf..5cb0e7b 100644 --- a/GleeBug/Debugger.Thread.cpp +++ b/GleeBug/Debugger.Thread.cpp @@ -21,6 +21,18 @@ namespace GleeBug { } + ThreadInfo & ThreadInfo::operator=(const ThreadInfo& other) + { + dwThreadId = other.dwThreadId; + hThread = other.hThread; + lpThreadLocalBase = other.lpThreadLocalBase; + lpStartAddress = other.lpStartAddress; + registers = Registers(); //create new registers + stepCallbacks = other.stepCallbacks; + isSingleStepping = other.isSingleStepping; + return *this; + } + bool ThreadInfo::RegReadContext() { SuspendThread(this->hThread); diff --git a/GleeBug/Debugger.Thread.h b/GleeBug/Debugger.Thread.h index 37efefb..91bdb1e 100644 --- a/GleeBug/Debugger.Thread.h +++ b/GleeBug/Debugger.Thread.h @@ -34,6 +34,13 @@ namespace GleeBug */ ThreadInfo(const ThreadInfo & other); + /** + \brief Assignment operator. + \param other The other object. + \return A shallow copy of this object. + */ + ThreadInfo & operator=(const ThreadInfo & other); + /** \brief Read the register context from the thread. This fills the RegistersInfo member. \return true if it succeeds, false if it fails. diff --git a/GleeBug/Debugger.cpp b/GleeBug/Debugger.cpp index 3b8fde4..033da4e 100644 --- a/GleeBug/Debugger.cpp +++ b/GleeBug/Debugger.cpp @@ -45,8 +45,7 @@ namespace GleeBug &si, &_mainProcess); - if (szCreateWithCmdLine) - delete[] szCreateWithCmdLine; + delete[] szCreateWithCmdLine; return result; }