Add event class for the post-syscall debug message.

This commit is contained in:
Rene Gollent
2013-06-28 18:49:26 -04:00
parent d08227bb68
commit 23f48a24d0
4 changed files with 39 additions and 2 deletions
@@ -441,7 +441,8 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, int argc,
// set team debugging flags // set team debugging flags
fDebuggerInterface->SetTeamDebuggingFlags( fDebuggerInterface->SetTeamDebuggingFlags(
B_TEAM_DEBUG_THREADS | B_TEAM_DEBUG_IMAGES); B_TEAM_DEBUG_THREADS | B_TEAM_DEBUG_IMAGES
| B_TEAM_DEBUG_POST_SYSCALL);
// get the initial state of the team // get the initial state of the team
AutoLocker< ::Team> teamLocker(fTeam); AutoLocker< ::Team> teamLocker(fTeam);
@@ -215,6 +215,18 @@ ImageDeletedEvent::ImageDeletedEvent(team_id team, thread_id thread,
} }
// #pragma mark - PostSyscallEvent
PostSyscallEvent::PostSyscallEvent(team_id team, thread_id thread,
const SyscallInfo& info)
:
DebugEvent(B_DEBUGGER_MESSAGE_POST_SYSCALL, team, thread),
fInfo(info)
{
}
// #pragma mark - HandedOverEvent // #pragma mark - HandedOverEvent
@@ -1,5 +1,6 @@
/* /*
* Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de.
* Copyright 2013, Rene Gollent, rene@gollent.com.
* Distributed under the terms of the MIT License. * Distributed under the terms of the MIT License.
*/ */
#ifndef DEBUG_EVENT_H #ifndef DEBUG_EVENT_H
@@ -8,6 +9,7 @@
#include <debugger.h> #include <debugger.h>
#include "ImageInfo.h" #include "ImageInfo.h"
#include "SyscallInfo.h"
#include "Types.h" #include "Types.h"
@@ -196,6 +198,19 @@ private:
}; };
class PostSyscallEvent : public DebugEvent {
public:
PostSyscallEvent(team_id team,
thread_id thread,
const SyscallInfo& info);
const SyscallInfo& GetSyscallInfo() const { return fInfo; }
private:
SyscallInfo fInfo;
};
class HandedOverEvent : public DebugEvent { class HandedOverEvent : public DebugEvent {
public: public:
HandedOverEvent(team_id team, HandedOverEvent(team_id team,
@@ -830,13 +830,22 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode,
info.data_size)); info.data_size));
break; break;
} }
case B_DEBUGGER_MESSAGE_POST_SYSCALL:
{
event = new(std::nothrow) PostSyscallEvent(message.origin.team,
message.origin.thread,
SyscallInfo(message.post_syscall.start_time,
message.post_syscall.end_time,
message.post_syscall.return_value,
message.post_syscall.syscall, message.post_syscall.args));
break;
}
default: default:
printf("DebuggerInterface for team %" B_PRId32 ": unknown message " printf("DebuggerInterface for team %" B_PRId32 ": unknown message "
"from kernel: %" B_PRId32 "\n", fTeamID, messageCode); "from kernel: %" B_PRId32 "\n", fTeamID, messageCode);
// fall through... // fall through...
case B_DEBUGGER_MESSAGE_TEAM_CREATED: case B_DEBUGGER_MESSAGE_TEAM_CREATED:
case B_DEBUGGER_MESSAGE_PRE_SYSCALL: case B_DEBUGGER_MESSAGE_PRE_SYSCALL:
case B_DEBUGGER_MESSAGE_POST_SYSCALL:
case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED: case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED:
case B_DEBUGGER_MESSAGE_PROFILER_UPDATE: case B_DEBUGGER_MESSAGE_PROFILER_UPDATE:
case B_DEBUGGER_MESSAGE_HANDED_OVER: case B_DEBUGGER_MESSAGE_HANDED_OVER: