| Index: src/trusted/gdb_rsp/host.h
|
| ===================================================================
|
| --- src/trusted/gdb_rsp/host.h (revision 3879)
|
| +++ src/trusted/gdb_rsp/host.h (working copy)
|
| @@ -64,8 +64,8 @@
|
| typedef std::vector<uint32_t> ThreadVector_t;
|
|
|
| explicit Host(Session *session);
|
| - ~Host();
|
| - bool Init();
|
| + virtual ~Host();
|
| + virtual bool Init();
|
|
|
| // The following functions are provided cached values when possible.
|
| // For instance, GetSignal, GetThreads, and GetThread, will return
|
| @@ -75,43 +75,46 @@
|
|
|
| // Issue a break request if the target is still running. This is
|
| // asynchronous, we won't actually be "broken" until we get the signal
|
| - bool Break();
|
| + virtual bool Break();
|
|
|
| // Requests that we cleanly detach from the target.
|
| - bool Detach();
|
| + virtual bool Detach();
|
|
|
| // Get the current status of the Target.
|
| - Status GetStatus();
|
| + virtual Status GetStatus();
|
|
|
| // Get the last signal (which put us into the broken state)
|
| - int32_t GetSignal();
|
| + virtual int32_t GetSignal();
|
|
|
| // Get a list of currently active threads
|
| - bool GetThreads(ThreadVector_t *threads) const;
|
| + virtual bool GetThreads(ThreadVector_t *threads) const;
|
|
|
| // Get a thread object by ID.
|
| - Thread *GetThread(uint32_t id);
|
| + virtual Thread *GetThread(uint32_t id);
|
|
|
| // Get and set a block of target memory.
|
| - bool GetMemory(void *dst, uint64_t addr, uint32_t size);
|
| - bool SetMemory(const void *src, uint64_t addr, uint32_t size);
|
| + virtual bool GetMemory(void *dst, uint64_t addr, uint32_t size);
|
| + virtual bool SetMemory(const void *src, uint64_t addr, uint32_t size);
|
|
|
| // Read locally cached properties
|
| - bool HasProperty(const char *name) const;
|
| - bool ReadProperty(const char *name, std::string *val) const;
|
| + virtual bool HasProperty(const char *name) const;
|
| + virtual bool ReadProperty(const char *name, std::string *val) const;
|
|
|
| // Read remote object
|
| - bool ReadObject(const char *type, const char *name, std::string *val);
|
| + virtual bool ReadObject(const char *type, const char *name, std::string *val);
|
|
|
| + // Issues a request to the host and return the host's response.
|
| + virtual bool Request(const std::string &req, std::string *resp);
|
| +
|
| // Set the SINGLE STEP flag on the current thread context, and
|
| // putting the target back into the RUN state.
|
| - bool Step();
|
| + virtual bool Step();
|
|
|
| // Issue a step request, putting us back into the RUN state.
|
| - bool Continue();
|
| + virtual bool Continue();
|
|
|
| // Wait upto the session's packet timeout to see if we receive a break
|
| - bool WaitForBreak();
|
| + virtual bool WaitForBreak();
|
|
|
| // The following functions are internal only and cause communication to
|
| // happen between the target and host. These functions will always
|
| @@ -120,19 +123,20 @@
|
| protected:
|
| // Called whenever the target transitions from running to stopped to
|
| // fetch information about the current state.
|
| - bool Update();
|
| + virtual bool Update();
|
|
|
| - bool Send(Packet *req, Packet *resp);
|
| - bool SendOnly(Packet *req);
|
| + virtual bool Send(Packet *req, Packet *resp);
|
| + virtual bool SendOnly(Packet *req);
|
|
|
| - bool Request(const std::string &req, std::string *resp);
|
| - bool RequestOnly(const std::string &req);
|
| - bool RequestThreadList(ThreadVector_t *ids);
|
| + virtual bool RequestOnly(const std::string &req);
|
| + virtual bool RequestThreadList(ThreadVector_t *ids);
|
|
|
| // Parse a string, returning true and update if a valid stop packet
|
| - bool ParseStopPacket(const char *data);
|
| + virtual bool ParseStopPacket(const char *data);
|
|
|
| - private:
|
| + // Note that that this used to be private. It was made public to enable unit
|
| + // testing of the debug stub, using a mock host.
|
| + protected:
|
| Session *session_;
|
| const Abi *abi_;
|
|
|
|
|