2022-12-04 11:03:45 +00:00
|
|
|
// SPDX-FileCopyrightText: 2019-2022 Connor McLaughlin <stenzek@gmail.com> and contributors.
|
|
|
|
// SPDX-License-Identifier: (GPL-3.0 OR CC-BY-NC-ND-4.0)
|
|
|
|
|
2020-12-17 17:32:29 +00:00
|
|
|
#pragma once
|
|
|
|
#include <QtCore/QThread>
|
|
|
|
#include <QtNetwork/QTcpSocket>
|
|
|
|
|
2023-02-25 16:27:03 +00:00
|
|
|
class GDBServer;
|
|
|
|
|
|
|
|
class GDBConnection : public QTcpSocket
|
2020-12-17 17:32:29 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2023-02-25 16:27:03 +00:00
|
|
|
GDBConnection(GDBServer *parent, intptr_t descriptor);
|
2020-12-17 17:32:29 +00:00
|
|
|
|
|
|
|
public Q_SLOTS:
|
|
|
|
void gotDisconnected();
|
|
|
|
void receivedData();
|
2022-07-11 13:03:29 +00:00
|
|
|
void onEmulationPaused();
|
|
|
|
void onEmulationResumed();
|
2020-12-17 17:32:29 +00:00
|
|
|
|
|
|
|
private:
|
|
|
|
void writePacket(std::string_view data);
|
|
|
|
|
2023-02-25 16:27:03 +00:00
|
|
|
intptr_t m_descriptor;
|
2020-12-17 17:32:29 +00:00
|
|
|
std::string m_readBuffer;
|
|
|
|
bool m_seen_resume;
|
|
|
|
};
|