1 /* Internal interfaces for the Win32 specific target code for gdbserver.
2 Copyright (C) 2007-2014 Free Software Foundation, Inc.
4 This file is part of GDB.
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 3 of the License, or
9 (at your option) any later version.
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.
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
23 /* The inferior's target description. This is a global because the
24 Windows ports support neither bi-arch nor multi-process. */
25 extern const struct target_desc *win32_tdesc;
27 /* Thread information structure used to track extra information about
29 typedef struct win32_thread_info
31 /* The Win32 thread identifier. */
34 /* The handle to the thread. */
37 /* Thread Information Block address. */
38 CORE_ADDR thread_local_base;
40 /* Non zero if SuspendThread was called on this thread. */
44 /* The context as retrieved right after suspending the thread. */
48 /* The context of the thread, including any manipulations. */
52 struct win32_target_ops
54 /* Architecture-specific setup. */
55 void (*arch_setup) (void);
57 /* The number of target registers. */
60 /* Perform initializations on startup. */
61 void (*initial_stuff) (void);
63 /* Fetch the context from the inferior. */
64 void (*get_thread_context) (win32_thread_info *th,
65 DEBUG_EVENT *current_event);
67 /* Flush the context back to the inferior. */
68 void (*set_thread_context) (win32_thread_info *th,
69 DEBUG_EVENT *current_event);
71 /* Called when a thread was added. */
72 void (*thread_added) (win32_thread_info *th);
74 /* Fetch register from gdbserver regcache data. */
75 void (*fetch_inferior_register) (struct regcache *regcache,
76 win32_thread_info *th, int r);
78 /* Store a new register value into the thread context of TH. */
79 void (*store_inferior_register) (struct regcache *regcache,
80 win32_thread_info *th, int r);
82 void (*single_step) (win32_thread_info *th);
84 const unsigned char *breakpoint;
87 /* Breakpoint/Watchpoint related functions. See target.h for comments. */
88 int (*supports_z_point_type) (char z_type);
89 int (*insert_point) (enum raw_bkpt_type type, CORE_ADDR addr,
90 int size, struct raw_breakpoint *bp);
91 int (*remove_point) (enum raw_bkpt_type type, CORE_ADDR addr,
92 int size, struct raw_breakpoint *bp);
93 int (*stopped_by_watchpoint) (void);
94 CORE_ADDR (*stopped_data_address) (void);
97 extern struct win32_target_ops the_low_target;
99 /* Map the Windows error number in ERROR to a locale-dependent error
100 message string and return a pointer to it. Typically, the values
101 for ERROR come from GetLastError.
103 The string pointed to shall not be modified by the application,
104 but may be overwritten by a subsequent call to strwinerror
106 The strwinerror function does not change the current setting
108 extern char * strwinerror (DWORD error);
110 /* in wincecompat.c */
112 extern void to_back_slashes (char *);