Previously, the starting inferior was sent a SIGSTOP to avoid
progress before the debugger could attach.
However, these signals are then also visible in the debugger and
need to be ignored as part of the startup handling in Creator.
The waiting effect can be achieved less intrusively by waiting
on a pipe read between fork() and exec().
Task-number: QTCREATORBUG-25073
Task-number: QTCREATORBUG-25082
Task-number: QTCREATORBUG-25227
Change-Id: Ie70b9eb5ea865f85411c26b0dbf377a019fec8d5
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Previously, ptrace was used to keep a tight hold on the spawned process
across the exec(), followed by raising a SIGSTOP to allow un-racy
attaching a debugger.
This makes implementation of 'Run as root' more difficult and is
apparently not needed: instead of the ptrace use, the SIGSTOP can be
raised directly, before exec().
Change-Id: I36025ac547b2a335e2a203c728d221830e4c0a7d
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This will be handy once we want to debug processes running as root.
The mechanism is the same as for "killProcess", and currently unused.
Change-Id: I2c5e5b77577ca32ed1118fcc81c03c6320db8800
Reviewed-by: Joerg Bornemann <joerg.bornemann@qt.io>
use an assert to document in a machine-readable form that the file is
expected to be null-terminated. this supersedes 5a58e962's approach of
appending a null char, which would just obfuscate a problem in the calling
code if it were to ever have an effect.
Change-Id: Iaedb575d20abb42d98e011949e792ecf4dde3e93
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
On modern linux distributions (Ubuntu >= 10.10, Debian >= Wheezy),
trying to debug a terminal application fails, with
"ptrace: Operation not permitted".
In order to allow the debugger to attach to the created process, the
process itself needs to inform the kernel of the debugging process.
Task-number: QTCREATORBUG-3509
Change-Id: I68670426fad18cbe3b7cce9d57633e58e631e025
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Reviewed-by: hjk <hjk121@nokiamail.com>
* If Creator is not executed from terminal, this value is missing.
* If it is executed from a terminal of another type than the stub
it might be wrong.
Change-Id: Ia6bd1dd59be04e01398ed5cdffff3080539b10ef
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
The stub incorrectly send its pid before reading the environment file,
and qtcreator does interpret that as sign that it can delete the
environment file.
Task-number: QTCREATORBUG-9024
Change-Id: Id44777abdfdd94aa10815cb00ca27846b95a3ec7
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Distinguishes the process that starts the terminal from the stub
process, as on mac to support Terminal.app they are different.
Handle the stub not through the process that starts the terminal,
but through the local socket (on *nix).
Replace the blocking wait(...) in the main thread, with a nonblocking
wait in the signal handler when receiving a SIGCHLD, to leave the
main thread able to handle communication with creator.
This change allows the use of terminal emulator commands
that share a single instance or that fork.
So this is also the real fix for QTCREATORBUG-1633 on linux.
If creator crashes the stub and the debugged program live on.
This was done on purpose, it could be changed if considered better.
Task-number: QTCREATORBUG-6371
Task-number: QTCREATORBUG-1633
Change-Id: I4d4fb3a67b1987f4e46e2c603dcefe8c15152ad2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
Setting Tools/Options/Environment/General/Terminal to one of the
following works now as expected.
1. xterm -e
2. aterm -e
3. rxvt -e
4. urxvt -e
5. xfce4-terminal -x
6. konsole --nofork -e
7. gnome-terminal -x
Without the '--nofork' option for konsole, from creator's pov, the
terminal emulator will finish immediately and therefore creator closes
the local socket. As a result of this, the user is presented with sth.
like this (from the stub):
Cannot connect creator comm socket /tmp/qt_temp.A13523/stub-socket:
No such file or directory.
Task-Number: QTCREATORBUG-1633
Change-Id: I732e20d34aebdc1591355e0c4e78c907f439924c
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com>