gdb rsp: make start() rerunnable

Signed-off-by: Amneesh Singh <natto@weirdnatto.in>
This commit is contained in:
2024-06-16 21:11:18 +05:30
parent c55f2937f7
commit 2c89701fee
2 changed files with 7 additions and 6 deletions

View File

@@ -38,12 +38,13 @@ be_to_le(std::string str) {
return current; return current;
} }
GdbRsp::GdbRsp(std::shared_ptr<Cpu> cpu) GdbRsp::GdbRsp(std::shared_ptr<Cpu> cpu, uint port)
: cpu(cpu) {} : cpu(cpu) {
server.start(port);
}
void void
GdbRsp::start(const uint port) { GdbRsp::start() {
server.start(port);
server.run(); server.run();
attach(); attach();

View File

@@ -4,9 +4,9 @@
namespace matar { namespace matar {
class GdbRsp { class GdbRsp {
public: public:
GdbRsp(std::shared_ptr<Cpu> cpu); GdbRsp(std::shared_ptr<Cpu> cpu, uint port);
~GdbRsp() = default; ~GdbRsp() = default;
void start(const uint port); void start();
void attach(); void attach();
void satisfy_client(); void satisfy_client();
void step(); void step();