ReactOS  0.4.14-dev-50-g13bb5e2
cpu_arm.c File Reference
#include <assert.h>
#include "ntstatus.h"
#include "dbghelp_private.h"
#include "winternl.h"
#include "wine/debug.h"
Include dependency graph for cpu_arm.c:

Go to the source code of this file.

Macros

#define WIN32_NO_STATUS
 

Functions

 WINE_DEFAULT_DEBUG_CHANNEL (dbghelp)
 
static BOOL arm_get_addr (HANDLE hThread, const CONTEXT *ctx, enum cpu_addr ca, ADDRESS64 *addr)
 
static BOOL arm_stack_walk (struct cpu_stack_walk *csw, LPSTACKFRAME64 frame, CONTEXT *context)
 
static unsigned arm_map_dwarf_register (unsigned regno, BOOL eh_frame)
 
static voidarm_fetch_context_reg (CONTEXT *ctx, unsigned regno, unsigned *size)
 
static const chararm_fetch_regname (unsigned regno)
 
static BOOL arm_fetch_minidump_thread (struct dump_context *dc, unsigned index, unsigned flags, const CONTEXT *ctx)
 
static BOOL arm_fetch_minidump_module (struct dump_context *dc, unsigned index, unsigned flags)
 

Variables

DECLSPEC_HIDDEN struct cpu cpu_arm
 

Macro Definition Documentation

◆ WIN32_NO_STATUS

#define WIN32_NO_STATUS

Definition at line 25 of file cpu_arm.c.

Function Documentation

◆ arm_fetch_context_reg()

static void* arm_fetch_context_reg ( CONTEXT ctx,
unsigned  regno,
unsigned *  size 
)
static

Definition at line 170 of file cpu_arm.c.

171 {
172 #ifdef __arm__
173  switch (regno)
174  {
175  case CV_ARM_R0 + 0: *size = sizeof(ctx->R0); return &ctx->R0;
176  case CV_ARM_R0 + 1: *size = sizeof(ctx->R1); return &ctx->R1;
177  case CV_ARM_R0 + 2: *size = sizeof(ctx->R2); return &ctx->R2;
178  case CV_ARM_R0 + 3: *size = sizeof(ctx->R3); return &ctx->R3;
179  case CV_ARM_R0 + 4: *size = sizeof(ctx->R4); return &ctx->R4;
180  case CV_ARM_R0 + 5: *size = sizeof(ctx->R5); return &ctx->R5;
181  case CV_ARM_R0 + 6: *size = sizeof(ctx->R6); return &ctx->R6;
182  case CV_ARM_R0 + 7: *size = sizeof(ctx->R7); return &ctx->R7;
183  case CV_ARM_R0 + 8: *size = sizeof(ctx->R8); return &ctx->R8;
184  case CV_ARM_R0 + 9: *size = sizeof(ctx->R9); return &ctx->R9;
185  case CV_ARM_R0 + 10: *size = sizeof(ctx->R10); return &ctx->R10;
186 #ifdef __REACTOS__
187  case CV_ARM_R0 + 11: *size = sizeof(ctx->R11); return &ctx->R11;
188  case CV_ARM_R0 + 12: *size = sizeof(ctx->R12); return &ctx->R12;
189 #else
190  case CV_ARM_R0 + 11: *size = sizeof(ctx->Fp); return &ctx->Fp;
191  case CV_ARM_R0 + 12: *size = sizeof(ctx->Ip); return &ctx->Ip;
192 #endif
193 
194  case CV_ARM_SP: *size = sizeof(ctx->Sp); return &ctx->Sp;
195  case CV_ARM_LR: *size = sizeof(ctx->Lr); return &ctx->Lr;
196  case CV_ARM_PC: *size = sizeof(ctx->Pc); return &ctx->Pc;
197  case CV_ARM_CPSR: *size = sizeof(ctx->Cpsr); return &ctx->Cpsr;
198  }
199 #endif
200  FIXME("Unknown register %x\n", regno);
201  return NULL;
202 }
ULONG R6
Definition: compat.h:341
ULONG R0
Definition: compat.h:335
ULONG R8
Definition: compat.h:343
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416
ULONG R9
Definition: compat.h:344
ULONG R1
Definition: compat.h:336
ULONG R4
Definition: compat.h:339
GLsizeiptr size
Definition: glext.h:5919
ULONG R11
Definition: ke.h:266
ULONG Ip
Definition: compat.h:347
ULONG Cpsr
Definition: compat.h:353
ULONG R5
Definition: compat.h:340
ULONG R7
Definition: compat.h:342
ULONG R12
Definition: ke.h:267
ULONG Fp
Definition: compat.h:346
ULONG Sp
Definition: compat.h:350
ULONG R10
Definition: compat.h:345
ULONG R2
Definition: compat.h:337
ULONG Pc
Definition: compat.h:352
ULONG R3
Definition: compat.h:338
ULONG Lr
Definition: compat.h:351

◆ arm_fetch_minidump_module()

static BOOL arm_fetch_minidump_module ( struct dump_context dc,
unsigned  index,
unsigned  flags 
)
static

Definition at line 245 of file cpu_arm.c.

246 {
247  /* FIXME: actually, we should probably take care of FPO data, unless it's stored in
248  * function table minidump stream
249  */
250  return FALSE;
251 }

◆ arm_fetch_minidump_thread()

static BOOL arm_fetch_minidump_thread ( struct dump_context dc,
unsigned  index,
unsigned  flags,
const CONTEXT ctx 
)
static

Definition at line 231 of file cpu_arm.c.

