]>
Commit | Line | Data |
---|---|---|
68070c10 PA |
1 | /* Internal interfaces for the Win32 specific target code for gdbserver. |
2 | Copyright (C) 2007 Free Software Foundation, Inc. | |
3 | ||
4 | This file is part of GDB. | |
5 | ||
6 | This program is free software; you can redistribute it and/or modify | |
7 | it under the terms of the GNU General Public License as published by | |
8 | the Free Software Foundation; either version 2 of the License, or | |
9 | (at your option) any later version. | |
10 | ||
11 | This program is distributed in the hope that it will be useful, | |
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 | GNU General Public License for more details. | |
15 | ||
16 | You should have received a copy of the GNU General Public License | |
17 | along with this program; if not, write to the Free Software | |
18 | Foundation, Inc., 51 Franklin Street, Fifth Floor, | |
19 | Boston, MA 02110-1301, USA. */ | |
20 | ||
21 | #include <windows.h> | |
22 | ||
23 | /* Thread information structure used to track extra information about | |
24 | each thread. */ | |
25 | typedef struct win32_thread_info | |
26 | { | |
27 | DWORD tid; | |
28 | HANDLE h; | |
29 | int suspend_count; | |
30 | CONTEXT context; | |
31 | } win32_thread_info; | |
32 | ||
33 | struct win32_target_ops | |
34 | { | |
35 | /* An array of offset mappings into a Win32 Context structure. | |
36 | This is a one-to-one mapping which is indexed by gdb's register | |
37 | numbers. It retrieves an offset into the context structure where | |
38 | the 4 byte register is located. | |
39 | An offset value of -1 indicates that Win32 does not provide this | |
40 | register in it's CONTEXT structure. In this case regptr will return | |
41 | a pointer into a dummy register. */ | |
42 | const int *regmap; | |
43 | ||
44 | /* The number of elements of regmap. */ | |
45 | int num_regs; | |
46 | ||
47 | void (*initial_stuff) (void); | |
48 | ||
49 | void (*store_debug_registers) (win32_thread_info *); | |
50 | void (*load_debug_registers) (win32_thread_info *); | |
51 | ||
52 | /* Fetch register(s) from gdbserver regcache data. */ | |
53 | void (*fetch_inferior_registers) (win32_thread_info *th, int r); | |
54 | ||
55 | void (*single_step) (win32_thread_info *th); | |
56 | ||
57 | const unsigned char *breakpoint; | |
58 | int breakpoint_len; | |
59 | ||
60 | /* What string to report to GDB when it asks for the architecture, | |
61 | or NULL not to answer. */ | |
62 | const char *arch_string; | |
63 | }; | |
64 | ||
65 | extern struct win32_target_ops the_low_target; | |
66 | ||
67 | /* in win32-low.c */ | |
68 | ||
69 | /* Return a pointer into a CONTEXT field indexed by gdb register number. | |
70 | Return a pointer to an dummy register holding zero if there is no | |
71 | corresponding CONTEXT field for the given register number. */ | |
72 | extern char * regptr (CONTEXT* c, int r); | |
73 | ||
74 | /* Map the Windows error number in ERROR to a locale-dependent error | |
75 | message string and return a pointer to it. Typically, the values | |
76 | for ERROR come from GetLastError. | |
77 | ||
78 | The string pointed to shall not be modified by the application, | |
79 | but may be overwritten by a subsequent call to strwinerror | |
80 | ||
81 | The strwinerror function does not change the current setting | |
82 | of GetLastError. */ | |
83 | extern char * strwinerror (DWORD error); | |
84 | ||
85 | /* in wincecompat.c */ | |
86 | ||
87 | extern void to_back_slashes (char *); |