diff options
Diffstat (limited to 'src/debug/jdwp/tcp.c')
-rw-r--r-- | src/debug/jdwp/tcp.c | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/src/debug/jdwp/tcp.c b/src/debug/jdwp/tcp.c index 554d5b6..4f56351 100644 --- a/src/debug/jdwp/tcp.c +++ b/src/debug/jdwp/tcp.c @@ -82,6 +82,9 @@ static bool g_jdwp_tcp_client_send_packet(GJdwpTcpClient *, const GJdwpPacket *) /* Réceptionne un paquet de données d'un serveur de débogage. */ static bool g_jdwp_tcp_client_recv_packet(GJdwpTcpClient *, GJdwpPacket *); +/* Libère le contenu alloué d'un paquet de débogage. */ +static void g_jdwp_tcp_client_free_packet(GJdwpTcpClient *, GJdwpPacket *); + /* Indique le type défini pour un flux de communication TCP avec un serveur JDWP. */ @@ -129,6 +132,7 @@ static void g_jdwp_tcp_client_init(GJdwpTcpClient *client) stream->poll = (debug_poll_fc)g_jdwp_tcp_client_poll; stream->send_packet = (debug_pkt_op_fc)g_jdwp_tcp_client_send_packet; stream->recv_packet = (debug_pkt_op_fc)g_jdwp_tcp_client_recv_packet; + stream->free_packet = (debug_free_pkt_fc)g_jdwp_tcp_client_free_packet; stream->pkt_type = G_TYPE_JDWP_PACKET; @@ -282,6 +286,14 @@ static bool g_jdwp_tcp_client_send_packet(GJdwpTcpClient *client, const GJdwpPac int iovcnt; /* Quantité de champs valides */ int i; /* Boucle de parcours */ +#if 0 + jdwp_header *header; /* En-tête à reconstituer */ + + header = g_jdwp_packet_get_header(packet); + printf(" <JDWP> send %p :: %u / %hhu.%hhu (%u)\n", packet, header->id, header->set, + header->command, header->length); +#endif + g_debug_packet_vectorize(G_DEBUG_PACKET(packet), iov, &iovcnt); for (i = 0; i < iovcnt; i++) @@ -324,6 +336,8 @@ static bool g_jdwp_tcp_client_recv_packet(GJdwpTcpClient *client, GJdwpPacket *p header = g_jdwp_packet_get_header(packet); length = header->length - sizeof(jdwp_header); + //printf(" <JDWP> recv %p :: %u / %hu (%u)\n", packet, header->id, header->error, header->length); + pblob = g_jdwp_packet_get_pblob(packet); if (recv(client->fd, pblob, length, 0) != length) @@ -332,3 +346,23 @@ static bool g_jdwp_tcp_client_recv_packet(GJdwpTcpClient *client, GJdwpPacket *p return true; } + + +/****************************************************************************** +* * +* Paramètres : client = flux ouvert inutile. * +* packet = zone mémoire à libérer. * +* * +* Description : Libère le contenu alloué d'un paquet de débogage. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +static void g_jdwp_tcp_client_free_packet(GJdwpTcpClient *client, GJdwpPacket *packet) +{ + g_jdwp_packet_free_payload(packet); + +} |