This is the mail archive of the mailing list for the GDB project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

interpreter-exec on mingw/cygwin gdb-7.6.2 fails


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

Note this is not fixed by the hack below, which fixes
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"),                                                                                                                                
                  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->error = 1;                                                                                                                                                                
+                       delete_file_handler(file_ptr->fd);                                                                                                                                            
+                 file_ptr->error = 0;                                                                                                                                                                
                file_ptr->error = 0;                                                                                                                                                                  

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]