diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2010-12-31 11:49:34 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2010-12-31 11:49:34 (GMT) |
commit | 651c94450df8619c26e26a133289dbaa197616f4 (patch) | |
tree | 1a81a2625687116d205cb5c6583497cb657f8460 /src/debug/jdwp/jdwp_def.h | |
parent | dbec8e8af5f296f0b95cd9c07e7d96b1a4277137 (diff) |
Supported a first basic packet of the Java Debug Wire Protocol.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@204 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/debug/jdwp/jdwp_def.h')
-rw-r--r-- | src/debug/jdwp/jdwp_def.h | 131 |
1 files changed, 131 insertions, 0 deletions
diff --git a/src/debug/jdwp/jdwp_def.h b/src/debug/jdwp/jdwp_def.h new file mode 100644 index 0000000..fc5a8fe --- /dev/null +++ b/src/debug/jdwp/jdwp_def.h @@ -0,0 +1,131 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * jdwp_def.h - transcription du protocole Java Debug Wire Protocol + * + * Copyright (C) 2010 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_JDWP_JDWP_DEF_H +#define _DEBUG_JDWP_JDWP_DEF_H + + +#include <stdint.h> + + + +/** + * Les définitions ci-dessous sont issues des pages Web suivantes : + * - http://download.oracle.com/javase/1.4.2/docs/guide/jpda/jdwp-spec.html + * - http://download.oracle.com/javase/1.4.2/docs/guide/jpda/jdwp/jdwp-protocol.html + */ + + + +/* ---------------------------------------------------------------------------------- */ +/* EN-TETES DE PAQUETS JDWP */ +/* ---------------------------------------------------------------------------------- */ + + +/* En-tête générique */ +typedef struct __attribute__((__packed__)) _jdwp_header +{ + uint32_t length; /* Taille totale du paquet */ + uint32_t id; /* Numéro de séquence */ + uint8_t flags; /* Options diverses */ + + union + { + /* Requête */ + struct + { + uint8_t set; /* Jeu de commandes */ + uint8_t command; /* Identifiant de commande */ + }; + + /* Réponse */ + uint16_t error; /* Numéro d'erreur */ + + }; + +} jdwp_header; + + +#define JDWP_FLAGS_NONE 0x00 +#define JDWP_FLAGS_REPLY 0x80 + + + +/* ---------------------------------------------------------------------------------- */ +/* TYPES DE BASE DIVERS POUR JDWP */ +/* ---------------------------------------------------------------------------------- */ + + + + +/* "string" */ +typedef struct _jdwp_string +{ + uint32_t length; /* Taille de la chaîne */ + char *value; /* Chaîne encodée en UTF-8 */ + +} jdwp_string; + + + + + + +/** + * Jeux de commandes. + */ + +#define JDWP_CST_VIRTUAL_MACHINE 1 + + +/** + * Sous-commandes d'un jeu. + */ + +/* VirtualMachine Command Set */ + +#define JDWP_CMD_VM_VERSION 1 + + +/** + * Charges utiles des paquets. + */ + +/* JDWP_CMD_VM_VERSION */ + +typedef struct _jdwp_cmd_vm_version_reply +{ + jdwp_string description; /* Infos sur la VM */ + uint32_t jdwp_major; /* Numéro majeur de JDWP */ + uint32_t jdwp_minor; /* Numéro mineur de JDWP */ + jdwp_string vm_version; /* Version JRE de la VM ciblée */ + jdwp_string vm_name; /* Nom de la VM */ + +} jdwp_cmd_vm_version_reply; + + + + + + +#endif /* _DEBUG_JDWP_JDWP_DEF_H */ |