/* Target-vector operations for controlling win32 child processes, for GDB.
- Copyright 1995, 1996, 1997, 1998 Free Software Foundation, Inc.
- Contributed by Cygnus Support.
+ Copyright 1995, 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
+ Contributed by Cygnus Solutions, A Red Hat Company.
This file is part of GDB.
#include "frame.h" /* required by inferior.h */
#include "inferior.h"
#include "target.h"
-#include "wait.h"
#include "gdbcore.h"
#include "command.h"
#include <signal.h>
context_offset (FloatSave.ErrorOffset),
context_offset (FloatSave.DataSelector),
context_offset (FloatSave.DataOffset),
+ context_offset (FloatSave.ErrorSelector)
};
+#undef context_offset
+
/* This vector maps the target's idea of an exception (extracted
from the DEBUG_EVENT structure) to GDB's idea. */
supply_register (r, (char *) &l);
}
else if (r >= 0)
- supply_register (r, ((char *) ¤t_thread->context) + mappings[r]);
+ supply_register (r, context_offset);
else
{
for (r = 0; r < NUM_REGS; r++)
|| !s || !*s)
return gotasig;
- if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1))
+ if (strncmp (s, CYGWIN_SIGNAL_STRING, sizeof (CYGWIN_SIGNAL_STRING) - 1) != 0)
{
- if (strncmp (s, "cYg", 3))
+ if (strncmp (s, "cYg", 3) != 0)
warning (s);
}
+ else
{
char *p;
int sig = strtol (s + sizeof (CYGWIN_SIGNAL_STRING) - 1, &p, 0);
ourstatus->value.sig = TARGET_SIGNAL_SEGV;
continue_status = DBG_EXCEPTION_NOT_HANDLED;
break;
+ case STATUS_FLOAT_UNDERFLOW:
+ case STATUS_FLOAT_DIVIDE_BY_ZERO:
+ case STATUS_FLOAT_OVERFLOW:
+ case STATUS_INTEGER_DIVIDE_BY_ZERO:
+ DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
+ current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ ourstatus->value.sig = TARGET_SIGNAL_FPE;
+ continue_status = DBG_EXCEPTION_NOT_HANDLED;
+ break;
case STATUS_STACK_OVERFLOW:
DEBUG_EXCEPT (("gdb: Target exception STACK_OVERFLOW at 0x%08x\n",
current_event.u.Exception.ExceptionRecord.ExceptionAddress));
current_event.u.Exception.ExceptionRecord.ExceptionAddress));
ourstatus->value.sig = TARGET_SIGNAL_TRAP;
break;
+ case EXCEPTION_ILLEGAL_INSTRUCTION:
+ DEBUG_EXCEPT (("gdb: Target exception SINGLE_ILL at 0x%08x\n",
+ current_event.u.Exception.ExceptionRecord.ExceptionAddress));
+ ourstatus->value.sig = TARGET_SIGNAL_ILL;
+ break;
default:
/* This may be a structured exception handling exception. In
that case, we want to let the program try to handle it, and
- only break if we see the exception a second time. */
+ only break if we see the exception a second time.
if (current_event.u.Exception.dwFirstChance)
+
return 0;
+*/
printf_unfiltered ("gdb: unknown target exception 0x%08x at 0x%08x\n",
current_event.u.Exception.ExceptionRecord.ExceptionCode,
get_child_debug_event (inferior_pid, &dummy, &event_code, &ret);
while (event_code != EXCEPTION_DEBUG_EVENT);
+ SymSetOptions (SYMOPT_DEFERRED_LOADS);
+ SymInitialize (current_process_handle, NULL, TRUE);
+
proceed ((CORE_ADDR) - 1, TARGET_SIGNAL_0, 0);
}
child_ops.to_can_run = child_can_run;
child_ops.to_notice_signals = 0;
child_ops.to_thread_alive = win32_child_thread_alive;
+ child_ops.to_pid_to_str = cygwin_pid_to_str;
child_ops.to_stop = child_stop;
child_ops.to_stratum = process_stratum;
child_ops.DONT_USE = 0;
sprintf (buf, "thread %d.0x%x", current_event.dwProcessId, pid);
return buf;
}
-#ifdef NOTYET
-CORE_ADDR
-win32_read_fp ()
-{
- STACKFRAME *sf = current_thread->sf;
-
- memset (&sf, 0, sizeof(sf));
- sf->AddrPC.Offset = current_thread->context.Eip;
- sf->AddrPC.Mode = AddrModeFlat;
- sf->AddrStack.Offset = current_thread->context.Esp;
- sf->AddrStack.Mode = AddrModeFlat;
- sf->AddrFrame.Offset = current_thread->context.Ebp;
- if (!StackWalk (IMAGE_FILE_MACHINE_I386, current_process_handle,
- current->thread->h, sf, NULL, NULL,
- SymFunctionTableAccess, SymGetModuleBase, NULL))
- return NULL;
- return (CORE_ADDR) sf.AddrFrame.Offset;
-}
-
-CORE_ADDR
-child_frame_chain(struct frame_info *thisframe)
-{
- STACKFRAME *sf = current->thread->sf;
-#if 0
- sf.AddrPC.Offset = thisframe->pc;
- sf.AddrPC.Mode = AddrModeFlat;
- sf.AddrStack.Offset = thisframe->;
- sf.AddrStack.Mode = AddrModeFlat;
- sf.AddrFrame.Offset = cx->Ebp;
-#endif
- if (!StackWalk (IMAGE_FILE_MACHINE_I386, current_process_handle,
- current->thread->h, &sf, NULL, NULL,
- SymFunctionTableAccess, SymGetModuleBase, NULL))
- return NULL;
- return (CORE_ADDR) sf->AddrFrame.Offset;
-}
-#endif