m_jvmdebug.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef __BARRY_M_JVMDEBUG_H__
00024 #define __BARRY_M_JVMDEBUG_H__
00025
00026 #include "dll.h"
00027 #include "m_mode_base.h"
00028 #include "socket.h"
00029 #include "record.h"
00030 #include "data.h"
00031
00032 namespace Barry {
00033
00034
00035 class Parser;
00036 class Builder;
00037 class Controller;
00038
00039 class JVMModulesEntry;
00040 class JVMThreadsEntry;
00041
00042
00043 class BXEXPORT JVMModulesList : public std::vector<JVMModulesEntry>
00044 {
00045 public:
00046 typedef std::vector<JVMModulesEntry> base_type;
00047 typedef base_type::iterator iterator;
00048 typedef base_type::const_iterator const_iterator;
00049
00050 public:
00051 void Parse(const Data &entry_packet);
00052
00053 void Dump(std::ostream &os) const;
00054 };
00055 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JVMModulesList &list) {
00056 list.Dump(os);
00057 return os;
00058 }
00059
00060
00061 class BXEXPORT JVMModulesEntry
00062 {
00063 public:
00064 uint32_t Id;
00065 uint32_t UniqueID;
00066 std::string Name;
00067
00068 public:
00069 void Dump(std::ostream &os) const;
00070 };
00071
00072
00073 class BXEXPORT JVMThreadsList : public std::vector<JVMThreadsEntry>
00074 {
00075 public:
00076 typedef std::vector<JVMThreadsEntry> base_type;
00077 typedef base_type::iterator iterator;
00078 typedef base_type::const_iterator const_iterator;
00079
00080 public:
00081 void Parse(const Data &entry_packet);
00082
00083 void Dump(std::ostream &os) const;
00084 };
00085 BXEXPORT inline std::ostream& operator<<(std::ostream &os, const JVMThreadsList &list) {
00086 list.Dump(os);
00087 return os;
00088 }
00089
00090
00091 class BXEXPORT JVMThreadsEntry
00092 {
00093 public:
00094 uint32_t Id;
00095 uint8_t Byte;
00096 uint32_t Address;
00097 uint32_t Unknown01;
00098
00099
00100
00101 uint32_t Unknown02;
00102 uint32_t Unknown03;
00103 uint32_t Unknown04;
00104 uint32_t Unknown05;
00105 uint32_t Unknown06;
00106
00107 public:
00108 void Dump(std::ostream &os, int num) const;
00109 };
00110
00111
00112 namespace Mode {
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126 class BXEXPORT JVMDebug : public Mode
00127 {
00128 private:
00129 bool m_Attached;
00130
00131 protected:
00132 void ThrowJVMError(const std::string &msg, uint8_t cmd);
00133
00134
00135
00136
00137 virtual void OnOpen();
00138
00139 public:
00140 JVMDebug(Controller &con);
00141 ~JVMDebug();
00142
00143
00144
00145 void Close();
00146
00147 void Attach();
00148 void Detach();
00149
00150
00151 void Unknown01();
00152
00153 void Unknown02();
00154 void Unknown03();
00155 void Unknown04();
00156 void Unknown05();
00157 void Unknown06();
00158 void Unknown07();
00159 void Unknown08();
00160 void Unknown09();
00161 void Unknown10();
00162 void GetModulesList(JVMModulesList &mylist);
00163 void GetThreadsList(JVMThreadsList &mylist);
00164 int GetConsoleMessage(std::string &msg);
00165 bool GetStatus(int &status);
00166 bool WaitStatus(int &status);
00167 void Go();
00168 void Stop();
00169 };
00170
00171 }}
00172
00173 #endif
00174