gdb/gdbserver/win32-arm-low.c - gdb
Global variables defined
Functions defined
Macros defined
Source code
- #include "server.h"
- #include "win32-low.h"
- #ifndef CONTEXT_FLOATING_POINT
- #define CONTEXT_FLOATING_POINT 0
- #endif
- void init_registers_arm (void);
- extern const struct target_desc *tdesc_arm;
- static void
- arm_get_thread_context (win32_thread_info *th)
- {
- th->context.ContextFlags = \
- CONTEXT_FULL | \
- CONTEXT_FLOATING_POINT;
- GetThreadContext (th->h, &th->context);
- }
- #define context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
- static const int mappings[] = {
- context_offset (R0),
- context_offset (R1),
- context_offset (R2),
- context_offset (R3),
- context_offset (R4),
- context_offset (R5),
- context_offset (R6),
- context_offset (R7),
- context_offset (R8),
- context_offset (R9),
- context_offset (R10),
- context_offset (R11),
- context_offset (R12),
- context_offset (Sp),
- context_offset (Lr),
- context_offset (Pc),
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- -1,
- context_offset (Psr),
- };
- #undef context_offset
- static char *
- regptr (CONTEXT* c, int r)
- {
- if (mappings[r] < 0)
- {
- static ULONG zero;
-
- zero = 0;
- return (char *) &zero;
- }
- else
- return (char *) c + mappings[r];
- }
- static void
- arm_fetch_inferior_register (struct regcache *regcache,
- win32_thread_info *th, int r)
- {
- char *context_offset = regptr (&th->context, r);
- supply_register (regcache, r, context_offset);
- }
- static void
- arm_store_inferior_register (struct regcache *regcache,
- win32_thread_info *th, int r)
- {
- collect_register (regcache, r, regptr (&th->context, r));
- }
- static void
- arm_arch_setup (void)
- {
- init_registers_arm ();
- win32_tdesc = tdesc_arm;
- }
- static const unsigned long arm_wince_breakpoint = 0xe6000010;
- #define arm_wince_breakpoint_len 4
- struct win32_target_ops the_low_target = {
- arm_arch_setup,
- sizeof (mappings) / sizeof (mappings[0]),
- NULL,
- arm_get_thread_context,
- NULL,
- NULL,
- arm_fetch_inferior_register,
- arm_store_inferior_register,
- NULL,
- (const unsigned char *) &arm_wince_breakpoint,
- arm_wince_breakpoint_len,
-
- NULL,
- NULL,
- NULL,
- NULL,
- NULL
- };