From 23f48a24d02a4c7249bad637d756f54b73331c5f Mon Sep 17 00:00:00 2001 From: Rene Gollent Date: Wed, 26 Jun 2013 21:44:45 -0400 Subject: [PATCH] Add event class for the post-syscall debug message. --- src/apps/debugger/controllers/TeamDebugger.cpp | 3 ++- .../debugger/debugger_interface/DebugEvent.cpp | 12 ++++++++++++ src/apps/debugger/debugger_interface/DebugEvent.h | 15 +++++++++++++++ .../debugger_interface/DebuggerInterface.cpp | 11 ++++++++++- 4 files changed, 39 insertions(+), 2 deletions(-) diff --git a/src/apps/debugger/controllers/TeamDebugger.cpp b/src/apps/debugger/controllers/TeamDebugger.cpp index 6026df67d5..7fce6fb7b1 100644 --- a/src/apps/debugger/controllers/TeamDebugger.cpp +++ b/src/apps/debugger/controllers/TeamDebugger.cpp @@ -441,7 +441,8 @@ TeamDebugger::Init(team_id teamID, thread_id threadID, int argc, // set team debugging flags 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 AutoLocker< ::Team> teamLocker(fTeam); diff --git a/src/apps/debugger/debugger_interface/DebugEvent.cpp b/src/apps/debugger/debugger_interface/DebugEvent.cpp index c3bf1276a8..16dac7328a 100644 --- a/src/apps/debugger/debugger_interface/DebugEvent.cpp +++ b/src/apps/debugger/debugger_interface/DebugEvent.cpp @@ -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 diff --git a/src/apps/debugger/debugger_interface/DebugEvent.h b/src/apps/debugger/debugger_interface/DebugEvent.h index dda16cb1dd..edd81400df 100644 --- a/src/apps/debugger/debugger_interface/DebugEvent.h +++ b/src/apps/debugger/debugger_interface/DebugEvent.h @@ -1,5 +1,6 @@ /* * Copyright 2009, Ingo Weinhold, ingo_weinhold@gmx.de. + * Copyright 2013, Rene Gollent, rene@gollent.com. * Distributed under the terms of the MIT License. */ #ifndef DEBUG_EVENT_H @@ -8,6 +9,7 @@ #include #include "ImageInfo.h" +#include "SyscallInfo.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 { public: HandedOverEvent(team_id team, diff --git a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp index d641f2435b..0af3105aff 100644 --- a/src/apps/debugger/debugger_interface/DebuggerInterface.cpp +++ b/src/apps/debugger/debugger_interface/DebuggerInterface.cpp @@ -830,13 +830,22 @@ DebuggerInterface::_CreateDebugEvent(int32 messageCode, info.data_size)); 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: printf("DebuggerInterface for team %" B_PRId32 ": unknown message " "from kernel: %" B_PRId32 "\n", fTeamID, messageCode); // fall through... case B_DEBUGGER_MESSAGE_TEAM_CREATED: case B_DEBUGGER_MESSAGE_PRE_SYSCALL: - case B_DEBUGGER_MESSAGE_POST_SYSCALL: case B_DEBUGGER_MESSAGE_SIGNAL_RECEIVED: case B_DEBUGGER_MESSAGE_PROFILER_UPDATE: case B_DEBUGGER_MESSAGE_HANDED_OVER: