Support dump generation for GDB mode

This commit is contained in:
momo5502
2025-03-23 13:17:23 +01:00
parent 2bc3cda062
commit 7c3f848b36
8 changed files with 54 additions and 20 deletions

View File

@@ -23,8 +23,10 @@ namespace gdb_stub
}
}
connection_handler::connection_handler(network::tcp_client_socket& client)
: client_(client)
connection_handler::connection_handler(network::tcp_client_socket& client,
utils::optional_function<bool()> should_stop)
: should_stop_(std::move(should_stop)),
client_(client)
{
this->client_.set_blocking(false);
@@ -48,7 +50,7 @@ namespace gdb_stub
std::optional<std::string> connection_handler::get_packet()
{
while (this->client_.is_valid() && !this->processor_.has_packet())
while (this->client_.is_valid() && !this->processor_.has_packet() && !this->should_stop_())
{
if (!read_from_socket(this->processor_, this->client_))
{