00001 #ifndef PROCESS_TRACE_H
00002 #define PROCESS_TRACE_H
00003 #include "process.h"
00004
00009 class ProcessTrace : public Process
00010 {
00011 bool before_syscall;
00012 bool replace_call;
00013 int return_code;
00014 bool stopped;
00015
00016 std::string ParentOnFork();
00017 std::string ChildOnFork();
00018 std::string HandleEvents();
00019
00020 protected:
00033 virtual bool HandleSyscall(long int syscall_no, void* arg1, void* arg2, void* arg3, void* arg4, void* arg5, int& return_code)
00034 {
00035 (void)syscall_no;
00036 (void)arg1;
00037 (void)arg2;
00038 (void)arg3;
00039 (void)arg4;
00040 (void)arg5;
00041 (void)return_code;
00042 return false;
00043 }
00044 public:
00045 ProcessTrace();
00046
00052 std::string Attach(pid_t pid);
00053
00058 std::string Detach();
00059
00066 std::string Stop();
00067
00074 std::string Continue();
00075
00083 std::string SetChildMem(char* address, char* buf, size_t len);
00084
00092 std::string GetChildMem(char* address, char* buf, size_t len);
00093
00099 std::string GetRegisters(struct user_regs_struct *regs);
00100
00106 std::string SetRegisters(struct user_regs_struct *regs);
00107 };
00108
00109 #endif
00110