doom3-gpl
Doom 3 GPL source release
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
DebuggerServer.h
Go to the documentation of this file.
1 /*
2 ===========================================================================
3 
4 Doom 3 GPL Source Code
5 Copyright (C) 1999-2011 id Software LLC, a ZeniMax Media company.
6 
7 This file is part of the Doom 3 GPL Source Code (?Doom 3 Source Code?).
8 
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.
13 
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.
18 
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/>.
21 
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.
23 
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.
25 
26 ===========================================================================
27 */
28 #ifndef DEBUGGERSERVER_H_
29 #define DEBUGGERSERVER_H_
30 
31 #ifndef DEBUGGERMESSAGES_H_
32 #include "DebuggerMessages.h"
33 #endif
34 
35 #ifndef DEBUGGERBREAKPOINT_H_
36 #include "DebuggerBreakpoint.h"
37 #endif
38 
39 #ifndef __GAME_LOCAL_H__
40 #include "../../game/Game.h"
41 #endif
42 
43 class idInterpreter;
44 class idProgram;
45 
47 {
48 public:
49 
50  rvDebuggerServer ( );
52 
53  bool Initialize ( void );
54  void Shutdown ( void );
55 
56  bool ProcessMessages ( void );
57 
58  bool IsConnected ( void );
59 
60  void CheckBreakpoints ( idInterpreter* interpreter, idProgram* program, int instructionPointer );
61 
62  void Print ( const char* text );
63 
64  void OSPathToRelativePath( const char *osPath, idStr &qpath );
65 
66 protected:
67 
68  // protected member variables
69  bool mConnected;
73  CRITICAL_SECTION mCriticalSection;
74 
76 
77  bool mBreak;
78  bool mBreakNext;
87 
90 
91 private:
92 
93  void ClearBreakpoints ( void );
94 
95  void Break ( idInterpreter* interpreter, idProgram* program, int instructionPointer );
96  void Resume ( void );
97 
98  void SendMessage ( EDebuggerMessage dbmsg );
99  void SendPacket ( void* data, int datasize );
100 
101  // Message handlers
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 );
108 
109  // MSG helper routines
110  void MSG_WriteCallstackFunc ( msg_t* msg, const prstack_t* stack );
111 };
112 
113 /*
114 ================
115 rvDebuggerServer::IsConnected
116 ================
117 */
118 ID_INLINE bool rvDebuggerServer::IsConnected ( void )
119 {
120  return mConnected;
121 }
122 
123 /*
124 ================
125 rvDebuggerServer::SendPacket
126 ================
127 */
128 ID_INLINE void rvDebuggerServer::SendPacket ( void* data, int size )
129 {
130  mPort.SendPacket ( mClientAdr, data, size );
131 }
132 
133 #endif // DEBUGGERSERVER_H_
void HandleRemoveBreakpoint(msg_t *msg)
void HandleInspectVariable(msg_t *msg)
const function_t * mBreakStepOverFunc1
idProgram * mBreakProgram
typedef HANDLE(WINAPI *PFNWGLCREATEBUFFERREGIONARBPROC)(HDC hDC
void Print(const char *text)
const function_t * mBreakStepOverFunc2
bool Initialize(void)
void SendPacket(void *data, int datasize)
void HandleInspectThreads(msg_t *msg)
idList< rvDebuggerBreakpoint * > mBreakpoints
void SendPacket(const netadr_t to, const void *data, int size)
Definition: posix_net.cpp:572
GLuint program
Definition: glext.h:3473
GLsizei GLsizei GLenum GLenum const GLvoid * data
Definition: glext.h:2853
CRITICAL_SECTION mCriticalSection
bool IsConnected(void)
void OSPathToRelativePath(const char *osPath, idStr &qpath)
void HandleAddBreakpoint(msg_t *msg)
void SendMessage(EDebuggerMessage dbmsg)
void CheckBreakpoints(idInterpreter *interpreter, idProgram *program, int instructionPointer)
void ClearBreakpoints(void)
void HandleInspectCallstack(msg_t *msg)
bool ProcessMessages(void)
GLsizeiptr size
Definition: glext.h:3112
Definition: Str.h:116
void Break(idInterpreter *interpreter, idProgram *program, int instructionPointer)
idInterpreter * mBreakInterpreter
void MSG_WriteCallstackFunc(msg_t *msg, const prstack_t *stack)
void HandleResume(msg_t *msg)
EDebuggerMessage