Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* interpreter-exec on mingw/cygwin gdb-7.6.2 fails
@ 2013-09-05 13:36 Tim Sander
  0 siblings, 0 replies; only message in thread
From: Tim Sander @ 2013-09-05 13:36 UTC (permalink / raw)
  To: gdb

Hi

I have noticed that interpretex-exec completly fails on mingw/cygwin if 
executed with "source <cmdfile>" or gdb -x cmdfile.
The content of cmdfile is for example:
interpreter-exec console "set target-async off"

After that console gets continually printed with:
(gdb) select: Bad file descriptor.
Whch comes from event-loop.c, gdb_wait_for_event, 
perror_with_name (("select"));
and gdb does not seem to react any more to any input.

First  (see patch below) i thought that there might be a stale handle of the 
recursive called interpreter but gdb_notifier only contains one handle at this 
time so it seems as if the file handle got stale/corrupted in some way during 
the inner interpreter call.  (Also closing this handle stops gdb execution).

I would be happy if someone would have an idea how tackle this error.

Best regards
Tim

PS:
Note this is not fixed by the hack below, which fixes 
http://sourceware.org/bugzilla/show_bug.cgi?id=15811
albeit in a not so clean way as it just cleans up and ignores any error :-(.
But at least its better than the current state which just quits gdb.

 gdb/event-loop.c |    5 +++--                                                                                                                                                                        
 1 file changed, 3 insertions(+), 2 deletions(-)                                                                                                                                                      
                                                                                                                                                                                                      
diff --git a/gdb/event-loop.c b/gdb/event-loop.c                                                                                                                                                      
index f34f153..fb394ce 100644                                                                                                                                                                         
--- a/gdb/event-loop.c                                                                                                                                                                                
+++ b/gdb/event-loop.c                                                                                                                                                                                
@@ -736,9 +736,10 @@ handle_file_event (event_data data)                                                                                                                                              
                    printf_unfiltered (_("Error detected on fd %d\n"),                                                                                                                                
                                       file_ptr->fd);                                                                                                                                                 
                  if (mask & POLLNVAL)                                                                                                                                                                
-                   printf_unfiltered (_("Invalid or non-`poll'able fd %d\n"),                                                                                                                        
+                   printf_unfiltered (_("Invalid or non-`poll'able fd %d\n 
Deleting handle."),                                                                                                       
                                       file_ptr->fd);                                                                                                                                                 
-                 file_ptr->error = 1;                                                                                                                                                                
+                       delete_file_handler(file_ptr->fd);                                                                                                                                            
+                 file_ptr->error = 0;                                                                                                                                                                
                }                                                                                                                                                                                     
              else                                                                                                                                                                                    
                file_ptr->error = 0;                                                                                                                                                                  
--  


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2013-09-05 13:36 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-05 13:36 interpreter-exec on mingw/cygwin gdb-7.6.2 fails Tim Sander

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox