Adjustions due to changes in the debugger interface
(there's a separate B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED now). git-svn-id: file:///srv/svn/repos/haiku/trunk/current@11707 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -56,7 +56,7 @@ public:
|
|||||||
|
|
||||||
thread_id Thread() const;
|
thread_id Thread() const;
|
||||||
|
|
||||||
bool HandleMessage(debug_thread_stopped &message);
|
bool HandleMessage(DebugMessage *message);
|
||||||
|
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
@@ -149,12 +149,23 @@ ThreadDebugHandler::Thread() const
|
|||||||
|
|
||||||
// HandleMessage
|
// HandleMessage
|
||||||
bool
|
bool
|
||||||
ThreadDebugHandler::HandleMessage(debug_thread_stopped &message)
|
ThreadDebugHandler::HandleMessage(DebugMessage *message)
|
||||||
{
|
{
|
||||||
if (!fInvoker)
|
if (!fInvoker)
|
||||||
fInvoker = new BInvoker(new BMessage(ALERT_MESSAGE), this);
|
fInvoker = new BInvoker(new BMessage(ALERT_MESSAGE), this);
|
||||||
|
|
||||||
|
// get some user-readable message
|
||||||
char buffer[512];
|
char buffer[512];
|
||||||
get_why_stopped_string(message.why, buffer, sizeof(buffer));
|
if (message->Code() == B_DEBUGGER_MESSAGE_THREAD_STOPPED) {
|
||||||
|
get_debug_why_stopped_string(message->Data().thread_stopped.why, buffer,
|
||||||
|
sizeof(buffer));
|
||||||
|
} else if (message->Code() == B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED) {
|
||||||
|
get_debug_exception_string(message->Data().exception_occurred.exception,
|
||||||
|
buffer, sizeof(buffer));
|
||||||
|
} else {
|
||||||
|
// We shouldn't be here.
|
||||||
|
sprintf(buffer, "Debug messages %ld", (int32)message->Code());
|
||||||
|
}
|
||||||
|
|
||||||
// TODO: This would be the point to pop up an asynchronous alert.
|
// TODO: This would be the point to pop up an asynchronous alert.
|
||||||
// We just print the error and send a message to ourselves.
|
// We just print the error and send a message to ourselves.
|
||||||
@@ -222,6 +233,7 @@ TeamDebugHandler::HandleMessage(DebugMessage *message)
|
|||||||
|
|
||||||
switch (message->Code()) {
|
switch (message->Code()) {
|
||||||
case B_DEBUGGER_MESSAGE_THREAD_STOPPED:
|
case B_DEBUGGER_MESSAGE_THREAD_STOPPED:
|
||||||
|
case B_DEBUGGER_MESSAGE_EXCEPTION_OCCURRED:
|
||||||
{
|
{
|
||||||
fNubPort = message->Data().origin.nub_port;
|
fNubPort = message->Data().origin.nub_port;
|
||||||
|
|
||||||
@@ -232,7 +244,7 @@ TeamDebugHandler::HandleMessage(DebugMessage *message)
|
|||||||
fDebugServer->AddHandler(handler);
|
fDebugServer->AddHandler(handler);
|
||||||
|
|
||||||
// let the handler deal with the message
|
// let the handler deal with the message
|
||||||
if (handler->HandleMessage(message->Data().thread_stopped))
|
if (handler->HandleMessage(message))
|
||||||
_DeleteThreadHandler(handler);
|
_DeleteThreadHandler(handler);
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user