[4/7] dbghelp: Implement sparc_fetch_context_reg
André Hentschel
nerv at dawncrow.de
Wed Nov 23 15:00:00 CST 2011
---
dlls/dbghelp/cpu_sparc.c | 46 +++++++++++++++++++++++++++++++++++++++++++++-
1 files changed, 45 insertions(+), 1 deletions(-)
diff --git a/dlls/dbghelp/cpu_sparc.c b/dlls/dbghelp/cpu_sparc.c
index 0a0ece6..d57a7a0 100644
--- a/dlls/dbghelp/cpu_sparc.c
+++ b/dlls/dbghelp/cpu_sparc.c
@@ -70,7 +70,51 @@ static unsigned sparc_map_dwarf_register(unsigned regno)
static void* sparc_fetch_context_reg(CONTEXT* ctx, unsigned regno, unsigned* size)
{
- FIXME("not done for Sparc\n");
+#ifdef __sparc__
+ switch (regno)
+ {
+ case CV_SPARC_G0 + 0: *size = sizeof(ctx->g0); return &ctx->g0;
+ case CV_SPARC_G0 + 1: *size = sizeof(ctx->g1); return &ctx->g1;
+ case CV_SPARC_G0 + 2: *size = sizeof(ctx->g2); return &ctx->g2;
+ case CV_SPARC_G0 + 3: *size = sizeof(ctx->g3); return &ctx->g3;
+ case CV_SPARC_G0 + 4: *size = sizeof(ctx->g4); return &ctx->g4;
+ case CV_SPARC_G0 + 5: *size = sizeof(ctx->g5); return &ctx->g5;
+ case CV_SPARC_G0 + 6: *size = sizeof(ctx->g6); return &ctx->g6;
+ case CV_SPARC_G0 + 7: *size = sizeof(ctx->g7); return &ctx->g7;
+ case CV_SPARC_O0 + 0: *size = sizeof(ctx->o0); return &ctx->o0;
+ case CV_SPARC_O0 + 1: *size = sizeof(ctx->o1); return &ctx->o1;
+ case CV_SPARC_O0 + 2: *size = sizeof(ctx->o2); return &ctx->o2;
+ case CV_SPARC_O0 + 3: *size = sizeof(ctx->o3); return &ctx->o3;
+ case CV_SPARC_O0 + 4: *size = sizeof(ctx->o4); return &ctx->o4;
+ case CV_SPARC_O0 + 5: *size = sizeof(ctx->o5); return &ctx->o5;
+ case CV_SPARC_O0 + 6: *size = sizeof(ctx->o6); return &ctx->o6;
+ case CV_SPARC_O0 + 7: *size = sizeof(ctx->o7); return &ctx->o7;
+ case CV_SPARC_L0 + 0: *size = sizeof(ctx->l0); return &ctx->l0;
+ case CV_SPARC_L0 + 1: *size = sizeof(ctx->l1); return &ctx->l1;
+ case CV_SPARC_L0 + 2: *size = sizeof(ctx->l2); return &ctx->l2;
+ case CV_SPARC_L0 + 3: *size = sizeof(ctx->l3); return &ctx->l3;
+ case CV_SPARC_L0 + 4: *size = sizeof(ctx->l4); return &ctx->l4;
+ case CV_SPARC_L0 + 5: *size = sizeof(ctx->l5); return &ctx->l5;
+ case CV_SPARC_L0 + 6: *size = sizeof(ctx->l6); return &ctx->l6;
+ case CV_SPARC_L0 + 7: *size = sizeof(ctx->l7); return &ctx->l7;
+ case CV_SPARC_I0 + 0: *size = sizeof(ctx->i0); return &ctx->i0;
+ case CV_SPARC_I0 + 1: *size = sizeof(ctx->i1); return &ctx->i1;
+ case CV_SPARC_I0 + 2: *size = sizeof(ctx->i2); return &ctx->i2;
+ case CV_SPARC_I0 + 3: *size = sizeof(ctx->i3); return &ctx->i3;
+ case CV_SPARC_I0 + 4: *size = sizeof(ctx->i4); return &ctx->i4;
+ case CV_SPARC_I0 + 5: *size = sizeof(ctx->i5); return &ctx->i5;
+ case CV_SPARC_I0 + 6: *size = sizeof(ctx->i6); return &ctx->i6;
+ case CV_SPARC_I0 + 7: *size = sizeof(ctx->i7); return &ctx->i7;
+
+ case CV_SPARC_PSR: *size = sizeof(ctx->psr); return &ctx->psr;
+ case CV_SPARC_PC: *size = sizeof(ctx->pc); return &ctx->pc;
+ case CV_SPARC_NPC: *size = sizeof(ctx->npc); return &ctx->npc;
+ case CV_SPARC_Y: *size = sizeof(ctx->y); return &ctx->y;
+ case CV_SPARC_WIM: *size = sizeof(ctx->wim); return &ctx->wim;
+ case CV_SPARC_TBR: *size = sizeof(ctx->tbr); return &ctx->tbr;
+ }
+#endif
+ FIXME("Unknown register %x\n", regno);
return NULL;
}
--
Best Regards, André Hentschel
More information about the wine-patches
mailing list