News:

When registered with our forums, feel free to send a "here I am" post here to differ human beings from SPAM bots.

Main Menu

Linux Debug window timeout

Started by secks, December 03, 2010, 07:08:57 PM

Previous topic - Next topic

secks

I've been trying to debug a program that I leave running on over the weekend (takes a long time to segfault,) and the sleep for the debugging terminal is set to roughly a day.  It's currently set to 80000 + PID.  This should be set to something a little higher :)  80000 + PID + hour.  The problem is if you debug a process for longer than a day the terminal's "sleep 80000+" will timeout and you can no longer get any output.  I propose:

debuggergdb.cpp
cmd << wxString::Format(wxT("%d"),80000 + ::wxGetProcessId());
should be changed to
cmd << wxString::Format(wxT("%dh"),80000 + ::wxGetProcessId());
also, but not necessary:
uniqueSleepTimeStr << wxT("sleep ") << wxString::Format(wxT("%d"),80000 + ::wxGetProcessId());
to
uniqueSleepTimeStr << wxT("sleep ") << wxString::Format(wxT("%dh"),80000 + ::wxGetProcessId());


secks

Here is the patch file is someone high up wants to implement it :D
tyia
iluia

secks

Is there anyone in the dev group that can apply this?  It's really a pain when you debug a process overnight and BAM the window closes .. hellllpppppp

oBFusCATed

The suffix seems like a GNU extension, so a better fix is adding 000 at the end of value :)
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

secks

Quote from: oBFusCATed on February 17, 2011, 09:40:40 PM
The suffix seems like a GNU extension, so a better fix is adding 000 at the end of value :)
That would work but the adding "h" makes it multiplies the sleep by 3600  .. if I leave a debug session open for 80000 hours I probably have an acceptable bug lol :D

oBFusCATed

Fixed in the branch, sorry for the delay...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

secks

You have made me a happy coder .. :) thanks!  I had a work around by sending SIGSTOP to the sleep process .. Although a few times I still forgot to do it and BOOM, there goes my debugging window .. haha ..

thanks again

p4