gdb/
[deliverable/binutils-gdb.git] / gdb / gdbserver / win32-arm-low.c
1 /* Copyright (C) 2007 Free Software Foundation, Inc.
2
3 This file is part of GDB.
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 Boston, MA 02110-1301, USA. */
19
20 #include "server.h"
21 #include "win32-low.h"
22
23 /* Fetch register(s) from gdbserver regcache data. */
24 static void
25 do_fetch_inferior_registers (win32_thread_info *th, int r)
26 {
27 char *context_offset = regptr (&th->context, r);
28 supply_register (r, context_offset);
29 }
30
31 #define context_offset(x) ((int)&(((CONTEXT *)NULL)->x))
32 static const int mappings[] = {
33 context_offset (R0),
34 context_offset (R1),
35 context_offset (R2),
36 context_offset (R3),
37 context_offset (R4),
38 context_offset (R5),
39 context_offset (R6),
40 context_offset (R7),
41 context_offset (R8),
42 context_offset (R9),
43 context_offset (R10),
44 context_offset (R11),
45 context_offset (R12),
46 context_offset (Sp),
47 context_offset (Lr),
48 context_offset (Pc),
49 -1, /* f0 */
50 -1, /* f1 */
51 -1, /* f2 */
52 -1, /* f3 */
53 -1, /* f4 */
54 -1, /* f5 */
55 -1, /* f6 */
56 -1, /* f7 */
57 -1, /* fps */
58 context_offset (Psr),
59 };
60 #undef context_offset
61
62 static const unsigned char arm_wince_le_breakpoint[] =
63 { 0x10, 0x00, 0x00, 0xe6 };
64
65 struct win32_target_ops the_low_target = {
66 mappings,
67 sizeof (mappings) / sizeof (mappings[0]),
68 NULL, /* initial_stuff */
69 NULL, /* store_debug_registers */
70 NULL, /* load_debug_registers */
71 do_fetch_inferior_registers,
72 NULL, /* single_step */
73 arm_wince_le_breakpoint,
74 sizeof (arm_wince_le_breakpoint) / sizeof (arm_wince_le_breakpoint[0]),
75 "arm" /* arch_string */
76 };
This page took 0.045714 seconds and 4 git commands to generate.