* remote.c (remote_write_bytes): Take a const buffer argument.
[deliverable/binutils-gdb.git] / gdb / win32-nat.c
index 42488580a4eeff3edeae22a81bf150c85a70ad4a..870635d6a1c36d6609b848a512f5c547fa193b4e 100644 (file)
@@ -142,6 +142,7 @@ static int saw_create;
 
 /* User options. */
 static int new_console = 0;
+static int cygwin_exceptions = 0;
 static int new_group = 1;
 static int debug_exec = 0;             /* show execution */
 static int debug_events = 0;           /* show events from kernel */
@@ -354,6 +355,7 @@ do_win32_fetch_inferior_registers (int r)
 
   if (current_thread->reload_context)
     {
+#ifdef __COPY_CONTEXT_SIZE
       if (have_saved_context)
        {
          /* Lie about where the program actually is stopped since cygwin has informed us that
@@ -363,6 +365,7 @@ do_win32_fetch_inferior_registers (int r)
          have_saved_context = 0;
        }
       else
+#endif
        {
          thread_info *th = current_thread;
          th->context.ContextFlags = CONTEXT_DEBUGGER_DR;
@@ -928,6 +931,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
       if (strncmp (s, "cYg", 3) != 0)
        warning (("%s"), s);
     }
+#ifdef __COPY_CONTEXT_SIZE
   else
     {
       /* Got a cygwin signal marker.  A cygwin signal is followed by the signal number
@@ -955,6 +959,7 @@ handle_output_debug_string (struct target_waitstatus *ourstatus)
          current_event.dwThreadId = retval;
        }
     }
+#endif
 
   if (s)
     xfree (s);
@@ -1110,7 +1115,7 @@ handle_exception (struct target_waitstatus *ourstatus)
           within the text segment of the DLL itself. */
        char *fn;
        bfd_vma addr = (bfd_vma) current_event.u.Exception.ExceptionRecord.ExceptionAddress;
-       if ((addr >= cygwin_load_start && addr < cygwin_load_end)
+       if ((!cygwin_exceptions && (addr >= cygwin_load_start && addr < cygwin_load_end))
            || (find_pc_partial_function (addr, &fn, NULL, NULL)
                && strncmp (fn, "KERNEL32!IsBad", strlen ("KERNEL32!IsBad")) == 0))
          return 0;
@@ -2341,6 +2346,18 @@ fetch_elf_core_registers (char *core_reg_sect,
     regcache_raw_supply (current_regcache, r, core_reg_sect + mappings[r]);
 }
 
+static int
+open_symbol_file_object (void *from_ttyp)
+{
+  return 0;
+}
+
+static int
+in_dynsym_resolve_code (CORE_ADDR pc)
+{
+  return 0;
+}
+
 static void
 init_win32_ops (void)
 {
@@ -2388,8 +2405,8 @@ init_win32_ops (void)
   win32_so_ops.solib_create_inferior_hook = win32_solib_create_inferior_hook;
   win32_so_ops.special_symbol_handling = win32_special_symbol_handling;
   win32_so_ops.current_sos = win32_current_sos;
-  win32_so_ops.open_symbol_file_object = NULL;
-  win32_so_ops.in_dynsym_resolve_code = NULL;
+  win32_so_ops.open_symbol_file_object = open_symbol_file_object;
+  win32_so_ops.in_dynsym_resolve_code = in_dynsym_resolve_code;
 
   /* FIXME: Don't do this here.  *_gdbarch_init() should set so_ops. */
   current_target_so_ops = &win32_so_ops;
@@ -2421,6 +2438,13 @@ Show use of shell to start subprocess."), NULL,
                           NULL, /* FIXME: i18n: */
                           &setlist, &showlist);
 
+  add_setshow_boolean_cmd ("cygwin-exceptions", class_support, &cygwin_exceptions, _("\
+Break when an exception is detected in the Cygwin DLL itself."), _("\
+Show whether gdb breaks on exceptions in the Cygwin DLL itself."), NULL,
+                          NULL,
+                          NULL, /* FIXME: i18n: */
+                          &setlist, &showlist);
+
   add_setshow_boolean_cmd ("new-console", class_support, &new_console, _("\
 Set creation of new console when creating child process."), _("\
 Show creation of new console when creating child process."), NULL,
This page took 0.027155 seconds and 4 git commands to generate.