OSDN Git Service

* win32-low.c (debug_registers_changed,
[pf3gnuchains/pf3gnuchains3x.git] / gdb / gdbserver / win32-low.h
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   /* The number of target registers.  */
36   int num_regs;
37
38   /* Perform initializations on startup.  */
39   void (*initial_stuff) (void);
40
41   /* Fetch the context from the inferior.  */
42   void (*get_thread_context) (win32_thread_info *th, DEBUG_EVENT *current_event);
43
44   /* Flush the context back to the inferior.  */
45   void (*set_thread_context) (win32_thread_info *th, DEBUG_EVENT *current_event);
46
47   /* Called when a thread was added.  */
48   void (*thread_added) (win32_thread_info *th);
49
50   /* Fetch register from gdbserver regcache data.  */
51   void (*fetch_inferior_register) (win32_thread_info *th, int r);
52
53   /* Store a new register value into the thread context of TH.  */
54   void (*store_inferior_register) (win32_thread_info *th, int r);
55
56   void (*single_step) (win32_thread_info *th);
57
58   const unsigned char *breakpoint;
59   int breakpoint_len;
60
61   /* What string to report to GDB when it asks for the architecture,
62      or NULL not to answer.  */
63   const char *arch_string;
64 };
65
66 extern struct win32_target_ops the_low_target;
67
68 /* Map the Windows error number in ERROR to a locale-dependent error
69    message string and return a pointer to it.  Typically, the values
70    for ERROR come from GetLastError.
71
72    The string pointed to shall not be modified by the application,
73    but may be overwritten by a subsequent call to strwinerror
74
75    The strwinerror function does not change the current setting
76    of GetLastError.  */
77 extern char * strwinerror (DWORD error);
78
79 /* in wincecompat.c */
80
81 extern void to_back_slashes (char *);