2 ===========================================================================
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
9 Doom 3 Source Code is free software: you can redistribute it and/or modify
10 it under the terms of the GNU General Public License as published by
11 the Free Software Foundation, either version 3 of the License, or
12 (at your option) any later version.
14 Doom 3 Source Code is distributed in the hope that it will be useful,
15 but WITHOUT ANY WARRANTY; without even the implied warranty of
16 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 GNU General Public License for more details.
19 You should have received a copy of the GNU General Public License
20 along with Doom 3 Source Code. If not, see <http://www.gnu.org/licenses/>.
22 In addition, the Doom 3 Source Code is also subject to certain additional terms. You should have received a copy of these additional terms immediately following the terms and conditions of the GNU General Public License which accompanied the Doom 3 Source Code. If not, please request a copy in writing from id Software at the address below.
24 If you have questions concerning this license or the applicable additional terms, you may contact in writing id Software LLC, c/o ZeniMax Media Inc., Suite 120, Rockville, Maryland 20850 USA.
26 ===========================================================================
28 #ifndef DEBUGGERSERVER_H_
29 #define DEBUGGERSERVER_H_
31 #ifndef DEBUGGERMESSAGES_H_
32 #include "DebuggerMessages.h"
35 #ifndef DEBUGGERBREAKPOINT_H_
36 #include "DebuggerBreakpoint.h"
39 #ifndef __GAME_LOCAL_H__
40 #include "../../game/Game.h"
46 class rvDebuggerServer
51 ~rvDebuggerServer ( );
53 bool Initialize ( void );
54 void Shutdown ( void );
56 bool ProcessMessages ( void );
58 bool IsConnected ( void );
60 void CheckBreakpoints ( idInterpreter* interpreter, idProgram* program, int instructionPointer );
62 void Print ( const char* text );
64 void OSPathToRelativePath( const char *osPath, idStr &qpath );
68 // protected member variables
72 idList<rvDebuggerBreakpoint*> mBreakpoints;
73 CRITICAL_SECTION mCriticalSection;
81 int mBreakStepOverDepth;
82 const function_t* mBreakStepOverFunc1;
83 const function_t* mBreakStepOverFunc2;
84 idProgram* mBreakProgram;
85 int mBreakInstructionPointer;
86 idInterpreter* mBreakInterpreter;
88 idStr mLastStatementFile;
89 int mLastStatementLine;
93 void ClearBreakpoints ( void );
95 void Break ( idInterpreter* interpreter, idProgram* program, int instructionPointer );
98 void SendMessage ( EDebuggerMessage dbmsg );
99 void SendPacket ( void* data, int datasize );
102 void HandleAddBreakpoint ( msg_t* msg );
103 void HandleRemoveBreakpoint ( msg_t* msg );
104 void HandleResume ( msg_t* msg );
105 void HandleInspectVariable ( msg_t* msg );
106 void HandleInspectCallstack ( msg_t* msg );
107 void HandleInspectThreads ( msg_t* msg );
109 // MSG helper routines
110 void MSG_WriteCallstackFunc ( msg_t* msg, const prstack_t* stack );
115 rvDebuggerServer::IsConnected
118 ID_INLINE bool rvDebuggerServer::IsConnected ( void )
125 rvDebuggerServer::SendPacket
128 ID_INLINE void rvDebuggerServer::SendPacket ( void* data, int size )
130 mPort.SendPacket ( mClientAdr, data, size );
133 #endif // DEBUGGERSERVER_H_