Bug #17767 2010-12-03 20:38

secks

Debugging window closes during gdb debug process

If you debug a program in linux for longer than roughly a day the debugging terminal will close while the program is still active. The problem exists because the terminal is created with a sleep command, and then the debugger outputs to that terminals tty once it has been identified by it's unique sleep command. The sleep is defined by 80000 plus the current process ID. I have put together a patch that fixes this bug by increasing the sleep time to hours instead of seconds.

Category
Debugger
Group
 
Status
Closed
Close date
2011-04-09 21:33
Assigned to
tpetrov
secks 2010-12-03 20:39
Index: trunk/src/plugins/debuggergdb/debuggergdb.cpp
===================================================================
--- trunk/src/plugins/debuggergdb/debuggergdb.cpp	(revision 6872)
+++ trunk/src/plugins/debuggergdb/debuggergdb.cpp	(working copy)
@@ -2898,7 +2898,7 @@
 {
 #ifndef __WXMSW__
 
-    // start the xterm and put the shell to sleep with -e sleep 80000
+    // start the xterm and put the shell to sleep with -e sleep 80000h
     // fetch the xterm tty so we can issue to gdb a "tty /dev/pts/#"
     // redirecting program stdin/stdout/stderr to the xterm console.
 
@@ -2911,7 +2911,7 @@
     term.Replace(_T("$TITLE"), _T("'") + title + _T("'"));
     cmd << term << _T(" ");
     cmd2 << wxT("sleep ");
-    cmd2 << wxString::Format(wxT("%d"),80000 + ::wxGetProcessId());
+    cmd2 << wxString::Format(wxT("%dh"),80000 + ::wxGetProcessId());
 
     if (!cmd.Replace(_T("$SCRIPT"), cmd2))
         // if they didn't specify $SCRIPT, append:
@@ -2970,7 +2970,7 @@
     ConsPidStr << ConsPid;
     //find task with our unique sleep time
     wxString uniqueSleepTimeStr;
-    uniqueSleepTimeStr << wxT("sleep ") << wxString::Format(wxT("%d"),80000 + ::wxGetProcessId());
+    uniqueSleepTimeStr << wxT("sleep ") << wxString::Format(wxT("%dh"),80000 + ::wxGetProcessId());
     // search the output of "ps pid" command
     int knt = psOutput.GetCount();
     for (int i=knt-1; i>-1; --i)
tpetrov 2011-04-09 21:33

Bug is fixed in the debuggers branch...