232 {
234  {
235  /* FIXME: crop values across module boundaries, */
236 #ifdef __arm__
237  ULONG base = ctx->Pc <= 0x80 ? 0 : ctx->Pc - 0x80;
238  minidump_add_memory_block(dc, base, ctx->Pc + 0x80 - base, 0);
239 #endif
240  }
241 
242  return TRUE;
243 }
#define TRUE
Definition: types.h:120
HDC dc
Definition: cylfrac.c:34
void minidump_add_memory_block(struct dump_context *dc, ULONG64 base, ULONG size, ULONG rva) DECLSPEC_HIDDEN
Definition: minidump.c:338
ULONG ContextFlags
Definition: compat.h:331
GLbitfield flags
Definition: glext.h:7161
unsigned int ULONG
Definition: retypes.h:1
ULONG Pc
Definition: compat.h:352

◆ arm_fetch_regname()

static const char* arm_fetch_regname ( unsigned  regno)
static

Definition at line 204 of file cpu_arm.c.

205 {
206  switch (regno)
207  {
208  case CV_ARM_R0 + 0: return "r0";
209  case CV_ARM_R0 + 1: return "r1";
210  case CV_ARM_R0 + 2: return "r2";
211  case CV_ARM_R0 + 3: return "r3";
212  case CV_ARM_R0 + 4: return "r4";
213  case CV_ARM_R0 + 5: return "r5";
214  case CV_ARM_R0 + 6: return "r6";
215  case CV_ARM_R0 + 7: return "r7";
216  case CV_ARM_R0 + 8: return "r8";
217  case CV_ARM_R0 + 9: return "r9";
218  case CV_ARM_R0 + 10: return "r10";
219  case CV_ARM_R0 + 11: return "r11";
220  case CV_ARM_R0 + 12: return "r12";
221 
222  case CV_ARM_SP: return "sp";
223  case CV_ARM_LR: return "lr";
224  case CV_ARM_PC: return "pc";
225  case CV_ARM_CPSR: return "cpsr";
226  }
227  FIXME("Unknown register %x\n", regno);
228  return NULL;
229 }
#define FIXME(fmt,...)
Definition: debug.h:110
smooth NULL
Definition: ftsmooth.c:416

◆ arm_get_addr()

static BOOL arm_get_addr ( HANDLE  hThread,
const CONTEXT ctx,
enum cpu_addr  ca,
ADDRESS64 addr 
)
static

Definition at line 32 of file cpu_arm.c.

34 {
35  addr->Mode = AddrModeFlat;
36  addr->Segment = 0; /* don't need segment */
37  switch (ca)
38  {
39 #ifdef __arm__
40  case cpu_addr_pc: addr->Offset = ctx->Pc; return TRUE;
41  case cpu_addr_stack: addr->Offset = ctx->Sp; return TRUE;
42 #ifdef __REACTOS__
43  case cpu_addr_frame: addr->Offset = ctx->R11; return TRUE;
44 #else
45  case cpu_addr_frame: addr->Offset = ctx->Fp; return TRUE;
46 #endif
47 #endif
48  default: addr->Mode = -1;
49  return FALSE;
50  }
51 }
#define TRUE
Definition: types.h:120
ULONG R11
Definition: ke.h:266
GLenum const GLvoid * addr
Definition: glext.h:9621
ULONG Fp
Definition: compat.h:346
ULONG Sp
Definition: compat.h:350
static const WCHAR ca[]
Definition: main.c:457
ULONG Pc
Definition: compat.h:352

◆ arm_map_dwarf_register()

static unsigned arm_map_dwarf_register ( unsigned  regno,
BOOL  eh_frame 
)
static

Definition at line 161 of file cpu_arm.c.

162 {
163  if (regno <= 15) return CV_ARM_R0 + regno;
164  if (regno == 128) return CV_ARM_CPSR;
165 
166  FIXME("Don't know how to map register %d\n", regno);
167  return CV_ARM_NOREG;
168 }
#define FIXME(fmt,...)
Definition: debug.h:110

◆ arm_stack_walk()

static BOOL arm_stack_walk ( struct cpu_stack_walk csw,
LPSTACKFRAME64  frame,
CONTEXT context 
)
static

Definition at line 155 of file cpu_arm.c.

156 {
157  return FALSE;
158 }

◆ WINE_DEFAULT_DEBUG_CHANNEL()

WINE_DEFAULT_DEBUG_CHANNEL ( dbghelp  )

Variable Documentation

◆ cpu_arm

Initial value:
= {
4,
CV_ARM_R0 + 11,
}
static void * arm_fetch_context_reg(CONTEXT *ctx, unsigned regno, unsigned *size)
Definition: cpu_arm.c:170
static unsigned arm_map_dwarf_register(unsigned regno, BOOL eh_frame)
Definition: cpu_arm.c:161
smooth NULL
Definition: ftsmooth.c:416
static const char * arm_fetch_regname(unsigned regno)
Definition: cpu_arm.c:204
static BOOL arm_fetch_minidump_module(struct dump_context *dc, unsigned index, unsigned flags)
Definition: cpu_arm.c:245
static BOOL arm_get_addr(HANDLE hThread, const CONTEXT *ctx, enum cpu_addr ca, ADDRESS64 *addr)
Definition: cpu_arm.c:32
static BOOL arm_fetch_minidump_thread(struct dump_context *dc, unsigned index, unsigned flags, const CONTEXT *ctx)
Definition: cpu_arm.c:231
#define IMAGE_FILE_MACHINE_ARMNT
Definition: compat.h:116
static BOOL arm_stack_walk(struct cpu_stack_walk *csw, LPSTACKFRAME64 frame, CONTEXT *context)
Definition: cpu_arm.c:155

Definition at line 253 of file cpu_arm.c.