/* Target-vector operations for controlling windows child processes, for GDB.
- Copyright (C) 1995-2015 Free Software Foundation, Inc.
+ Copyright (C) 1995-2016 Free Software Foundation, Inc.
Contributed by Cygnus Solutions, A Red Hat Company.
to treat this like a real signal. */
char *p;
int sig = strtol (s + sizeof (_CYGWIN_SIGNAL_STRING) - 1, &p, 0);
- int gotasig = gdb_signal_from_host (sig);
+ gdb_signal gotasig = gdb_signal_from_host (sig);
ourstatus->value.sig = gotasig;
if (gotasig)
default:
/* Treat unhandled first chance exceptions specially. */
if (current_event.u.Exception.dwFirstChance)
- return -1;
+ return 0;
printf_unfiltered ("gdb: unknown target exception 0x%08x at %s\n",
(unsigned) current_event.u.Exception.ExceptionRecord.ExceptionCode,
host_address_to_string (
"EXCEPTION_DEBUG_EVENT"));
if (saw_create != 1)
break;
- switch (handle_exception (ourstatus))
- {
- case 0:
- continue_status = DBG_EXCEPTION_NOT_HANDLED;
- break;
- case 1:
- thread_id = current_event.dwThreadId;
- break;
- case -1:
- last_sig = 1;
- continue_status = -1;
- break;
- }
+ if (handle_exception (ourstatus))
+ thread_id = current_event.dwThreadId;
+ else
+ continue_status = DBG_EXCEPTION_NOT_HANDLED;
break;
case OUTPUT_DEBUG_STRING_EVENT: /* Message from the kernel. */
if (!thread_id || saw_create != 1)
{
- if (continue_status == -1)
- windows_resume (ops, minus_one_ptid, 0, 1);
- else
- CHECK (windows_continue (continue_status, -1, 0));
+ CHECK (windows_continue (continue_status, -1, 0));
}
else
{
/* Cygwin prefers that the path be in /x/y/z format, so extract
the filename into a temporary buffer first, and then convert it
to POSIX format into the destination buffer. */
- cygwin_buf_t *pathbuf = alloca (exe_name_max_len * sizeof (cygwin_buf_t));
+ cygwin_buf_t *pathbuf = (cygwin_buf_t *) alloca (exe_name_max_len * sizeof (cygwin_buf_t));
len = GetModuleFileNameEx (current_process_handle,
dh_buf, pathbuf, exe_name_max_len);
{
char *p;
char *oldini = (char *) alloca (strlen (homedir) +
- sizeof ("/gdb.ini"));
+ sizeof ("gdb.ini") + 1);
strcpy (oldini, homedir);
p = strchr (oldini, '\0');
if (p > oldini && !IS_DIR_SEPARATOR (p[-1]))
if (access (oldini, 0) == 0)
{
int len = strlen (oldini);
- char *newini = (char *) alloca (len + 1);
+ char *newini = (char *) alloca (len + 2);
- xsnprintf (newini, len + 1, "%.*s.gdbinit",
+ xsnprintf (newini, len + 2, "%.*s.gdbinit",
(int) (len - (sizeof ("gdb.ini") - 1)), oldini);
warning (_("obsolete '%s' found. Rename to '%s'."), oldini, newini);
}
{
GPA (hm, EnumProcessModules);
GPA (hm, GetModuleInformation);
- GPA (hm, GetModuleFileNameEx);
+ GetModuleFileNameEx = (GetModuleFileNameEx_ftype *)
+ GetProcAddress (hm, GetModuleFileNameEx_name);
}
if (!EnumProcessModules || !GetModuleInformation || !GetModuleFileNameEx)