void append(const T *src, unsigned int count);
};
+// Class to track software breakpoints that we set.
+class software_breakpoint_t
+{
+public:
+ reg_t address;
+ unsigned int size;
+ uint32_t instruction;
+
+ void insert(mmu_t* mmu);
+ void remove(mmu_t* mmu);
+};
+
class gdbserver_t
{
public:
void handle_packet(const std::vector<uint8_t> &packet);
void handle_interrupt();
- void handle_halt_reason(const std::vector<uint8_t> &packet);
- void handle_read_general_registers(const std::vector<uint8_t> &packet);
- void handle_read_memory(const std::vector<uint8_t> &packet);
- void handle_read_register(const std::vector<uint8_t> &packet);
+ void handle_breakpoint(const std::vector<uint8_t> &packet);
void handle_continue(const std::vector<uint8_t> &packet);
+ void handle_extended(const std::vector<uint8_t> &packet);
+ void handle_general_registers_read(const std::vector<uint8_t> &packet);
+ void handle_halt_reason(const std::vector<uint8_t> &packet);
+ void handle_kill(const std::vector<uint8_t> &packet);
+ void handle_memory_binary_write(const std::vector<uint8_t> &packet);
+ void handle_memory_read(const std::vector<uint8_t> &packet);
+ void handle_query(const std::vector<uint8_t> &packet);
+ void handle_register_read(const std::vector<uint8_t> &packet);
+ void handle_step(const std::vector<uint8_t> &packet);
private:
sim_t *sim;
circular_buffer_t<uint8_t> send_buf;
bool expect_ack;
+ bool extended_mode;
+ // Used to track whether we think the target is running. If we think it is
+ // but it isn't, we need to tell gdb about it.
+ bool running;
+
+ std::map <reg_t, software_breakpoint_t> breakpoints;
// Read pending data from the client.
void read();