[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gdb-patches
Subject:    [PATCH] Fix PR win32/14685
From:       jojelino () gmail ! com (jojelino)
Date:       2013-01-30 19:43:00
Message-ID: 51097819.502 () gmail ! com
[Download RAW message or body]

This patch fixes pr14685 by
Keeping current_event in windows-nat.c from being altered in 
handle_output_debug_string.
And fixes SIGSEGV not mentioned in pr14685 caused by cygwin-specific 
context load/save rooted from 
http://sourceware.org/git/?p=gdb.git;a=commit;f=gdb/windows-nat.c;h=8094fa2e73f05bd42a7005fd005aeaa26ea20c26
                
-------------- next part --------------
2013-01-31  Jin-woo Ye  <jojelino@gmail.com>

	PR win32/14685
	* windows-nat.c (do_windows_fetch_inferior_registers): Don't let gdb set the thread \
                context using saved context.
	* windows-nat.c (handle_output_debug_string): Don't try altering current_event.

diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index 7ef10f1..cd4bd7a 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -426,7 +426,11 @@ do_windows_fetch_inferior_registers (struct regcache *regcache, \
int r)  
   if (current_thread->reload_context)
     {
-#ifdef __COPY_CONTEXT_SIZE
+/*
+ * PR win32/14685
+ * Don't let gdb set the thread context using saved context.
+ */
+#if 0
       if (have_saved_context)
 	{
 	  /* Lie about where the program actually is stopped since
@@ -950,12 +954,19 @@ handle_output_debug_string (struct target_waitstatus \
*ourstatus)  else if (strncmp (s, _CYGWIN_SIGNAL_STRING,
 		    sizeof (_CYGWIN_SIGNAL_STRING) - 1) != 0)
     {
+      printf_unfiltered("DebugString: %s\n", s);
 #ifdef __CYGWIN__
       if (strncmp (s, "cYg", 3) != 0)
 #endif
 	warning (("%s"), s);
     }
-#ifdef __COPY_CONTEXT_SIZE
+  retval = main_thread_id;
+/*
+ * PR win32/14685
+ * Don't try altering current_event.
+ * Unless there is appropriate patch, loading cygwin context is just pointless.
+ */
+#if 0
   else
     {
       /* Got a cygwin signal marker.  A cygwin signal is followed by


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic