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,
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);
625 [=] (std::unique_ptr<windows_thread_info> &th)
627 return th->tid == id;
651 char *context_ptr = (
char *) &th->
context;
654 context_ptr = (
char *) &th->wow64_context;
699 gdb_assert (
size == 8);
733 __COPY_CONTEXT_SIZE);
796 char *context_ptr = (
char *) &th->
context;
799 context_ptr = (
char *) &th->wow64_context;
835 WIN32_FIND_DATA w32_fd;
836 HANDLE h = FindFirstFile(
name, &w32_fd);
838 if (h == INVALID_HANDLE_VALUE)
844 if (GetCurrentDirectory (MAX_PATH + 1, cwd))
846 p = strrchr (buf,
'\\');
849 SetCurrentDirectory (buf);
850 GetFullPathName (w32_fd.cFileName, MAX_PATH, buf, &p);
851 SetCurrentDirectory (cwd);
854 if (strcasecmp (buf,
"ntdll.dll") == 0)
856 GetSystemDirectory (buf,
sizeof (buf));
857 strcat (buf,
"\\ntdll.dll");
863 if (access (
name, F_OK) != 0)
865 if (strcasecmp (
name,
"ntdll.dll") == 0)
867 GetSystemDirectoryW (buf,
sizeof (buf) /
sizeof (
wchar_t));
868 wcscat (buf,
L"\\ntdll.dll");
882 cygwin_conv_path (CCP_WIN_W_TO_POSIX, buf, cname,
888 char *rname = realpath (
name, NULL);
896 warning (_(
"dll path for \"%s\" too long or inaccessible"),
name);
901 size_t len =
sizeof (
"/cygwin1.dll") - 1;
902 if (so->
name.size () >= len
903 && strcasecmp (so->
name.c_str () + so->
name.size () - len,
904 "/cygwin1.dll") == 0)
906 asection *text = NULL;
913 if (bfd_check_format (abfd.get (), bfd_object))
914 text = bfd_get_section_by_name (abfd.get (),
".text");
925 bfd_section_size (text);
939 host_address_to_string (solib->
load_addr));
953 if (lib.load_addr == lpBaseOfDll)
955 DEBUG_EVENTS (
"Unloading dll \"%s\".", lib.name.c_str ());
974 complaint (_(
"dll starting at %s not found."),
975 host_address_to_string (lpBaseOfDll));
988 uintptr_t event_id = 0;
989 char *endargs = NULL;
992 error (_(
"signal-event requires an argument (integer event id)"));
994 event_id = strtoumax (args, &endargs, 10);
996 if ((errno == ERANGE) || (event_id == 0) || (event_id > UINTPTR_MAX) ||
997 ((HANDLE) event_id == INVALID_HANDLE_VALUE))
998 error (_(
"Failed to convert `%s' to event id"), args);
1000 SetEvent ((HANDLE) event_id);
1001 CloseHandle ((HANDLE) event_id);
1012 gdb::unique_xmalloc_ptr<char> s
1014 ((CORE_ADDR) (uintptr_t)
current_event.u.DebugString.lpDebugStringData,
1016 if (s ==
nullptr || !*(s.get ()))
1021 if (!startswith (s.get (),
"cYg"))
1024 char *p = strchr (s.get (),
'\0');
1026 if (p > s.get () && *--p ==
'\n')
1028 warning ((
"%s"), s.get ());
1043 gdb_signal gotasig = gdb_signal_from_host (sig);
1051 retval = strtoul (p, &p, 0);
1054 else if ((x = (LPCVOID) (uintptr_t) strtoull (p, NULL, 0))
1055 && ReadProcessMemory (
handle, x,
1057 __COPY_CONTEXT_SIZE, &n)
1058 && n == __COPY_CONTEXT_SIZE)
1077 ret = GetThreadSelectorEntry (thread, sel, &
info);
1082 if (!
info.HighWord.Bits.Pres)
1084 gdb_puts (
"Segment not present\n");
1087 base = (
info.HighWord.Bits.BaseHi << 24) +
1088 (
info.HighWord.Bits.BaseMid << 16)
1090 limit = (
info.HighWord.Bits.LimitHi << 16) +
info.LimitLow;
1091 if (
info.HighWord.Bits.Granularity)
1092 limit = (limit << 12) | 0xfff;
1093 gdb_printf (
"base=0x%08x limit=0x%08x", base, limit);
1094 if (
info.HighWord.Bits.Default_Big)
1098 switch ((
info.HighWord.Bits.Type & 0xf) >> 1)
1101 gdb_puts (
"Data (Read-Only, Exp-up");
1104 gdb_puts (
"Data (Read/Write, Exp-up");
1110 gdb_puts (
"Data (Read/Write, Exp-down");
1113 gdb_puts (
"Code (Exec-Only, N.Conf");
1116 gdb_puts (
"Code (Exec/Read, N.Conf");
1119 gdb_puts (
"Code (Exec-Only, Conf");
1122 gdb_puts (
"Code (Exec/Read, Conf");
1126 (
unsigned long)
info.HighWord.Bits.Type);
1128 if ((
info.HighWord.Bits.Type & 0x1) == 0)
1131 if ((
info.HighWord.Bits.Type & 0x10) == 0)
1134 (
unsigned long)
info.HighWord.Bits.Dpl);
1135 if (
info.HighWord.Bits.Granularity)
1143 DWORD
err = GetLastError ();
1144 if (
err == ERROR_NOT_SUPPORTED)
1147 gdb_printf (
"Invalid selector 0x%x.\n", (
unsigned) sel);
1157 gdb_puts (
"Impossible to display selectors now.\n");
1171 current_windows_thread->wow64_context.SegCs);
1174 current_windows_thread->wow64_context.SegDs);
1177 current_windows_thread->wow64_context.SegEs);
1180 current_windows_thread->wow64_context.SegSs);
1183 current_windows_thread->wow64_context.SegFs);
1186 current_windows_thread->wow64_context.SegGs);
1193 current_windows_thread->
context.SegCs);
1196 current_windows_thread->
context.SegDs);
1199 current_windows_thread->
context.SegEs);
1202 current_windows_thread->
context.SegSs);
1205 current_windows_thread->
context.SegFs);
1208 current_windows_thread->
context.SegGs);
1224 (
const EXCEPTION_RECORD *rec)
1235 CORE_ADDR addr = (CORE_ADDR) (uintptr_t) rec->ExceptionAddress;
1237 if ((!cygwin_exceptions && (addr >= cygwin_load_start
1238 && addr < cygwin_load_end))
1240 && startswith (fn,
"KERNEL32!IsBad")))
1254 int killed,
bool last_call)
1268 if (
id == -1 ||
id == (
int) th->tid)
1273 if (th->debug_registers_changed)
1275 th->wow64_context.ContextFlags |= CONTEXT_DEBUG_REGISTERS;
1282 th->debug_registers_changed =
false;
1284 if (th->wow64_context.ContextFlags)
1288 if (GetExitCodeThread (th->h, &ec)
1289 && ec == STILL_ACTIVE)
1292 &th->wow64_context);
1297 th->wow64_context.ContextFlags = 0;
1303 if (th->debug_registers_changed)
1305 th->context.ContextFlags |= CONTEXT_DEBUG_REGISTERS;
1312 th->debug_registers_changed =
false;
1314 if (th->context.ContextFlags)
1318 if (GetExitCodeThread (th->h, &ec)
1319 && ec == STILL_ACTIVE)
1321 BOOL status = SetThreadContext (th->h, &th->context);
1326 th->context.ContextFlags = 0;
1338 gdb::optional<unsigned>
err;
1342 err = (
unsigned) GetLastError ();
1348 if (
err.has_value ())
1349 error (_(
"Failed to resume program execution"
1350 " (ContinueDebugEvent failed, error %u: %s)"),
1351 *
err, strwinerror (*
err));
1362 = OpenProcess (PROCESS_ALL_ACCESS, FALSE,
1368 unsigned err = (unsigned) GetLastError ();
1369 error (_(
"OpenProcess call failed, GetLastError = %u: %s"),
1385 DWORD continue_status = DBG_CONTINUE;
1388 int resume_all = ptid == minus_one_ptid;
1395 if (sig != GDB_SIGNAL_0)
1398 != EXCEPTION_DEBUG_EVENT)
1400 DEBUG_EXCEPT (
"Cannot continue with signal %d here.", sig);
1403 continue_status = DBG_EXCEPTION_NOT_HANDLED;
1411 for (
const xlate_exception &x : xlate)
1414 current_event.u.Exception.ExceptionRecord.ExceptionCode
1416 continue_status = DBG_EXCEPTION_NOT_HANDLED;
1419 if (continue_status == DBG_CONTINUE)
1425 DEBUG_EXCEPT (
"Can only continue with received signal %d.",
1431 DEBUG_EXEC (
"pid=%d, tid=0x%x, step=%d, sig=%d",
1432 ptid.pid (), (
unsigned) ptid.lwp (), step, sig);
1450 if (th->wow64_context.ContextFlags)
1463 th->wow64_context.ContextFlags = 0;
1528 0, (LPTHREAD_START_ROUTINE)
1533 CloseHandle (thread);
1542 warning (_(
"Could not interrupt program. "
1543 "Press Ctrl-c in the program console."));
1558 DWORD continue_status, event_code;
1559 DWORD thread_id = 0;
1564 gdb::optional<pending_stop>
stop
1566 if (
stop.has_value ())
1568 thread_id =
stop->thread_id;
1569 *ourstatus =
stop->status;
1585 return minus_one_ptid;
1590 continue_status = DBG_CONTINUE;
1598 case CREATE_THREAD_DEBUG_EVENT:
1599 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1600 (
unsigned) current_event->dwProcessId,
1601 (
unsigned) current_event->dwThreadId,
1602 "CREATE_THREAD_DEBUG_EVENT");
1618 thread_id = current_event->dwThreadId;
1620 (ptid_t (current_event->dwProcessId, current_event->dwThreadId, 0),
1621 current_event->u.CreateThread.hThread,
1622 current_event->u.CreateThread.lpThreadLocalBase,
1627 case EXIT_THREAD_DEBUG_EVENT:
1628 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1629 (
unsigned) current_event->dwProcessId,
1630 (
unsigned) current_event->dwThreadId,
1631 "EXIT_THREAD_DEBUG_EVENT");
1633 current_event->dwThreadId, 0),
1634 current_event->u.ExitThread.dwExitCode,
1638 case CREATE_PROCESS_DEBUG_EVENT:
1639 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1640 (
unsigned) current_event->dwProcessId,
1641 (
unsigned) current_event->dwThreadId,
1642 "CREATE_PROCESS_DEBUG_EVENT");
1643 CloseHandle (current_event->u.CreateProcessInfo.hFile);
1650 (ptid_t (current_event->dwProcessId,
1651 current_event->dwThreadId, 0),
1652 current_event->u.CreateProcessInfo.hThread,
1653 current_event->u.CreateProcessInfo.lpThreadLocalBase,
1655 thread_id = current_event->dwThreadId;
1658 case EXIT_PROCESS_DEBUG_EVENT:
1659 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1660 (
unsigned) current_event->dwProcessId,
1661 (
unsigned) current_event->dwThreadId,
1662 "EXIT_PROCESS_DEBUG_EVENT");
1667 error (_(
"During startup program exited with code 0x%x."),
1668 (
unsigned int) current_event->u.ExitProcess.dwExitCode);
1673 current_event->dwThreadId, 0),
1675 DWORD exit_status = current_event->u.ExitProcess.dwExitCode;
1681 = WIFSIGNALED (exit_status) ? WTERMSIG (exit_status) : -1;
1682 if (exit_signal == -1)
1685 ourstatus->
set_signalled (gdb_signal_from_host (exit_signal));
1687 thread_id = current_event->dwThreadId;
1691 case LOAD_DLL_DEBUG_EVENT:
1692 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1693 (
unsigned) current_event->dwProcessId,
1694 (
unsigned) current_event->dwThreadId,
1695 "LOAD_DLL_DEBUG_EVENT");
1696 CloseHandle (current_event->u.LoadDll.hFile);
1704 catch (
const gdb_exception &ex)
1709 thread_id = current_event->dwThreadId;
1712 case UNLOAD_DLL_DEBUG_EVENT:
1713 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1714 (
unsigned) current_event->dwProcessId,
1715 (
unsigned) current_event->dwThreadId,
1716 "UNLOAD_DLL_DEBUG_EVENT");
1724 catch (
const gdb_exception &ex)
1729 thread_id = current_event->dwThreadId;
1732 case EXCEPTION_DEBUG_EVENT:
1733 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1734 (
unsigned) current_event->dwProcessId,
1735 (
unsigned) current_event->dwThreadId,
1736 "EXCEPTION_DEBUG_EVENT");
1743 continue_status = DBG_EXCEPTION_NOT_HANDLED;
1746 thread_id = current_event->dwThreadId;
1749 continue_status = DBG_CONTINUE;
1754 case OUTPUT_DEBUG_STRING_EVENT:
1755 DEBUG_EVENTS (
"kernel event for pid=%u tid=0x%x code=%s",
1756 (
unsigned) current_event->dwProcessId,
1757 (
unsigned) current_event->dwThreadId,
1758 "OUTPUT_DEBUG_STRING_EVENT");
1767 gdb_printf (
"gdb: kernel event for pid=%u tid=0x%x\n",
1768 (
unsigned) current_event->dwProcessId,
1769 (
unsigned) current_event->dwThreadId);
1771 (
unsigned) current_event->dwDebugEventCode);
1786 "unexpected stop in 0x%x (expecting 0x%x)",
1789 if (current_event->dwDebugEventCode == EXCEPTION_DEBUG_EVENT
1790 && ((current_event->u.Exception.ExceptionRecord.ExceptionCode
1791 == EXCEPTION_BREAKPOINT)
1792 || (current_event->u.Exception.ExceptionRecord.ExceptionCode
1796 ptid_t ptid = ptid_t (current_event->dwProcessId, thread_id, 0);
1817 target_wait_flags options)
1831 if (result != null_ptid)
1843 == EXCEPTION_DEBUG_EVENT
1845 == EXCEPTION_BREAKPOINT)
1891 if (!
inf->target_is_pushed (
this))
1892 inf->push_target (
this);
1915 inf->attach_flag = attaching;
1928 last_ptid = this->
wait (minus_one_ptid, &
status, 0);
1936 this->
resume (minus_one_ptid, 0, GDB_SIGNAL_0);
1971 HANDLE token_hdl = NULL;
1973 TOKEN_PRIVILEGES new_priv, orig_priv;
1978 TOKEN_QUERY | TOKEN_ADJUST_PRIVILEGES,
1985 new_priv.PrivilegeCount = 1;
1986 new_priv.Privileges[0].Luid = restore_priv;
1987 new_priv.Privileges[0].Attributes =
enable ? SE_PRIVILEGE_ENABLED : 0;
1990 sizeof orig_priv, &orig_priv, &
size))
1998 if (
enable && GetLastError () == ERROR_NOT_ALL_ASSIGNED)
2002 ret = orig_priv.Privileges[0].Attributes == SE_PRIVILEGE_ENABLED ? 1 : 0;
2006 CloseHandle (token_hdl);
2021 warning (
"Failed to get SE_DEBUG_NAME privilege\n"
2022 "This can cause attach to fail on Windows NT/2K/XP");
2027 gdb::optional<unsigned>
err;
2030 BOOL ok = DebugActiveProcess (
pid);
2036 pid = cygwin_internal (CW_CYGWIN_PID_TO_WINPID,
pid);
2039 ok = DebugActiveProcess (
pid);
2044 err = (unsigned) GetLastError ();
2049 if (
err.has_value ())
2050 error (_(
"Can't attach to process %u (error %u: %s)"),
2051 (unsigned)
pid, *
err, strwinerror (*
err));
2058 HANDLE h = OpenProcess (PROCESS_QUERY_INFORMATION, FALSE,
pid);
2062 if (IsWow64Process (h, &wow64))
2077 gdb::optional<unsigned>
err;
2081 err = (
unsigned) GetLastError ();
2087 if (
err.has_value ())
2088 error (_(
"Can't detach process %u (error %u: %s)"),
2090 *
err, strwinerror (*
err));
2116 gdb_printf (
"\tUsing the running image of %s %s.\n",
2117 inf->attach_flag ?
"attached" :
"child",
2137 HANDLE hconsole = CreateFile (
"CONOUT$", GENERIC_READ | GENERIC_WRITE,
2138 FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
2140 if (hconsole != INVALID_HANDLE_VALUE)
2142 CONSOLE_SCREEN_BUFFER_INFO sbinfo;
2144 CONSOLE_FONT_INFO cfi;
2148 GetConsoleScreenBufferInfo(hconsole, &sbinfo);
2149 si->dwXSize = sbinfo.srWindow.Right - sbinfo.srWindow.Left + 1;
2150 si->dwYSize = sbinfo.srWindow.Bottom - sbinfo.srWindow.Top + 1;
2152 si->dwXSize *= font_size.X;
2156 si->dwYSize *= font_size.Y;
2159 si->dwXCountChars = sbinfo.dwSize.X;
2160 si->dwYCountChars = sbinfo.dwSize.Y;
2161 si->dwFlags |= STARTF_USESIZE | STARTF_USECOUNTCHARS;
2163 *
flags |= CREATE_NEW_CONSOLE;
2172 const char **p = (
const char **) a;
2173 const char **q = (
const char **) b;
2174 return strcasecmp (*p, *q);
2180clear_win32_environment (
char **env)
2184 wchar_t *copy = NULL, *equalpos;
2186 for (i = 0; env[i] && *env[i]; i++)
2188 len = mbstowcs (NULL, env[i], 0) + 1;
2189 copy = (
wchar_t *)
xrealloc (copy, len *
sizeof (
wchar_t));
2190 mbstowcs (copy, env[i], len);
2191 equalpos = wcschr (copy,
L'=');
2194 SetEnvironmentVariableW (copy, NULL);
2280 int *fd, ref_fd = -2;
2282 const char *fname = redir_string + 1;
2283 int rc = *redir_string;
2298 fd = (rc ==
'2') ?
err : out;
2299 mode = O_WRONLY | O_CREAT;
2312 if (*fname ==
'&' &&
'0' <= fname[1] && fname[1] <=
'9')
2316 ref_fd = (int) strtol (fname + 1, &fdtail, 10);
2317 if (fdtail > fname + 1 && *fdtail ==
'\0')
2320 if ((ref_fd == 0 && (fd == out || fd ==
err))
2321 || ((ref_fd == 1 || ref_fd == 2) && fd == inp))
2328 else if (ref_fd == 1)
2330 else if (ref_fd == 2)
2350 *fd = _open (fname, mode, _S_IREAD | _S_IWRITE);
2354 else if (ref_fd == -1)
2358 *fd = _dup (ref_fd);
2364 if ((mode & O_APPEND) != 0)
2365 _lseek (*fd, 0
L, SEEK_END);
2374 char buf[
__PMAX + 2 + 5];
2376 const char *start = s;
2380 if ((*start ==
'>' || *start ==
'1' || *start ==
'2')
2384 if (*s ==
'>' && *start !=
'>')
2387 else if (*start ==
'0' && *s ==
'<')
2392 while (isspace (*s))
2405 else if (*s == quote)
2413 else if (*s ==
'\\')
2419 else if (isspace (*s) && !quote)
2423 if (d - buf >=
sizeof (buf) - 1)
2425 errno = ENAMETOOLONG;
2434 if (d[-1] ==
'>' || d[-1] ==
'<')
2448 int *inp,
int *out,
int *
err)
2450 const char *s = cmd_orig;
2453 bool retval =
false;
2455 while (isspace (*s))
2464 else if (*s == quote)
2467 else if (*s ==
'\\')
2475 if (*s ==
'<' || *s ==
'>'
2476 || ((*s ==
'1' || *s ==
'2') && s[1] ==
'>')
2477 || (*s ==
'0' && s[1] ==
'<'))
2502 const std::string &origallargs,
2503 char **in_env,
int from_tty)
2507 wchar_t real_path[
__PMAX];
2512 wchar_t *cygallargs;
2514 char **old_env = NULL;
2518 int ostdin, ostdout, ostderr;
2522 char *args, *allargs_copy;
2523 size_t args_len, allargs_len;
2524 int fd_inp = -1, fd_out = -1, fd_err = -1;
2525 HANDLE tty = INVALID_HANDLE_VALUE;
2526 bool redirected =
false;
2534 const char *allargs = origallargs.c_str ();
2535 PROCESS_INFORMATION pi;
2536 gdb::optional<unsigned> ret;
2541 error (_(
"No executable specified, use `target exec'."));
2544 std::string expanded_infcwd;
2545 if (*inferior_cwd ==
'\0')
2546 inferior_cwd =
nullptr;
2549 expanded_infcwd = gdb_tilde_expand (inferior_cwd);
2551 std::replace (expanded_infcwd.begin (), expanded_infcwd.end (),
2553 inferior_cwd = expanded_infcwd.c_str ();
2556 memset (&si, 0,
sizeof (si));
2557 si.cb =
sizeof (si);
2560 flags |= CREATE_NEW_PROCESS_GROUP;
2568 flags |= DEBUG_ONLY_THIS_PROCESS;
2569 if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, exec_file, real_path,
2570 __PMAX *
sizeof (
wchar_t)) < 0)
2571 error (_(
"Error starting executable: %d"), errno);
2573 len = mbstowcs (NULL, allargs, 0) + 1;
2574 if (len == (
size_t) -1)
2575 error (_(
"Error starting executable: %d"), errno);
2576 cygallargs = (
wchar_t *) alloca (len *
sizeof (
wchar_t));
2577 mbstowcs (cygallargs, allargs, len);
2582 if (cygwin_conv_path (CCP_POSIX_TO_WIN_W, sh, shell,
__PMAX) < 0)
2583 error (_(
"Error starting executable via shell: %d"), errno);
2584 len =
sizeof (
L" -c 'exec '") + mbstowcs (NULL, exec_file, 0)
2585 + mbstowcs (NULL, allargs, 0) + 2;
2586 cygallargs = (
wchar_t *) alloca (len *
sizeof (
wchar_t));
2587 swprintf (cygallargs, len,
L" -c 'exec %s %s'", exec_file, allargs);
2589 flags |= DEBUG_PROCESS;
2592 if (inferior_cwd != NULL
2593 && cygwin_conv_path (CCP_POSIX_TO_WIN_W, inferior_cwd,
2594 infcwd, strlen (inferior_cwd)) < 0)
2595 error (_(
"Error converting inferior cwd: %d"), errno);
2597 args = (
wchar_t *) alloca ((wcslen (toexec) + wcslen (cygallargs) + 2)
2598 *
sizeof (wchar_t));
2599 wcscpy (args, toexec);
2600 wcscat (args,
L" ");
2601 wcscat (args, cygallargs);
2603#ifdef CW_CVT_ENV_TO_WINENV
2605 w32_env = (PWCHAR) cygwin_internal (CW_CVT_ENV_TO_WINENV, in_env);
2606 if (w32_env != (PWCHAR) -1)
2607 flags |= CREATE_UNICODE_ENVIRONMENT;
2613 clear_win32_environment (
environ);
2617 cygwin_internal (CW_SYNC_WINENV);
2621 if (inferior_tty.empty ())
2622 tty = ostdin = ostdout = ostderr = -1;
2625 tty = open (inferior_tty.c_str (), O_RDWR |
O_NOCTTY);
2629 ostdin = ostdout = ostderr = -1;
2646 inferior_cwd !=
nullptr ? infcwd :
nullptr,
2649 ret = (unsigned) GetLastError ();
2659 clear_win32_environment (in_env);
2662 cygwin_internal (CW_SYNC_WINENV);
2676 allargs_len = strlen (allargs);
2677 allargs_copy = strcpy ((
char *) alloca (allargs_len + 1), allargs);
2678 if (strpbrk (allargs_copy,
"<>") != NULL)
2684 &fd_inp, &fd_out, &fd_err);
2686 warning (_(
"Error in redirection: %s."), safe_strerror (errno));
2689 allargs_len = strlen (allargs_copy);
2693 if (!inferior_tty.empty ()
2694 && !(fd_inp >= 0 && fd_out >= 0 && fd_err >= 0))
2696 SECURITY_ATTRIBUTES sa;
2697 sa.nLength =
sizeof(sa);
2698 sa.lpSecurityDescriptor = 0;
2699 sa.bInheritHandle = TRUE;
2700 tty = CreateFileA (inferior_tty.c_str (), GENERIC_READ | GENERIC_WRITE,
2701 0, &sa, OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, 0);
2702 if (tty == INVALID_HANDLE_VALUE)
2704 unsigned err = (unsigned) GetLastError ();
2705 warning (_(
"Warning: Failed to open TTY %s, error %#x: %s"),
2706 inferior_tty.c_str (),
err, strwinerror (
err));
2709 if (redirected || tty != INVALID_HANDLE_VALUE)
2712 si.hStdInput = (HANDLE) _get_osfhandle (fd_inp);
2713 else if (tty != INVALID_HANDLE_VALUE)
2716 si.hStdInput = GetStdHandle (STD_INPUT_HANDLE);
2718 si.hStdOutput = (HANDLE) _get_osfhandle (fd_out);
2719 else if (tty != INVALID_HANDLE_VALUE)
2720 si.hStdOutput = tty;
2722 si.hStdOutput = GetStdHandle (STD_OUTPUT_HANDLE);
2724 si.hStdError = (HANDLE) _get_osfhandle (fd_err);
2725 else if (tty != INVALID_HANDLE_VALUE)
2728 si.hStdError = GetStdHandle (STD_ERROR_HANDLE);
2729 si.dwFlags |= STARTF_USESTDHANDLES;
2737 args_len = strlen (toexec) + 2 + allargs_len + 2;
2738 args = (
char *) alloca (args_len);
2739 xsnprintf (args, args_len,
"\"%s\" %s", toexec, allargs_copy);
2741 flags |= DEBUG_ONLY_THIS_PROCESS;
2747 for (envlen = 0, i = 0; in_env[i] && *in_env[i]; i++)
2748 envlen += strlen (in_env[i]) + 1;
2750 envsize =
sizeof (in_env[0]) * (i + 1);
2751 env = (
char **) alloca (envsize);
2752 memcpy (env, in_env, envsize);
2756 w32env = (
char *) alloca (envlen + 1);
2759 for (temp = w32env, i = 0; env[i] && *env[i]; i++)
2761 strcpy (temp, env[i]);
2762 temp += strlen (temp) + 1;
2779 ret = (
unsigned) GetLastError ();
2782 if (tty != INVALID_HANDLE_VALUE)
2792 if (ret.has_value ())
2793 error (_(
"Error creating process %s, (error %u: %s)"),
2794 exec_file, *ret, strwinerror (*ret));
2798 if (IsWow64Process (pi.hProcess, &wow64))
2802 CloseHandle (pi.hThread);
2803 CloseHandle (pi.hProcess);
2834 ULONGEST memaddr, ULONGEST len, ULONGEST *xfered_len)
2838 DWORD lasterror = 0;
2840 if (writebuf != NULL)
2842 DEBUG_MEM (
"write target memory, %s bytes at %s",
2843 pulongest (len), core_addr_to_string (memaddr));
2845 (LPVOID) (uintptr_t) memaddr, writebuf,
2848 lasterror = GetLastError ();
2850 (LPCVOID) (uintptr_t) memaddr, len);
2854 DEBUG_MEM (
"read target memory, %s bytes at %s",
2855 pulongest (len), core_addr_to_string (memaddr));
2857 (LPCVOID) (uintptr_t) memaddr, readbuf,
2860 lasterror = GetLastError ();
2862 *xfered_len = (ULONGEST) done;
2863 if (!success && lasterror == ERROR_PARTIAL_COPY && done > 0)
2880 == EXIT_PROCESS_DEBUG_EVENT)
2898 if (ptid.lwp () != 0)
2899 return string_printf (
"Thread %d.0x%lx", ptid.pid (), ptid.lwp ());
2907 gdb_byte *readbuf,
const gdb_byte *writebuf,
2908 ULONGEST offset, ULONGEST len,
2909 ULONGEST *xfered_len)
2911 auto_obstack obstack;
2918 obstack_grow_str (&obstack,
"<library-list>\n");
2921 (CORE_ADDR) (uintptr_t) so.load_addr,
2924 obstack_grow_str0 (&obstack,
"</library-list>\n");
2926 buf = (
const char *) obstack_finish (&obstack);
2927 len_avail = strlen (buf);
2928 if (offset >= len_avail)
2932 if (len > len_avail - offset)
2933 len = len_avail - offset;
2934 memcpy (readbuf, buf + offset, len);
2937 *xfered_len = (ULONGEST) len;
2945 ULONGEST *xfered_len)
2951 EXCEPTION_RECORD32 er32;
2954 buf = (
char *) &er32;
2955 bufsize =
sizeof (er32);
2959 er32.ExceptionRecord
2961 er32.ExceptionAddress
2965 for (i = 0; i < EXCEPTION_MAXIMUM_PARAMETERS; i++)
2966 er32.ExceptionInformation[i]
2974 if (readbuf ==
nullptr)
2977 if (offset > bufsize)
2980 if (offset + len > bufsize)
2981 len = bufsize - offset;
2983 memcpy (readbuf, buf + offset, len);
2991 const char *annex, gdb_byte *readbuf,
2992 const gdb_byte *writebuf, ULONGEST offset,
2993 ULONGEST len, ULONGEST *xfered_len)
3002 writebuf, offset, len, xfered_len);
3016 readbuf, writebuf, offset, len,
3076 cygwin_internal (CW_SET_DOS_FILE_WARNING, 0);
3080Signal a crashed process with event ID, to allow its debugging.\n\
3081This command is needed in support of setting up GDB as JIT debugger on \
3082MS-Windows. The command should be invoked from the GDB command line using \
3083the '-ex' command-line option. The ID of the event that blocks the \
3084crashed process will be supplied by the Windows JIT debugging mechanism."));
3088Set use of shell to start subprocess."), _(
"\
3089Show use of shell to start subprocess."), NULL,
3095 &cygwin_exceptions, _(
"\
3096Break when an exception is detected in the Cygwin DLL itself."), _(
"\
3097Show whether gdb breaks on exceptions in the Cygwin DLL itself."), NULL,
3104Set creation of new console when creating child process."), _(
"\
3105Show creation of new console when creating child process."), NULL,
3111Set creation of new group when creating child process."), _(
"\
3112Show creation of new group when creating child process."), NULL,
3118Set whether to display execution in child process."), _(
"\
3119Show whether to display execution in child process."), NULL,
3125Set whether to display kernel events in child process."), _(
"\
3126Show whether to display kernel events in child process."), NULL,
3132Set whether to display memory accesses in child process."), _(
"\
3133Show whether to display memory accesses in child process."), NULL,
3140Set whether to display kernel exceptions in child process."), _(
"\
3141Show whether to display kernel exceptions in child process."), NULL,
3149 _(
"Display selectors infos."),
3157cannot automatically find executable file or library to read symbols.\n\
3158Use \"file\" or \"dll\" command to load executable/libraries directly."));
3171 internal_error (_(
"Invalid register %d in cygwin_set_dr.\n"), i);
3175 th->debug_registers_changed =
true;
3187 th->debug_registers_changed =
true;
3224 gdb_assert (ptid.lwp () != 0);
3228 return WaitForSingleObject (th->
h, 0) != WAIT_OBJECT_0;
3239 homedir = getenv (
"HOME");
3243 char *oldini = (
char *) alloca (strlen (homedir) +
3244 sizeof (
"gdb.ini") + 1);
3245 strcpy (oldini, homedir);
3246 p = strchr (oldini,
'\0');
3247 if (p > oldini && !IS_DIR_SEPARATOR (p[-1]))
3249 strcpy (p,
"gdb.ini");
3250 if (access (oldini, 0) == 0)
3252 int len = strlen (oldini);
3253 char *newini = (
char *) alloca (len + 2);
3255 xsnprintf (newini, len + 2,
"%.*s.gdbinit",
3256 (
int) (len - (
sizeof (
"gdb.ini") - 1)), oldini);
3257 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()
thread_info * find_thread(ptid_t ptid)
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)
void delete_thread_with_exit_code(thread_info *thread, ULONGEST exit_code, bool silent=false)
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)
GetCurrentConsoleFont_ftype * GetCurrentConsoleFont
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)
DebugActiveProcessStop_ftype * DebugActiveProcessStop
bool initialize_loadable()
DebugBreakProcess_ftype * DebugBreakProcess
BOOL wait_for_debug_event(DEBUG_EVENT *event, DWORD timeout)
LookupPrivilegeValueA_ftype * LookupPrivilegeValueA
OpenProcessToken_ftype * OpenProcessToken
GetConsoleFontSize_ftype * GetConsoleFontSize
AdjustTokenPrivileges_ftype * AdjustTokenPrivileges
DebugSetProcessKillOnExit_ftype * DebugSetProcessKillOnExit
@ 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 Wow64GetThreadContext
#define STATUS_WX86_BREAKPOINT
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::array_view< const_gdb_byte > 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 gdb_printf(struct ui_file *stream, const char *format,...)
void gdb_puts(const char *linebuffer, struct ui_file *stream)
void warning_filename_and_errno(const char *filename, int saved_errno)
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)