diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2009-09-06 15:47:08 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2009-09-06 15:47:08 (GMT) |
commit | 3173b904d5d56a8b5e6bf549c97e3fc49da6c5ba (patch) | |
tree | f5ea74177fcbc05558b85b9f2e6db36aa1ca3b86 /src/debug/remgdb/stream-int.h | |
parent | ef3b996ad359e0da5e93184dab9200fad9105faf (diff) |
Provided some methods to interact with a GDB server.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@110 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/debug/remgdb/stream-int.h')
-rw-r--r-- | src/debug/remgdb/stream-int.h | 74 |
1 files changed, 74 insertions, 0 deletions
diff --git a/src/debug/remgdb/stream-int.h b/src/debug/remgdb/stream-int.h new file mode 100644 index 0000000..bdfe11a --- /dev/null +++ b/src/debug/remgdb/stream-int.h @@ -0,0 +1,74 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * stream-int.h - prototypes internes pour la gestion des connexions aux serveurs GDB. + * + * Copyright (C) 2009 Cyrille Bagard + * + * This file is part of OpenIDA. + * + * OpenIDA is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 3 of the License, or + * (at your option) any later version. + * + * OpenIDA is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with Foobar. If not, see <http://www.gnu.org/licenses/>. + */ + + +#ifndef _DEBUG_REMGDB_STREAM_INT_H +#define _DEBUG_REMGDB_STREAM_INT_H + + +#include "stream.h" + + + +/* Envoie des données à un serveur GDB. */ +typedef bool (* send_gdb_data_fc) (GGdbStream *, const char *, size_t); + +/* Réceptionne un octet de donnée d'un serveur GDB. */ +typedef bool (* recv_gdb_byte_fc) (GGdbStream *, char *); + + +/* Flux de communication avec un serveur GDB (instance) */ +struct _GGdbStream +{ + GObject parent; /* A laisser en premier */ + + int fd; /* Flux ouvert en L./E. */ + + send_gdb_data_fc send_data; /* Envoi d'un paquet GDB */ + recv_gdb_byte_fc recv_byte; /* Réception d'un paquet GDB */ + + GThread *listening; /* Thread pour les réceptions */ + + GGdbPacket *free_packets; /* Liste des disponibles */ + GMutex *free_mutex; /* Accès à la liste */ + + GGdbPacket *recv_packets; /* Liste des paquets reçus */ + GCond *recv_cond; /* Attente de disponibilité */ + GMutex *recv_mutex; /* Accès à la liste */ + +}; + + +/* Flux de communication avec un serveur GDB (classe) */ +struct _GGdbStreamClass +{ + GObjectClass parent; /* A laisser en premier */ + +}; + + +/* Lance l'écoute d'un flux de communication avec GDB. */ +bool g_gdb_stream_listen(GGdbStream *); + + + +#endif /* _DEBUG_REMGDB_STREAM_INT_H */ |