41#include <sys/cygwin.h>
42#include <cygwin/version.h>
52#include "gdbsupport/gdb_obstack.h"
70#include "gdbsupport/gdb_tilde_expand.h"
71#include "gdbsupport/pathstuff.h"
72#include "gdbsupport/gdb_wait.h"
74#include "gdbsupport/symbol.h"
115 void *wow64_dbgbreak =
nullptr;
143 CONTEXT saved_context {};
147 CORE_ADDR cygwin_load_start = 0;
148 CORE_ADDR cygwin_load_end = 0;
158# define __PMAX (MAX_PATH + 1)
159# define STARTUPINFO STARTUPINFOA
161# define __PMAX PATH_MAX
162# define STARTUPINFO STARTUPINFOW
168#ifndef _GNU_H_WINDOWS_H
175#ifndef CONTEXT_EXTENDED_REGISTERS
178#define CONTEXT_EXTENDED_REGISTERS 0
181#define CONTEXT_DEBUGGER_DR CONTEXT_FULL | CONTEXT_FLOATING_POINT \
182 | CONTEXT_SEGMENTS | CONTEXT_DEBUG_REGISTERS \
183 | CONTEXT_EXTENDED_REGISTERS
185#define DR6_CLEAR_VALUE 0xffff0ff0
189#ifndef _CYGWIN_SIGNAL_STRING
190#define _CYGWIN_SIGNAL_STRING "cYgSiGw00f"
193#define CHECK(x) check (x, __FILE__,__LINE__)
194#define DEBUG_EXEC(fmt, ...) \
195 debug_prefixed_printf_cond (debug_exec, "windows exec", fmt, ## __VA_ARGS__)
196#define DEBUG_EVENTS(fmt, ...) \
197 debug_prefixed_printf_cond (debug_events, "windows events", fmt, \
199#define DEBUG_MEM(fmt, ...) \
200 debug_prefixed_printf_cond (debug_memory, "windows mem", fmt, \
202#define DEBUG_EXCEPT(fmt, ...) \
203 debug_prefixed_printf_cond (debug_exceptions, "windows except", fmt, \
215static bool cygwin_exceptions =
false;
230struct xlate_exception
236static const struct xlate_exception xlate[] =
238 {EXCEPTION_ACCESS_VIOLATION, GDB_SIGNAL_SEGV},
239 {STATUS_STACK_OVERFLOW, GDB_SIGNAL_SEGV},
240 {EXCEPTION_BREAKPOINT, GDB_SIGNAL_TRAP},
241 {DBG_CONTROL_C, GDB_SIGNAL_INT},
242 {EXCEPTION_SINGLE_STEP, GDB_SIGNAL_TRAP},
243 {STATUS_FLOAT_DIVIDE_BY_ZERO, GDB_SIGNAL_FPE}
252 void close ()
override;
254 void attach (
const char *,
int)
override;
261 void resume (ptid_t,
int ,
enum gdb_signal)
override;
283 const gdb_byte *writebuf,
284 ULONGEST offset, ULONGEST len,
285 ULONGEST *xfered_len)
override;
289 void kill ()
override;
292 char **,
int)
override;
312 target_wait_flags options);
342 void delete_thread (ptid_t ptid, DWORD exit_code,
bool main_thread_p);
346 bool last_call =
false);
369 std::queue<gdb::function_view<bool ()>>
m_queue;
396 unsigned err = (unsigned) GetLastError ();
397 gdb_printf (
"error return %s:%d was %u: %s\n", file, line,
403 : m_pushed_event (CreateEvent (nullptr, false, false, nullptr)),
404 m_response_event (CreateEvent (nullptr, false, false, nullptr)),
407 HANDLE bg_thread = CreateThread (
nullptr, 64 * 1024,
409 CloseHandle (bg_thread);
420 [] (
int, gdb_client_data)
424 nullptr,
"windows_nat_target");
438 DWORD r = WaitForSingleObject (handle, howlong);
439 if (r == WAIT_OBJECT_0)
441 if (r == WAIT_FAILED)
443 unsigned err = (unsigned) GetLastError ();
444 warning (
"WaitForSingleObject failed (code %u): %s",
448 warning (
"unexpected result from WaitForSingleObject: %u",
467 gdb::function_view<bool ()>
func = std::move (
m_queue.front ());
470 bool should_wait =
func ();
517 if (th->tid == ptid.lwp ())
529 th->reload_context =
true;
532 th->reload_context =
true;
557 gdb_assert (ptid.lwp () != 0);
562 CORE_ADDR base = (CORE_ADDR) (uintptr_t) tlb;
580 ::add_thread (
this, ptid);
611 gdb_assert (ptid.lwp () != 0);
627 (
unsigned) exit_code);
633 [=] (std::unique_ptr<windows_thread_info> &th)
635 return th->tid == id;
659 char *context_ptr = (
char *) &th->
context;
662 context_ptr = (
char *) &th->wow64_context;
707 gdb_assert (
size == 8);
741 __COPY_CONTEXT_SIZE);
804 char *context_ptr = (
char *) &th->
context;
807 context_ptr = (
char *) &th->wow64_context;
843 WIN32_FIND_DATA w32_fd;
844 HANDLE h = FindFirstFile(
name, &w32_fd);
846 if (h == INVALID_HANDLE_VALUE)
852 if (GetCurrentDirectory (MAX_PATH + 1, cwd))
854 p = strrchr (buf,
'\\');
857 SetCurrentDirectory (buf);
858 GetFullPathName (w32_fd.cFileName, MAX_PATH, buf, &p);
859 SetCurrentDirectory (cwd);
862 if (strcasecmp (buf,
"ntdll.dll") == 0)
864 GetSystemDirectory (buf,
sizeof (buf));
865 strcat (buf,
"\\ntdll.dll");
871 if (access (
name, F_OK) != 0)
873 if (strcasecmp (
name,
"ntdll.dll") == 0)
875 GetSystemDirectoryW (buf,
sizeof (buf) /
sizeof (
wchar_t));
876 wcscat (buf,
L"\\ntdll.dll");
890 cygwin_conv_path (CCP_WIN_W_TO_POSIX, buf, cname,
896 char *rname = realpath (
name, NULL);
904 warning (_(
"dll path for \"%s\" too long or inaccessible"),
name);
909 size_t len =
sizeof (
"/cygwin1.dll") - 1;
910 if (so->
name.size () >= len
911 && strcasecmp (so->
name.c_str () + so->
name.size () - len,
912 "/cygwin1.dll") == 0)
914 asection *text = NULL;
921 if (bfd_check_format (abfd.get (), bfd_object))
922 text = bfd_get_section_by_name (abfd.get (),
".text");
933 bfd_section_size (text);
947 host_address_to_string (solib->
load_addr));
961 if (lib.load_addr == lpBaseOfDll)
963 DEBUG_EVENTS (
"Unloading dll \"%s\".", lib.name.c_str ());
982 complaint (_(
"dll starting at %s not found."),
983 host_address_to_string (lpBaseOfDll));
996 uintptr_t event_id = 0;
997 char *endargs = NULL;
1000 error (_(
"signal-event requires an argument (integer event id)"));
1002 event_id = strtoumax (args, &endargs, 10);
1004 if ((errno == ERANGE) || (event_id == 0) || (event_id > UINTPTR_MAX) ||
1005 ((HANDLE) event_id == INVALID_HANDLE_VALUE))
1006 error (_(
"Failed to convert `%s' to event id"), args);
1008 SetEvent ((HANDLE) event_id);
1009 CloseHandle ((HANDLE) event_id);
1020 gdb::unique_xmalloc_ptr<char> s
1022 ((CORE_ADDR) (uintptr_t)
current_event.u.DebugString.lpDebugStringData,
1024 if (s ==
nullptr || !*(s.get ()))
1029 if (!startswith (s.get (),
"cYg"))
1032 char *p = strchr (s.get (),
'\0');
1034 if (p > s.get () && *--p ==
'\n')
1036 warning ((
"%s"), s.get ());
1051 gdb_signal gotasig = gdb_signal_from_host (sig);
1059 retval = strtoul (p, &p, 0);
1062 else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
1063 && ReadProcessMemory (
handle, x,
1065 __COPY_CONTEXT_SIZE, &n)
1066 && n == __COPY_CONTEXT_SIZE)
1085 ret = GetThreadSelectorEntry (thread, sel, &
info);
1090 if (!
info.HighWord.Bits.Pres)
1092 gdb_puts (
"Segment not present\n");
1095 base = (
info.HighWord.Bits.BaseHi << 24) +
1096 (
info.HighWord.Bits.BaseMid << 16)
1098 limit = (
info.HighWord.Bits.LimitHi << 16) +
info.LimitLow;
1099 if (
info.HighWord.Bits.Granularity)
1100 limit = (limit << 12) | 0xfff;
1101 gdb_printf (
"base=0x%08x limit=0x%08x", base, limit);
1102 if (
info.HighWord.Bits.Default_Big)
1106 switch ((
info.HighWord.Bits.Type & 0xf) >> 1)
1109 gdb_puts (
"Data (Read-Only, Exp-up");
1112 gdb_puts (
"Data (Read/Write, Exp-up");
1118 gdb_puts (
"Data (Read/Write, Exp-down");
1121 gdb_puts (
"Code (Exec-Only, N.Conf");
1124 gdb_puts (
"Code (Exec/Read, N.Conf");
1127 gdb_puts (
"Code (Exec-Only, Conf");
1130 gdb_puts (
"Code (Exec/Read, Conf");
1134 (
unsigned long)
info.HighWord.Bits.Type);
1136 if ((
info.HighWord.Bits.Type & 0x1) == 0)
1139 if ((
info.HighWord.Bits.Type & 0x10) == 0)
1142 (
unsigned long)
info.HighWord.Bits.Dpl);
1143 if (
info.HighWord.Bits.Granularity)
1151 DWORD
err = GetLastError ();
1152 if (
err == ERROR_NOT_SUPPORTED)
1155 gdb_printf (
"Invalid selector 0x%x.\n", (
unsigned) sel);
1165 gdb_puts (
"Impossible to display selectors now.\n");
1179 current_windows_thread->wow64_context.SegCs);
1182 current_windows_thread->wow64_context.SegDs);
1185 current_windows_thread->wow64_context.SegEs);
1188 current_windows_thread->wow64_context.SegSs);
1191 current_windows_thread->wow64_context.SegFs);
1194 current_windows_thread->wow64_context.SegGs);
1201 current_windows_thread->
context.SegCs);
1204 current_windows_thread->
context.SegDs);
1207 current_windows_thread->
context.SegEs);
1210 current_windows_thread->
context.SegSs);
1213 current_windows_thread->
context.SegFs);
1216 current_windows_thread->
context.SegGs);
1232 (
const EXCEPTION_RECORD *rec)
1243 CORE_ADDR addr = (CORE_ADDR) (uintptr_t) rec->ExceptionAddress;
1245 if ((!cygwin_exceptions && (addr >= cygwin_load_start
1246 && addr < cygwin_load_end))
1248 && startswith (fn,
"KERNEL32!IsBad")))
1262 int killed,
bool last_call)
1276 if (
id == -1 ||
id == (
int) th->tid)
1281 if (th->debug_registers_changed)
1283 th->wow64_context.ContextFlags |= CONTEXT_DEBUG_REGISTERS;
1290 th->debug_registers_changed =
false;
1292 if (th->wow64_context.ContextFlags)
1296 if (GetExitCodeThread (th->h, &ec)
1297 && ec == STILL_ACTIVE)
1300 &th->wow64_context);
1305 th->wow64_context.ContextFlags = 0;
1311 if (th->debug_registers_changed)
1313 th->context.ContextFlags |= CONTEXT_DEBUG_REGISTERS;
1320 th->debug_registers_changed =
false;
1322 if (th->context.ContextFlags)
1326 if (GetExitCodeThread (th->h, &ec)
1327 && ec == STILL_ACTIVE)
1329 BOOL status = SetThreadContext (th->h, &th->context);
1334 th->context.ContextFlags = 0;
1346 gdb::optional<unsigned>
err;
1350 err = (
unsigned) GetLastError ();
1356 if (
err.has_value ())
1357 error (_(
"Failed to resume program execution"
1358 " (ContinueDebugEvent failed, error %u: %s)"),
1359 *
err, strwinerror (*
err));
1370 = OpenProcess (PROCESS_ALL_ACCESS, FALSE,
1376 unsigned err = (unsigned) GetLastError ();
1377 error (_(
"OpenProcess call failed, GetLastError = %u: %s"),
1393 DWORD continue_status = DBG_CONTINUE;
1396 int resume_all = ptid == minus_one_ptid;
1403 if (sig != GDB_SIGNAL_0)
1406 != EXCEPTION_DEBUG_EVENT)
1408 DEBUG_EXCEPT (
"Cannot continue with signal %d here.", sig);
1411 continue_status = DBG_EXCEPTION_NOT_HANDLED;
1419 for (
const xlate_exception &x : xlate)
1422 current_event.u.Exception.ExceptionRecord.ExceptionCode
1424 continue_status = DBG_EXCEPTION_NOT_HANDLED;
1427 if (continue_status == DBG_CONTINUE)
1433 DEBUG_EXCEPT (
"Can only continue with received signal %d.",
1439 DEBUG_EXEC (
"pid=%d, tid=0x%x, step=%d, sig=%d",
1440 ptid.pid (), (
unsigned) ptid.lwp (), step, sig);
1458 if (th->wow64_context.ContextFlags)
1471 th->wow64_context.ContextFlags = 0;
1536 0, (LPTHREAD_START_ROUTINE)
1541 CloseHandle (thread);
1550 warning (_(
"Could not interrupt program. "
1551 "Press Ctrl-c in the program console."));
1566 DWORD continue_status, event_code;
1567 DWORD thread_id = 0;
1572 gdb::optional<pending_stop>
stop
1574 if (
stop.has_value ())
1576 thread_id =
stop->thread_id;
1577 *ourstatus =
stop->status;
1593 return minus_one_ptid;
1598 continue_status = DBG_CONTINUE;
1606 case CREATE_THREAD_DEBUG_EVENT:
1607 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1608 (
unsigned) current_event->dwProcessId,
1609 (
unsigned) current_event->dwThreadId,
1610 "CREATE_THREAD_DEBUG_EVENT");
1626 thread_id = current_event->dwThreadId;
1628 (ptid_t (current_event->dwProcessId, current_event->dwThreadId, 0),
1629 current_event->u.CreateThread.hThread,
1630 current_event->u.CreateThread.lpThreadLocalBase,
1635 case EXIT_THREAD_DEBUG_EVENT:
1636 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1637 (
unsigned) current_event->dwProcessId,
1638 (
unsigned) current_event->dwThreadId,
1639 "EXIT_THREAD_DEBUG_EVENT");
1641 current_event->dwThreadId, 0),
1642 current_event->u.ExitThread.dwExitCode,
1646 case CREATE_PROCESS_DEBUG_EVENT:
1647 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1648 (
unsigned) current_event->dwProcessId,
1649 (
unsigned) current_event->dwThreadId,
1650 "CREATE_PROCESS_DEBUG_EVENT");
1651 CloseHandle (current_event->u.CreateProcessInfo.hFile);
1658 (ptid_t (current_event->dwProcessId,
1659 current_event->dwThreadId, 0),
1660 current_event->u.CreateProcessInfo.hThread,
1661 current_event->u.CreateProcessInfo.lpThreadLocalBase,
1663 thread_id = current_event->dwThreadId;
1666 case EXIT_PROCESS_DEBUG_EVENT:
1667 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1668 (
unsigned) current_event->dwProcessId,
1669 (
unsigned) current_event->dwThreadId,
1670 "EXIT_PROCESS_DEBUG_EVENT");
1675 error (_(
"During startup program exited with code 0x%x."),
1676 (
unsigned int) current_event->u.ExitProcess.dwExitCode);
1681 current_event->dwThreadId, 0),
1683 DWORD exit_status = current_event->u.ExitProcess.dwExitCode;
1689 = WIFSIGNALED (exit_status) ? WTERMSIG (exit_status) : -1;
1690 if (exit_signal == -1)
1693 ourstatus->
set_signalled (gdb_signal_from_host (exit_signal));
1695 thread_id = current_event->dwThreadId;
1699 case LOAD_DLL_DEBUG_EVENT:
1700 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1701 (
unsigned) current_event->dwProcessId,
1702 (
unsigned) current_event->dwThreadId,
1703 "LOAD_DLL_DEBUG_EVENT");
1704 CloseHandle (current_event->u.LoadDll.hFile);
1712 catch (
const gdb_exception &ex)
1717 thread_id = current_event->dwThreadId;
1720 case UNLOAD_DLL_DEBUG_EVENT:
1721 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1722 (
unsigned) current_event->dwProcessId,
1723 (
unsigned) current_event->dwThreadId,
1724 "UNLOAD_DLL_DEBUG_EVENT");
1732 catch (
const gdb_exception &ex)
1737 thread_id = current_event->dwThreadId;
1740 case EXCEPTION_DEBUG_EVENT:
1741 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1742 (
unsigned) current_event->dwProcessId,
1743 (
unsigned) current_event->dwThreadId,
1744 "EXCEPTION_DEBUG_EVENT");
1751 continue_status = DBG_EXCEPTION_NOT_HANDLED;
1754 thread_id = current_event->dwThreadId;
1757 continue_status = DBG_CONTINUE;
1762 case OUTPUT_DEBUG_STRING_EVENT:
1763 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1764 (
unsigned) current_event->dwProcessId,
1765 (
unsigned) current_event->dwThreadId,
1766 "OUTPUT_DEBUG_STRING_EVENT");
1775 gdb_printf (
"gdb: kernel event for pid=%u tid=0x%x\n",
1776 (
unsigned) current_event->dwProcessId,
1777 (
unsigned) current_event->dwThreadId);
1779 (
unsigned) current_event->dwDebugEventCode);
1794 "unexpected stop in 0x%x (expecting 0x%x)",
1797 if (current_event->dwDebugEventCode == EXCEPTION_DEBUG_EVENT
1798 && ((current_event->u.Exception.ExceptionRecord.ExceptionCode
1799 == EXCEPTION_BREAKPOINT)
1800 || (current_event->u.Exception.ExceptionRecord.ExceptionCode
1804 ptid_t ptid = ptid_t (current_event->dwProcessId, thread_id, 0);
1825 target_wait_flags options)
1839 if (result != null_ptid)
1851 == EXCEPTION_DEBUG_EVENT
1853 == EXCEPTION_BREAKPOINT)
1899 if (!
inf->target_is_pushed (
this))
1900 inf->push_target (
this);
1923 inf->attach_flag = attaching;
1936 last_ptid = this->
wait (minus_one_ptid, &
status, 0);
1944 this->
resume (minus_one_ptid, 0, GDB_SIGNAL_0);
1979 HANDLE token_hdl = NULL;
1981 TOKEN_PRIVILEGES new_priv, orig_priv;
1986 TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES,
1993 new_priv.PrivilegeCount = 1;
1994 new_priv.Privileges[0].Luid = restore_priv;
1995 new_priv.Privileges[0].Attributes =
enable ? SE_PRIVILEGE_ENABLED : 0;
1998 sizeof orig_priv, &orig_priv, &
size))
2006 if (
enable && GetLastError () == ERROR_NOT_ALL_ASSIGNED)
2010 ret = orig_priv.Privileges[0].Attributes == SE_PRIVILEGE_ENABLED ? 1 : 0;
2014 CloseHandle (token_hdl);
2029 warning (
"Failed to get SE_DEBUG_NAME privilege\n"
2030 "This can cause attach to fail on Windows NT/2K/XP");
2035 gdb::optional<unsigned>
err;
2038 BOOL ok = DebugActiveProcess (
pid);
2044 pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID,
pid);
2047 ok = DebugActiveProcess (
pid);
2052 err = (unsigned) GetLastError ();
2057 if (
err.has_value ())
2058 error (_(
"Can't attach to process %u (error %u: %s)"),
2059 (unsigned)
pid, *
err, strwinerror (*
err));
2066 HANDLE h = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE,
pid);
2070 if (IsWow64Process (h, &wow64))
2085 gdb::optional<unsigned>
err;
2089 err = (
unsigned) GetLastError ();
2095 if (
err.has_value ())
2096 error (_(
"Can't detach process %u (error %u: %s)"),
2098 *
err, strwinerror (*
err));
2124 gdb_printf (
"\tUsing the running image of %s %s.\n",
2125 inf->attach_flag ?
"attached" :
"child",
2145 HANDLE hconsole = CreateFile (
"CONOUT$", GENERIC_READ | GENERIC_WRITE,
2146 FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
2148 if (hconsole != INVALID_HANDLE_VALUE)
2150 CONSOLE_SCREEN_BUFFER_INFO sbinfo;
2152 CONSOLE_FONT_INFO cfi;
2156 GetConsoleScreenBufferInfo(hconsole, &sbinfo);
2157 si->dwXSize = sbinfo.srWindow.Right - sbinfo.srWindow.Left + 1;
2158 si->dwYSize = sbinfo.srWindow.Bottom - sbinfo.srWindow.Top + 1;
2160 si->dwXSize *= font_size.X;
2164 si->dwYSize *= font_size.Y;
2167 si->dwXCountChars = sbinfo.dwSize.X;
2168 si->dwYCountChars = sbinfo.dwSize.Y;
2169 si->dwFlags |= STARTF_USESIZE | STARTF_USECOUNTCHARS;
2171 *
flags |= CREATE_NEW_CONSOLE;
2180 const char **p = (
const char **) a;
2181 const char **q = (
const char **) b;
2182 return strcasecmp (*p, *q);
2188clear_win32_environment (
char **env)
2192 wchar_t *copy = NULL, *equalpos;
2194 for (i = 0; env[i] && *env[i]; i++)
2196 len = mbstowcs (NULL, env[i], 0) + 1;
2197 copy = (
wchar_t *)
xrealloc (copy, len *
sizeof (
wchar_t));
2198 mbstowcs (copy, env[i], len);
2199 equalpos = wcschr (copy,
L'=');
2202 SetEnvironmentVariableW (copy, NULL);
2288 int *fd, ref_fd = -2;
2290 const char *fname = redir_string + 1;
2291 int rc = *redir_string;
2306 fd = (rc ==
'2') ?
err : out;
2307 mode = O_WRONLY | O_CREAT;
2320 if (*fname ==
'&' &&
'0' <= fname[1] && fname[1] <=
'9')
2324 ref_fd = (int) strtol (fname + 1, &fdtail, 10);
2325 if (fdtail > fname + 1 && *fdtail ==
'\0')
2328 if ((ref_fd == 0 && (fd == out || fd ==
err))
2329 || ((ref_fd == 1 || ref_fd == 2) && fd == inp))
2336 else if (ref_fd == 1)
2338 else if (ref_fd == 2)
2358 *fd = _open (fname, mode, _S_IREAD | _S_IWRITE);
2362 else if (ref_fd == -1)
2366 *fd = _dup (ref_fd);
2372 if ((mode & O_APPEND) != 0)
2373 _lseek (*fd, 0
L, SEEK_END);
2382 char buf[
__PMAX + 2 + 5];
2384 const char *start = s;
2388 if ((*start ==
'>' || *start ==
'1' || *start ==
'2')
2392 if (*s ==
'>' && *start !=
'>')
2395 else if (*start ==
'0' && *s ==
'<')
2400 while (isspace (*s))
2413 else if (*s == quote)
2421 else if (*s ==
'\\')
2427 else if (isspace (*s) && !quote)
2431 if (d - buf >=
sizeof (buf) - 1)
2433 errno = ENAMETOOLONG;
2442 if (d[-1] ==
'>' || d[-1] ==
'<')
2456 int *inp,
int *out,
int *
err)
2458 const char *s = cmd_orig;
2461 bool retval =
false;
2463 while (isspace (*s))
2472 else if (*s == quote)
2475 else if (*s ==
'\\')
2483 if (*s ==
'<' || *s ==
'>'
2484 || ((*s ==
'1' || *s ==
'2') && s[1] ==
'>')
2485 || (*s ==
'0' && s[1] ==
'<'))
2510 const std::string &origallargs,
2511 char **in_env,
int from_tty)
2515 wchar_t real_path[
__PMAX];
2520 wchar_t *cygallargs;
2522 char **old_env = NULL;
2526 int ostdin, ostdout, ostderr;
2530 char *args, *allargs_copy;
2531 size_t args_len, allargs_len;
2532 int fd_inp = -1, fd_out = -1, fd_err = -1;
2533 HANDLE tty = INVALID_HANDLE_VALUE;
2534 bool redirected =
false;
2542 const char *allargs = origallargs.c_str ();
2543 PROCESS_INFORMATION pi;
2544 gdb::optional<unsigned> ret;
2549 error (_(
"No executable specified, use `target exec'."));
2552 std::string expanded_infcwd;
2553 if (*inferior_cwd ==
'\0')
2554 inferior_cwd =
nullptr;
2557 expanded_infcwd = gdb_tilde_expand (inferior_cwd);
2559 std::replace (expanded_infcwd.begin (), expanded_infcwd.end (),
2561 inferior_cwd = expanded_infcwd.c_str ();
2564 memset (&si, 0,
sizeof (si));
2565 si.cb =
sizeof (si);
2568 flags |= CREATE_NEW_PROCESS_GROUP;
2576 flags |= DEBUG_ONLY_THIS_PROCESS;
2577 if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, exec_file, real_path,
2578 __PMAX *
sizeof (
wchar_t)) < 0)
2579 error (_(
"Error starting executable: %d"), errno);
2581 len = mbstowcs (NULL, allargs, 0) + 1;
2582 if (len == (
size_t) -1)
2583 error (_(
"Error starting executable: %d"), errno);
2584 cygallargs = (
wchar_t *) alloca (len *
sizeof (
wchar_t));
2585 mbstowcs (cygallargs, allargs, len);
2590 if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, sh, shell,
__PMAX) < 0)
2591 error (_(
"Error starting executable via shell: %d"), errno);
2592 len =
sizeof (
L" -c 'exec '") + mbstowcs (NULL, exec_file, 0)
2593 + mbstowcs (NULL, allargs, 0) + 2;
2594 cygallargs = (
wchar_t *) alloca (len *
sizeof (
wchar_t));
2595 swprintf (cygallargs, len,
L" -c 'exec %s %s'", exec_file, allargs);
2597 flags |= DEBUG_PROCESS;
2600 if (inferior_cwd != NULL
2601 && cygwin_conv_path (CCP_POSIX_TO_WIN_W, inferior_cwd,
2602 infcwd, strlen (inferior_cwd)) < 0)
2603 error (_(
"Error converting inferior cwd: %d"), errno);
2605 args = (
wchar_t *) alloca ((wcslen (toexec) + wcslen (cygallargs) + 2)
2606 *
sizeof (wchar_t));
2607 wcscpy (args, toexec);
2608 wcscat (args,
L" ");
2609 wcscat (args, cygallargs);
2611#ifdef CW_CVT_ENV_TO_WINENV
2613 w32_env = (PWCHAR) cygwin_internal (CW_CVT_ENV_TO_WINENV, in_env);
2614 if (w32_env != (PWCHAR) -1)
2615 flags |= CREATE_UNICODE_ENVIRONMENT;
2621 clear_win32_environment (
environ);
2625 cygwin_internal (CW_SYNC_WINENV);
2629 if (inferior_tty.empty ())
2630 tty = ostdin = ostdout = ostderr = -1;
2633 tty = open (inferior_tty.c_str (), O_RDWR |
O_NOCTTY);
2637 ostdin = ostdout = ostderr = -1;
2654 inferior_cwd !=
nullptr ? infcwd :
nullptr,
2657 ret = (unsigned) GetLastError ();
2667 clear_win32_environment (in_env);
2670 cygwin_internal (CW_SYNC_WINENV);
2684 allargs_len = strlen (allargs);
2685 allargs_copy = strcpy ((
char *) alloca (allargs_len + 1), allargs);
2686 if (strpbrk (allargs_copy,
"<>") != NULL)
2692 &fd_inp, &fd_out, &fd_err);
2694 warning (_(
"Error in redirection: %s."), safe_strerror (errno));
2697 allargs_len = strlen (allargs_copy);
2701 if (!inferior_tty.empty ()
2702 && !(fd_inp >= 0 && fd_out >= 0 && fd_err >= 0))
2704 SECURITY_ATTRIBUTES sa;
2705 sa.nLength =
sizeof(sa);
2706 sa.lpSecurityDescriptor = 0;
2707 sa.bInheritHandle = TRUE;
2708 tty = CreateFileA (inferior_tty.c_str (), GENERIC_READ | GENERIC_WRITE,
2709 0, &sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
2710 if (tty == INVALID_HANDLE_VALUE)
2712 unsigned err = (unsigned) GetLastError ();
2713 warning (_(
"Warning: Failed to open TTY %s, error %#x: %s"),
2714 inferior_tty.c_str (),
err, strwinerror (
err));
2717 if (redirected || tty != INVALID_HANDLE_VALUE)
2720 si.hStdInput = (HANDLE) _get_osfhandle (fd_inp);
2721 else if (tty != INVALID_HANDLE_VALUE)
2724 si.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
2726 si.hStdOutput = (HANDLE) _get_osfhandle (fd_out);
2727 else if (tty != INVALID_HANDLE_VALUE)
2728 si.hStdOutput = tty;
2730 si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
2732 si.hStdError = (HANDLE) _get_osfhandle (fd_err);
2733 else if (tty != INVALID_HANDLE_VALUE)
2736 si.hStdError = GetStdHandle (STD_ERROR_HANDLE);
2737 si.dwFlags |= STARTF_USESTDHANDLES;
2745 args_len = strlen (toexec) + 2 + allargs_len + 2;
2746 args = (
char *) alloca (args_len);
2747 xsnprintf (args, args_len,
"\"%s\" %s", toexec, allargs_copy);
2749 flags |= DEBUG_ONLY_THIS_PROCESS;
2755 for (envlen = 0, i = 0; in_env[i] && *in_env[i]; i++)
2756 envlen += strlen (in_env[i]) + 1;
2758 envsize =
sizeof (in_env[0]) * (i + 1);
2759 env = (
char **) alloca (envsize);
2760 memcpy (env, in_env, envsize);
2764 w32env = (
char *) alloca (envlen + 1);
2767 for (temp = w32env, i = 0; env[i] && *env[i]; i++)
2769 strcpy (temp, env[i]);
2770 temp += strlen (temp) + 1;
2787 ret = (
unsigned) GetLastError ();
2790 if (tty != INVALID_HANDLE_VALUE)
2800 if (ret.has_value ())
2801 error (_(
"Error creating process %s, (error %u: %s)"),
2802 exec_file, *ret, strwinerror (*ret));
2806 if (IsWow64Process (pi.hProcess, &wow64))
2810 CloseHandle (pi.hThread);
2811 CloseHandle (pi.hProcess);
2842 ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
2846 DWORD lasterror = 0;
2848 if (writebuf != NULL)
2850 DEBUG_MEM (
"write target memory, %s bytes at %s",
2851 pulongest (len), core_addr_to_string (memaddr));
2853 (LPVOID) (uintptr_t) memaddr, writebuf,
2856 lasterror = GetLastError ();
2858 (LPCVOID) (uintptr_t) memaddr, len);
2862 DEBUG_MEM (
"read target memory, %s bytes at %s",
2863 pulongest (len), core_addr_to_string (memaddr));
2865 (LPCVOID) (uintptr_t) memaddr, readbuf,
2868 lasterror = GetLastError ();
2870 *xfered_len = (ULONGEST) done;
2871 if (!success && lasterror == ERROR_PARTIAL_COPY && done > 0)
2888 == EXIT_PROCESS_DEBUG_EVENT)
2906 if (ptid.lwp () != 0)
2907 return string_printf (
"Thread %d.0x%lx", ptid.pid (), ptid.lwp ());
2915 gdb_byte *readbuf,
const gdb_byte *writebuf,
2916 ULONGEST offset, ULONGEST len,
2917 ULONGEST *xfered_len)
2919 auto_obstack obstack;
2926 obstack_grow_str (&obstack,
"<library-list>\n");
2929 (CORE_ADDR) (uintptr_t) so.load_addr,
2932 obstack_grow_str0 (&obstack,
"</library-list>\n");
2934 buf = (
const char *) obstack_finish (&obstack);
2935 len_avail = strlen (buf);
2936 if (offset >= len_avail)
2940 if (len > len_avail - offset)
2941 len = len_avail - offset;
2942 memcpy (readbuf, buf + offset, len);
2945 *xfered_len = (ULONGEST) len;
2953 ULONGEST *xfered_len)
2959 EXCEPTION_RECORD32 er32;
2962 buf = (
char *) &er32;
2963 bufsize =
sizeof (er32);
2967 er32.ExceptionRecord
2969 er32.ExceptionAddress
2973 for (i = 0; i < EXCEPTION_MAXIMUM_PARAMETERS; i++)
2974 er32.ExceptionInformation[i]
2982 if (readbuf ==
nullptr)
2985 if (offset > bufsize)
2988 if (offset + len > bufsize)
2989 len = bufsize - offset;
2991 memcpy (readbuf, buf + offset, len);
2999 const char *annex, gdb_byte *readbuf,
3000 const gdb_byte *writebuf, ULONGEST offset,
3001 ULONGEST len, ULONGEST *xfered_len)
3010 writebuf, offset, len, xfered_len);
3024 readbuf, writebuf, offset, len,
3084 cygwin_internal (CW_SET_DOS_FILE_WARNING, 0);
3088Signal a crashed process with event ID, to allow its debugging.\n\
3089This command is needed in support of setting up GDB as JIT debugger on \
3090MS-Windows. The command should be invoked from the GDB command line using \
3091the '-ex' command-line option. The ID of the event that blocks the \
3092crashed process will be supplied by the Windows JIT debugging mechanism."));
3096Set use of shell to start subprocess."), _(
"\
3097Show use of shell to start subprocess."), NULL,
3103 &cygwin_exceptions, _(
"\
3104Break when an exception is detected in the Cygwin DLL itself."), _(
"\
3105Show whether gdb breaks on exceptions in the Cygwin DLL itself."), NULL,
3112Set creation of new console when creating child process."), _(
"\
3113Show creation of new console when creating child process."), NULL,
3119Set creation of new group when creating child process."), _(
"\
3120Show creation of new group when creating child process."), NULL,
3126Set whether to display execution in child process."), _(
"\
3127Show whether to display execution in child process."), NULL,
3133Set whether to display kernel events in child process."), _(
"\
3134Show whether to display kernel events in child process."), NULL,
3140Set whether to display memory accesses in child process."), _(
"\
3141Show whether to display memory accesses in child process."), NULL,
3148Set whether to display kernel exceptions in child process."), _(
"\
3149Show whether to display kernel exceptions in child process."), NULL,
3157 _(
"Display selectors infos."),
3165cannot automatically find executable file or library to read symbols.\n\
3166Use \"file\" or \"dll\" command to load executable/libraries directly."));
3179 internal_error (_(
"Invalid register %d in cygwin_set_dr.\n"), i);
3183 th->debug_registers_changed =
true;
3195 th->debug_registers_changed =
true;
3232 gdb_assert (ptid.lwp () != 0);
3236 return WaitForSingleObject (th->
h, 0) != WAIT_OBJECT_0;
3247 homedir = getenv (
"HOME");
3251 char *oldini = (
char *) alloca (strlen (homedir) +
3252 sizeof (
"gdb.ini") + 1);
3253 strcpy (oldini, homedir);
3254 p = strchr (oldini,
'\0');
3255 if (p > oldini && !IS_DIR_SEPARATOR (p[-1]))
3257 strcpy (p,
"gdb.ini");
3258 if (access (oldini, 0) == 0)
3260 int len = strlen (oldini);
3261 char *newini = (
char *) alloca (len + 2);
3263 xsnprintf (newini, len + 2,
"%.*s.gdbinit",
3264 (
int) (len - (
sizeof (
"gdb.ini") - 1)), oldini);
3265 warning (_(
"obsolete '%s' found. Rename to '%s'."), oldini, newini);
void * xrealloc(void *ptr, size_t size)
const int amd64_mappings[]
#define context_offset(x)
int amd64_windows_segment_register_p(int regnum)
struct gdbarch * target_gdbarch(void)
bool find_pc_partial_function(CORE_ADDR pc, const char **name, CORE_ADDR *address, CORE_ADDR *endaddr, const struct block **block)
void disable_breakpoints_in_shlibs(void)
void mourn_inferior() override
void maybe_unpush_target()
const std::string & cwd() const
const std::string & tty()
void raw_collect(int regnum, void *buf) const override
void raw_supply(int regnum, const void *buf) override
struct cmd_list_element * showlist
struct cmd_list_element * setlist
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, const char *doc, struct cmd_list_element **list)
struct cmd_list_element * add_com(const char *name, enum command_class theclass, cmd_simple_func_ftype *fun, const char *doc)
set_show_commands add_setshow_boolean_cmd(const char *name, enum command_class theclass, bool *var, const char *set_doc, const char *show_doc, const char *help_doc, cmd_func_ftype *set_func, show_value_ftype *show_func, struct cmd_list_element **set_list, struct cmd_list_element **show_list)
#define complaint(FMT,...)
int(* deprecated_ui_loop_hook)(int signo)
LONGEST parse_and_eval_long(const char *exp)
void exception_print(struct ui_file *file, const struct gdb_exception &e)
gdb_bfd_ref_ptr gdb_bfd_open(const char *name, const char *target, int fd, bool warn_if_slow)
gdb::ref_ptr< struct bfd, gdb_bfd_ref_policy > gdb_bfd_ref_ptr
int gdbarch_pc_regnum(struct gdbarch *gdbarch)
bool gdbarch_read_pc_p(struct gdbarch *gdbarch)
int gdbarch_num_regs(struct gdbarch *gdbarch)
int gdbarch_ps_regnum(struct gdbarch *gdbarch)
CORE_ADDR gdbarch_decr_pc_after_break(struct gdbarch *gdbarch)
bool gdbarch_write_pc_p(struct gdbarch *gdbarch)
struct thread_info * add_thread_silent(process_stratum_target *targ, ptid_t ptid)
thread_info * find_thread_ptid(inferior *inf, ptid_t ptid)
void switch_to_thread(struct thread_info *thr)
void switch_to_no_thread()
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t err
mach_port_t kern_return_t mach_port_t mach_msg_type_name_t msgportsPoly mach_port_t kern_return_t pid_t pid mach_port_t kern_return_t mach_port_t task mach_port_t kern_return_t int flags
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int int rusage_t pid_t pid
mach_port_t mach_port_t name mach_port_t mach_port_t name kern_return_t int status
const int i386_mappings[]
int i386_windows_segment_register_p(int regnum)
#define I387_FOP_REGNUM(tdep)
#define I387_FISEG_REGNUM(tdep)
void add_inf_child_target(inf_child_target *target)
void inferior_event_handler(enum inferior_event_type event_type)
void inferior_appeared(struct inferior *inf, int pid)
struct inferior * find_inferior_pid(process_stratum_target *targ, int pid)
void detach_inferior(inferior *inf)
struct inferior * current_inferior(void)
void clear_proceed_status(int step)
bool disable_randomization
void init_wait_for_inferior(void)
int find_minimal_symbol_address(const char *name, CORE_ADDR *addr, struct objfile *objfile)
BOOL create_process(const char *image, char *command_line, DWORD flags, void *environment, const char *cur_dir, bool no_randomization, STARTUPINFOA *startup_info, PROCESS_INFORMATION *process_info)
bool initialize_loadable()
BOOL wait_for_debug_event(DEBUG_EVENT *event, DWORD timeout)
@ HANDLE_EXCEPTION_IGNORED
@ HANDLE_EXCEPTION_HANDLED
@ HANDLE_EXCEPTION_UNHANDLED
@ DONT_INVALIDATE_CONTEXT
BOOL continue_last_debug_event(DWORD continue_status, bool debug_events)
bool disable_randomization_available()
#define Wow64GetThreadSelectorEntry
#define Wow64SetThreadContext
#define DebugSetProcessKillOnExit
#define DebugBreakProcess
#define AdjustTokenPrivileges
#define DebugActiveProcessStop
#define LookupPrivilegeValueA
#define Wow64GetThreadContext
#define STATUS_WX86_BREAKPOINT
#define GetCurrentConsoleFont
#define GetConsoleFontSize
int register_size(struct gdbarch *gdbarch, int regnum)
struct regcache * get_current_regcache(void)
void(* func)(remote_target *remote, char *)
void serial_event_set(struct serial_event *event)
void serial_event_clear(struct serial_event *event)
struct serial_event * make_serial_event(void)
int serial_event_fd(struct serial_event *event)
#define SO_NAME_MAX_PATH_SIZE
target_ops * beneath() const
virtual enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) TARGET_DEFAULT_RETURN(TARGET_XFER_E_IO)
virtual gdb::byte_vector virtual thread_info_to_thread_handle(struct thread_info *) TARGET_DEFAULT_RETURN(gdb voi stop)(ptid_t) TARGET_DEFAULT_IGNORE()
target_waitstatus & set_exited(int exit_status)
target_waitstatus & set_spurious()
target_waitstatus & set_signalled(gdb_signal sig)
target_waitstatus & set_stopped(gdb_signal sig)
target_waitstatus & set_loaded()
target_waitstatus & set_ignore()
target_waitkind kind() const
bool matching_pending_stop(bool debug_events)
gdb::optional< pending_stop > fetch_pending_stop(bool debug_events)
DWORD desired_stop_thread_id
EXCEPTION_RECORD siginfo_er
handle_exception_result handle_exception(struct target_waitstatus *ourstatus, bool debug_exceptions)
const char * pid_to_exec_file(int)
DEBUG_EVENT current_event
std::vector< pending_stop > pending_stops
CORE_ADDR thread_local_base
const char * thread_name()
bool debug_registers_changed
bool stopped_at_software_breakpoint
BOOL windows_continue(DWORD continue_status, int id, int killed, bool last_call=false)
void wait_for_debug_event_main_thread(DEBUG_EVENT *event)
void do_synchronously(gdb::function_view< bool()> func)
static DWORD WINAPI process_thread_starter(LPVOID self)
void do_initial_windows_stuff(DWORD pid, bool attaching)
windows_thread_info * add_thread(ptid_t ptid, HANDLE h, void *tlb, bool main_thread_p)
DWORD fake_create_process()
bool attach_no_wait() override
serial_event * m_wait_event
void resume(ptid_t, int, enum gdb_signal) override
bool can_async_p() override
std::queue< gdb::function_view< bool()> > m_queue
ptid_t wait(ptid_t, struct target_waitstatus *, target_wait_flags) override
ptid_t get_windows_debug_event(int pid, struct target_waitstatus *ourstatus, target_wait_flags options)
const char * pid_to_exec_file(int pid) override
bool supports_disable_randomization() override
int async_wait_fd() override
void async(bool enable) override
void store_registers(struct regcache *, int) override
bool get_tib_address(ptid_t ptid, CORE_ADDR *addr) override
bool thread_alive(ptid_t ptid) override
void detach(inferior *, int) override
void interrupt() override
void create_inferior(const char *, const std::string &, char **, int) override
void files_info() override
bool stopped_by_sw_breakpoint() override
const char * thread_name(struct thread_info *) override
enum target_xfer_status xfer_partial(enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len) override
std::atomic< bool > m_debug_event_pending
DEBUG_EVENT m_last_debug_event
void pass_ctrlc() override
bool is_async_p() override
ptid_t get_ada_task_ptid(long lwp, ULONGEST thread) override
void mourn_inferior() override
void delete_thread(ptid_t ptid, DWORD exit_code, bool main_thread_p)
std::string pid_to_str(ptid_t) override
void fetch_registers(struct regcache *, int) override
void attach(const char *, int) override
bool supports_stopped_by_sw_breakpoint() override
std::vector< windows_solib > solibs
bool handle_access_violation(const EXCEPTION_RECORD *rec) override
segment_register_p_ftype * segment_register_p
void handle_unload_dll() override
windows_thread_info * thread_rec(ptid_t ptid, thread_disposition_type disposition) override
int windows_initialization_done
void handle_load_dll(const char *dll_name, LPVOID base) override
int handle_output_debug_string(struct target_waitstatus *ourstatus) override
std::vector< std::unique_ptr< windows_thread_info > > thread_list
std::string original_name
void(* set_addr)(int, CORE_ADDR)
unsigned long(* get_control)(void)
unsigned long(* get_status)(void)
void(* set_control)(unsigned long)
CORE_ADDR(* get_addr)(int)
int target_read_string(CORE_ADDR addr, int len, int width, unsigned int fetchlimit, gdb::unique_xmalloc_ptr< gdb_byte > *buffer, int *bytes_read)
void target_announce_detach(int from_tty)
void target_announce_attach(int from_tty, int pid)
std::string target_pid_to_str(ptid_t ptid)
std::string normal_pid_to_str(ptid_t ptid)
void target_mourn_inferior(ptid_t ptid)
@ TARGET_OBJECT_SIGNAL_INFO
@ TARGET_OBJECT_LIBRARIES
void print_sys_errmsg(const char *string, int errcode)
void gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
int parse_pid_to_attach(const char *args)
@ TARGET_WAITKIND_SPURIOUS
@ TARGET_WAITKIND_SIGNALLED
static unsigned long cygwin_get_dr7(void)
#define DEBUG_EVENTS(fmt,...)
static windows_per_inferior windows_process
static enum target_xfer_status windows_xfer_memory(gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
static int envvar_cmp(const void *a, const void *b)
static int redir_open(const char *redir_string, int *inp, int *out, int *err)
static void display_selectors(const char *args, int from_tty)
static void signal_event_command(const char *args, int from_tty)
static int set_process_privilege(const char *privilege, BOOL enable)
static bool debug_exceptions
static void cygwin_set_dr7(unsigned long val)
static void windows_fetch_one_register(struct regcache *regcache, windows_thread_info *th, int r)
void _initialize_windows_nat()
static unsigned long cygwin_get_dr6(void)
static enum target_xfer_status windows_xfer_shared_libraries(struct target_ops *ops, enum target_object object, const char *annex, gdb_byte *readbuf, const gdb_byte *writebuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
#define DEBUG_EXEC(fmt,...)
static bool redirect_inferior_handles(const char *cmd_orig, char *cmd, int *inp, int *out, int *err)
#define DEBUG_MEM(fmt,...)
static int display_selector(HANDLE thread, DWORD sel)
void _initialize_check_for_gdb_ini()
static void windows_init_thread_list(void)
static int redir_set_redirection(const char *s, int *inp, int *out, int *err)
#define DEBUG_EXCEPT(fmt,...)
static void windows_clear_solib(void)
#define CONTEXT_DEBUGGER_DR
static void windows_store_one_register(const struct regcache *regcache, windows_thread_info *th, int r)
static CORE_ADDR cygwin_get_dr(int i)
static enum target_xfer_status windows_xfer_siginfo(gdb_byte *readbuf, ULONGEST offset, ULONGEST len, ULONGEST *xfered_len)
static void cygwin_set_dr(int i, CORE_ADDR addr)
static void check(BOOL ok, const char *file, int line)
static void windows_set_console_info(STARTUPINFO *si, DWORD *flags)
static void wait_for_single(HANDLE handle, DWORD howlong)
#define _CYGWIN_SIGNAL_STRING
static windows_solib * windows_make_so(const char *name, LPVOID load_addr)
int() segment_register_p_ftype(int regnum)
void windows_xfer_shared_library(const char *so_name, CORE_ADDR load_addr, CORE_ADDR *text_offset_cached, struct gdbarch *gdbarch, struct obstack *obstack)
void init_w32_command_list(void)
struct cmd_list_element * info_w32_cmdlist
struct x86_dr_low_type x86_dr_low
void x86_cleanup_dregs(void)