summaryrefslogtreecommitdiff
path: root/src/arch/arm
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2016-05-24 21:45:53 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2016-05-24 21:46:04 (GMT)
commit0e2849345be5018152d60b5aa27eebb2de75e1df (patch)
tree524c6f7e5a5a32fa65427c44d8baa2e6204eb732 /src/arch/arm
parent3a77653d347c8e60a1c80bd4d57a4fd5e317490f (diff)
Attached priority levels with disassembly starting points.
Diffstat (limited to 'src/arch/arm')
-rw-r--r--src/arch/arm/v7/context.c7
-rw-r--r--src/arch/arm/v7/fetch.c19
2 files changed, 16 insertions, 10 deletions
diff --git a/src/arch/arm/v7/context.c b/src/arch/arm/v7/context.c
index 446a972..659fdd1 100644
--- a/src/arch/arm/v7/context.c
+++ b/src/arch/arm/v7/context.c
@@ -63,7 +63,7 @@ static void g_armv7_context_dispose(GArmV7Context *);
static void g_armv7_context_finalize(GArmV7Context *);
/* Ajoute une adresse virtuelle comme point de départ de code. */
-static void g_armv7_context_push_drop_point(GArmV7Context *, unsigned int, virt_t, va_list);
+static void g_armv7_context_push_drop_point(GArmV7Context *, DisassPriorityLevel, virt_t, va_list);
@@ -209,13 +209,14 @@ GArmV7Context *g_armv7_context_new(void)
* *
******************************************************************************/
-static void g_armv7_context_push_drop_point(GArmV7Context *ctx, unsigned int level, virt_t addr, va_list ap)
+static void g_armv7_context_push_drop_point(GArmV7Context *ctx, DisassPriorityLevel level, virt_t addr, va_list ap)
{
ArmV7InstrSet marker; /* Type de jeu d'instructions */
switch (level)
{
- case 0:
+ case DPL_ENTRY_POINT:
+ case DPL_SYMBOL:
if (addr & 0x1)
{
diff --git a/src/arch/arm/v7/fetch.c b/src/arch/arm/v7/fetch.c
index 206e6e6..67129b2 100644
--- a/src/arch/arm/v7/fetch.c
+++ b/src/arch/arm/v7/fetch.c
@@ -99,7 +99,7 @@ void help_fetching_with_instruction_b_with_orig(GArchInstruction *instr, GArchPr
target = pc + offset;
//g_armv7_context_define_encoding(context, target, iset);
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 3, target, iset);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, target, iset);
}
@@ -168,7 +168,7 @@ void help_fetching_with_instruction_bl_with_orig(GArchInstruction *instr, GArchP
target = pc + offset;
//g_armv7_context_define_encoding(context, target, iset);
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 3, target, iset);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, target, iset);
}
@@ -227,7 +227,7 @@ void help_fetching_with_instruction_blx_with_dest(GArchInstruction *instr, GArch
target = pc + offset;
//g_armv7_context_define_encoding(context, target, iset);
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 3, target, iset);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, target, iset);
}
@@ -280,12 +280,12 @@ void help_fetching_with_instruction_bx_with_orig(GArchInstruction *instr, GArchP
case AV7IS_ARM:
pc += 8;
//g_armv7_context_define_encoding(context,
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 3, pc, AV7IS_THUMB);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, pc, AV7IS_THUMB);
break;
case AV7IS_THUMB:
pc += 4;
//g_armv7_context_define_encoding(context,
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 3, pc, AV7IS_ARM);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, pc, AV7IS_ARM);
break;
default:
assert(0);
@@ -342,7 +342,7 @@ void help_fetching_with_instruction_cb_n_z(GArchInstruction *instr, GArchProcess
target = pc + offset;
//g_armv7_context_define_encoding(context, target, AV7IS_THUMB);
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 3, target, AV7IS_THUMB);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, target, AV7IS_THUMB);
}
@@ -518,8 +518,13 @@ void help_fetching_with_instruction_ldr_literal_with_orig(GArchInstruction *inst
//target = pc + offset;
+ if (target & 0x1)
+ iset = AV7IS_THUMB;
+ //else
+ // iset = AV7IS_ARM;
+
//g_armv7_context_define_encoding(context, target, AV7IS_THUMB);
- g_proc_context_push_drop_point(G_PROC_CONTEXT(context), 0/*FIXME*/, target);
+ g_proc_context_push_drop_point(G_PROC_CONTEXT(context), DPL_OTHER, target, iset);
//exit(0);