Skip to content

Commit

Permalink
bug fix: #35
Browse files Browse the repository at this point in the history
  • Loading branch information
tangzx committed Aug 9, 2017
1 parent 345ebd3 commit d2beeb9
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 20 deletions.
18 changes: 8 additions & 10 deletions debugger/attach/windows/src/Debugger/DebugEvent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,16 +22,14 @@ along with Decoda. If not, see <http://www.gnu.org/licenses/>.

#include "DebugEvent.h"

//DEFINE_EVENT_TYPE(wxEVT_DEBUG_EVENT)

wxDebugEvent::wxDebugEvent(EventId eventId, size_t vm)
{
m_eventId = eventId;
m_vm = vm;
m_scriptIndex = -1;
m_line = 0;
m_enabled = false;
m_messageType = MessageType_Normal;
wxDebugEvent::wxDebugEvent(EventId eventId, size_t vm): m_evalResult(false), m_evalId(0)
{
m_eventId = eventId;
m_vm = vm;
m_scriptIndex = -1;
m_line = 0;
m_enabled = false;
m_messageType = MessageType_Normal;
}

EventId wxDebugEvent::GetEventId() const
Expand Down
9 changes: 2 additions & 7 deletions debugger/attach/windows/src/Debugger/DebugEvent.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,9 @@ class wxDebugEvent// : public wxEvent
{

public:
virtual ~wxDebugEvent() = default;

/**
/**
* Constructor.
*/
wxDebugEvent(EventId eventId, size_t vm);
Expand Down Expand Up @@ -137,10 +138,4 @@ class wxDebugEvent// : public wxEvent
int m_evalId;
};

//typedef void (wxEvtHandler::*wxDebugEventFunction)(wxDebugEvent&);

#define EVT_DEBUG(fn) \
DECLARE_EVENT_TABLE_ENTRY( wxEVT_DEBUG_EVENT, 0, -1, \
(wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxDebugEventFunction, & fn ), (wxObject *) NULL ),

#endif
13 changes: 12 additions & 1 deletion debugger/attach/windows/src/Debugger/wxEvtHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@

using namespace std;

wxEvtHandler::wxEvtHandler(): vm(0)
{
}

void wxEvtHandler::AddPendingEvent(wxDebugEvent & event)
{
this->vm = event.GetVm();
auto vm = event.GetVm();
if (vm != 0)
this->vm = event.GetVm();

EventId id = event.GetEventId();
DebugFrontend& df = DebugFrontend::Get();
Expand Down Expand Up @@ -69,6 +75,11 @@ void wxEvtHandler::AddPendingEvent(wxDebugEvent & event)
}
break;
}
case EventId_Initialize: break;
case EventId_CreateVM: break;
case EventId_DestroyVM: break;
case EventId_SessionEnd: break;
default: ;
}

TiXmlPrinter printer;
Expand Down
2 changes: 1 addition & 1 deletion debugger/attach/windows/src/Debugger/wxEvtHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ class wxDebugEvent;
class wxEvtHandler
{
public:
wxEvtHandler();
void AddPendingEvent(wxDebugEvent &event);
public:
size_t vm;
};

Expand Down
Binary file modified debugger/attach/windows/src/LuaInject/DebugBackend.cpp
Binary file not shown.
2 changes: 1 addition & 1 deletion debugger/attach/windows/src/LuaInject/DebugBackend.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ class DebugBackend
/**
* Sends a text message to the front end.
*/
void Message(const char* message, MessageType type = MessageType_Normal);
void Message(const char* message, MessageType type = MessageType_Normal) const;

/**
* Ignores the specified exception whenever it occurs.
Expand Down

0 comments on commit d2beeb9

Please sign in to comment.