j_server.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 #ifndef __BARRYJDWP_SERVER_H__
00023 #define __BARRYJDWP_SERVER_H__
00024
00025 #include "dll.h"
00026 #include "j_manager.h"
00027 #include "dp_codinfo.h"
00028 #include "m_jvmdebug.h"
00029 #include "threadwrap.h"
00030 #include <string>
00031 #include <memory>
00032
00033
00034 namespace Barry { namespace JDWP {
00035
00036 class BXEXPORT JDWServer
00037 {
00038 public:
00039 typedef void (*ConsoleCallbackType)(const std::string &);
00040
00041 private:
00042 Barry::Mode::JVMDebug *jvmdebug;
00043
00044 int acceptfd;
00045 int sockfd;
00046
00047 std::string address;
00048 int port;
00049
00050 bool loop;
00051 bool targetrunning;
00052
00053 std::string password;
00054
00055 Barry::JVMModulesList modulesList;
00056 Barry::JDG::DebugFileList debugFileList;
00057
00058 JDWAppList appList;
00059 Barry::JDG::ClassList visibleClassList;
00060
00061 std::auto_ptr<Thread> handler;
00062 ConsoleCallbackType printConsoleMessage;
00063
00064 void CommandsetProcess(Barry::Data &cmd);
00065
00066 void CommandsetVirtualMachineProcess(Barry::Data &cmd);
00067 void CommandsetEventRequestProcess(Barry::Data &cmd);
00068
00069 void CommandVersion(Barry::Data &cmd);
00070 void CommandIdSizes(Barry::Data &cmd);
00071 void CommandAllClasses(Barry::Data &cmd);
00072 void CommandAllThreads(Barry::Data &cmd);
00073 void CommandSuspend(Barry::Data &cmd);
00074 void CommandResume(Barry::Data &cmd);
00075 void CommandClassPaths(Barry::Data &cmd);
00076
00077 void CommandSet(Barry::Data &cmd);
00078
00079
00080
00081 protected:
00082
00083 public:
00084 JDWServer(Barry::Mode::JVMDebug &device, const char *address, int port);
00085 ~JDWServer();
00086
00087 void SetPasswordDevice(std::string password);
00088
00089 void SetConsoleCallback(ConsoleCallbackType callback);
00090
00091 bool Start();
00092 bool AcceptConnection();
00093 bool AttachToDevice();
00094 bool InitVisibleClassList();
00095 bool Hello();
00096 void Run();
00097 void DetachFromDevice();
00098 bool Stop();
00099
00100 };
00101
00102 }}
00103
00104 #endif
00105