Developer forums (C::B DEVELOPMENT STRICTLY!) > Plugins development

Quick patch to make gnome-terminal-server usable with debugger-plugin

(1/2) > >>

Jenna:
Newer versions of gnome-terminal start (or reuse) a gnome-terminal-server instead of a single process.
Because of this, the pid returned by wxExecute when starting gnome-terminal is no longer valid and the check whether the started console is still opened fails.
The user gest a message that the console has been closed and is asked whether the debugger should be stopped or not.
Nevertheless debugging works fine, because the tty can be determined coorectly, because or sleep-process is still running, but the console can nt be closed after debugging.

I attach a patch, where the pid can (and will) be changed by cbDebuggerPlugin::GetConsoleTty, if it can not be found.
This breaks the api of the cbDebuggerPlugin-class, but it works.

@oBFusCATed
can you please look into this patch, I know it is probaly not the best solution, but it works with minimal changings.
If there are no objections, I would like to have it or a similar patch in our repo before we do the release, because it allows user to use gnome-terminal again.

oBFusCATed:
Have they removed the --disable-factory option in newer gnome-terminals?
I've not tried any 3.x based one, but the 2.xx version in centos 6 works correctly with this option.

Jenna:
The option is there and I use it but the gnome-terminal-server is the only visible gnome-terminal process anyway.

From an xterm with no running gnome-terminal at start:

--- Code: ---jens@fedora-aspire:~$ ps -eaf | grep terminal
jens      6381  6319  0 12:17 pts/1    00:00:00 grep --color=auto terminal
jens@fedora-aspire:~$ gnome-terminal --disable-factory -t 'Program Console' -x  sleep 1234567
jens@fedora-aspire:~$ ps -eaf | grep terminal
jens      6388     1  1 12:18 ?        00:00:00 /usr/libexec/gnome-terminal-server
jens      6400  6319  0 12:18 pts/1    00:00:00 grep --color=auto terminal
jens@fedora-aspire:~$ ps x -o tty,pid,command | grep "sleep 1234567"
pts/2     6392 sleep 1234567
pts/1     6417 grep --color=auto sleep 1234567

--- End code ---
The last command with the output piped to grep is similar to what we do to find our sleep-process, that's why the tty is determined correctly, but the pid returned by wxExecute is invalid.

oBFusCATed:
What version of gnome are you using?

Jenna:
Currently I use 3.8 (Fedoora 19).
On Fedora 20 with 3.10 I get the following message:

--- Code: ---jens@localhost:~$ LC_ALL='C' gnome-terminal --disable-factory
Failed to parse arguments: Option "--disable-factory" is no longer supported in this version of gnome-terminal.

--- End code ---
so the functionality might already be removed in 3.8, but the option is still there.
With 3.6 (Fedora 18) it works as expected.

Navigation

[0] Message Index

[#] Next page

Go to full version