gdb/gdbserver/win32-low.h - gdb

Data types defined

Source code

  1. /* Internal interfaces for the Win32 specific target code for gdbserver.
  2.    Copyright (C) 2007-2015 Free Software Foundation, Inc.

  3.    This file is part of GDB.

  4.    This program is free software; you can redistribute it and/or modify
  5.    it under the terms of the GNU General Public License as published by
  6.    the Free Software Foundation; either version 3 of the License, or
  7.    (at your option) any later version.

  8.    This program is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  11.    GNU General Public License for more details.

  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */

  14. #include <windows.h>

  15. struct target_desc;

  16. /* The inferior's target description.  This is a global because the
  17.    Windows ports support neither bi-arch nor multi-process.  */
  18. extern const struct target_desc *win32_tdesc;

  19. /* Thread information structure used to track extra information about
  20.    each thread.  */
  21. typedef struct win32_thread_info
  22. {
  23.   /* The Win32 thread identifier.  */
  24.   DWORD tid;

  25.   /* The handle to the thread.  */
  26.   HANDLE h;

  27.   /* Thread Information Block address.  */
  28.   CORE_ADDR thread_local_base;

  29.   /* Non zero if SuspendThread was called on this thread.  */
  30.   int suspended;

  31. #ifdef _WIN32_WCE
  32.   /* The context as retrieved right after suspending the thread. */
  33.   CONTEXT base_context;
  34. #endif

  35.   /* The context of the thread, including any manipulations.  */
  36.   CONTEXT context;

  37.   /* Whether debug registers changed since we last set CONTEXT back to
  38.      the thread.  */
  39.   int debug_registers_changed;
  40. } win32_thread_info;

  41. struct win32_target_ops
  42. {
  43.   /* Architecture-specific setup.  */
  44.   void (*arch_setup) (void);

  45.   /* The number of target registers.  */
  46.   int num_regs;

  47.   /* Perform initializations on startup.  */
  48.   void (*initial_stuff) (void);

  49.   /* Fetch the context from the inferior.  */
  50.   void (*get_thread_context) (win32_thread_info *th);

  51.   /* Called just before resuming the thread.  */
  52.   void (*prepare_to_resume) (win32_thread_info *th);

  53.   /* Called when a thread was added.  */
  54.   void (*thread_added) (win32_thread_info *th);

  55.   /* Fetch register from gdbserver regcache data.  */
  56.   void (*fetch_inferior_register) (struct regcache *regcache,
  57.                                    win32_thread_info *th, int r);

  58.   /* Store a new register value into the thread context of TH.  */
  59.   void (*store_inferior_register) (struct regcache *regcache,
  60.                                    win32_thread_info *th, int r);

  61.   void (*single_step) (win32_thread_info *th);

  62.   const unsigned char *breakpoint;
  63.   int breakpoint_len;

  64.   /* Breakpoint/Watchpoint related functions.  See target.h for comments.  */
  65.   int (*supports_z_point_type) (char z_type);
  66.   int (*insert_point) (enum raw_bkpt_type type, CORE_ADDR addr,
  67.                        int size, struct raw_breakpoint *bp);
  68.   int (*remove_point) (enum raw_bkpt_type type, CORE_ADDR addr,
  69.                        int size, struct raw_breakpoint *bp);
  70.   int (*stopped_by_watchpoint) (void);
  71.   CORE_ADDR (*stopped_data_address) (void);
  72. };

  73. extern struct win32_target_ops the_low_target;

  74. /* Retrieve the context for this thread, if not already retrieved.  */
  75. extern void win32_require_context (win32_thread_info *th);

  76. /* Map the Windows error number in ERROR to a locale-dependent error
  77.    message string and return a pointer to it.  Typically, the values
  78.    for ERROR come from GetLastError.

  79.    The string pointed to shall not be modified by the application,
  80.    but may be overwritten by a subsequent call to strwinerror

  81.    The strwinerror function does not change the current setting
  82.    of GetLastError.  */
  83. extern char * strwinerror (DWORD error);

  84. /* in wincecompat.c */

  85. extern void to_back_slashes (char *);