diff options
author | Cyrille Bagard <nocbos@gmail.com> | 2015-01-24 11:19:32 (GMT) |
---|---|---|
committer | Cyrille Bagard <nocbos@gmail.com> | 2015-01-24 11:19:32 (GMT) |
commit | 141d2f0fbb2ce3b4ddf85383c55b891fd59dc598 (patch) | |
tree | 085fa1a20d77f86825e1a6f4215b1ffd8fd961e8 /src/arch/arm/v7/context.c | |
parent | 3df9f6dc8548b0562312036abfbfcf9850a81041 (diff) |
Introduced conditional calls in instruction definition rules.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@459 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
Diffstat (limited to 'src/arch/arm/v7/context.c')
-rw-r--r-- | src/arch/arm/v7/context.c | 48 |
1 files changed, 47 insertions, 1 deletions
diff --git a/src/arch/arm/v7/context.c b/src/arch/arm/v7/context.c index 41ffd29..c29794d 100644 --- a/src/arch/arm/v7/context.c +++ b/src/arch/arm/v7/context.c @@ -24,6 +24,9 @@ #include "context.h" +#include <assert.h> + + #include "../context-int.h" @@ -208,7 +211,7 @@ static void g_armv7_context_push_drop_point(GArmV7Context *ctx, virt_t addr) { - printf("PUSH v7 !!\n"); + printf("PUSH v7 !! 0x%08x\n", addr); @@ -224,6 +227,47 @@ static void g_armv7_context_push_drop_point(GArmV7Context *ctx, virt_t addr) } +/****************************************************************************** +* * +* Paramètres : ctx = contexte de désassemblage à compléter. * +* addr = adresse d'un nouveau point de départ à traiter. * +* * +* Description : Ajoute une adresse virtuelle comme point de départ de code. * +* * +* Retour : - * +* * +* Remarques : - * +* * +******************************************************************************/ + +void g_armv7_context_push_drop_point_ext(GArmV7Context *ctx, virt_t addr, ArmV7InstrSet marker) +{ + + + printf("PUSH v7 !! 0x%08x\n", (unsigned int)addr); + + + + if (addr & 0x1) + { + addr -= 0x1; + assert(marker == AV7IS_THUMB); + } + + + g_armv7_context_define_encoding(ctx, addr, marker); + + G_PROC_CONTEXT_CLASS(g_armv7_context_parent_class)->push_point(G_PROC_CONTEXT(ctx), addr); + +} + + + + + + + + /****************************************************************************** @@ -242,6 +286,8 @@ static void g_armv7_context_push_drop_point(GArmV7Context *ctx, virt_t addr) void g_armv7_context_define_encoding(GArmV7Context *ctx, virt_t addr, ArmV7InstrSet marker) { + printf(" --encoding-- @ 0x%08llx -> %d\n", (unsigned long long)addr, (int)marker); + _g_arm_context_define_encoding(G_ARM_CONTEXT(ctx), addr, marker); } |