diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2012-02-17 17:51:06 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2012-02-17 17:51:06 (GMT) |
commit | 73605bffb935fc51a52be1936426211e31dd898a (patch) | |
tree | 094d72321011baae0d5054e06906e9d006249c3b /src/debug/jdwp/sets/thread.c | |
parent | 98a3c749a15349b874dcef0ce3a43ebff651d95a (diff) |
Listed all running threads using Python.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@234 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/debug/jdwp/sets/thread.c')
-rw-r--r-- | src/debug/jdwp/sets/thread.c | 116 |
1 files changed, 116 insertions, 0 deletions
diff --git a/src/debug/jdwp/sets/thread.c b/src/debug/jdwp/sets/thread.c new file mode 100644 index 0000000..9391ff6 --- /dev/null +++ b/src/debug/jdwp/sets/thread.c @@ -0,0 +1,116 @@ + +/* OpenIDA - Outil d'analyse de fichiers binaires + * thread.c - interactions avec les différents threads + * + * Copyright (C) 2012 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/>. + */ + + +#include "thread.h" + + +#include <string.h> + + +#include "../misc/id.h" +#include "../misc/types.h" +#include "../../../common/endianness.h" + + + +/****************************************************************************** +* * +* Paramètres : req = structure de réponse à constituer. * +* sizes = références pour la valeur des tailles dynamiques. * +* blob = ensemble de données binaires brutes. [OUT] * +* len = quantité de données disponibles, puis écrites. [OUT] * +* * +* Description : Prépare une requête demandant le nom d'un thread. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool set_jdwp_thread_name(const jdwp_cmd_thread_name_request *req, const jdwp_cmd_vm_id_sizes_reply *sizes, bin_t *blob, off_t *len) +{ + bool result; /* Bilan à retourner */ + off_t pos; /* Tête de lecture */ + + pos = 0; + memset(blob, 0, sizeof(jdwp_cmd_thread_name_request)); + + result = set_jdwp_thread_id(&req->id, sizes, blob, &pos, *len); + if (!result) return false; + + *len = pos; + + return true; + +} + + +/****************************************************************************** +* * +* Paramètres : blob = ensemble de données binaires brutes. * +* len = quantité de données valides. * +* sizes = références pour la valeur des tailles dynamiques. * +* reply = structure de réponse à constituer. [OUT] * +* * +* Description : Reconstitue une réponse fournissant le nom d'un thread. * +* * +* Retour : Bilan de l'opération. * +* * +* Remarques : - * +* * +******************************************************************************/ + +bool get_jdwp_thread_name(const bin_t *blob, off_t len, const jdwp_cmd_vm_id_sizes_reply *sizes, jdwp_cmd_thread_name_reply *reply) +{ + bool result; /* Bilan à retourner */ + off_t pos; /* Tête de lecture */ + + pos = 0; + memset(reply, 0, sizeof(jdwp_cmd_vm_version_reply)); + + result = get_jdwp_string(blob, &pos, len, &reply->name); + if (!result) return false; + + return true; + +} + + +/****************************************************************************** +* * +* Paramètres : reply = structure de réponse à supprimer de la mémoire. * +* * +* Description : Libère le nom donné à un thread. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void free_jdwp_thread_name_reply(jdwp_cmd_thread_name_reply *reply) +{ + free_jdwp_string(&reply->name); + +} |