This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
gdbserver --attach
- From: mf1 at gmail dot ru
- To: gdb at sourceware dot org
- Date: Tue, 16 May 2006 18:02:57 +0400
- Subject: gdbserver --attach
Hello.
I'm trying to remote debug a Linux executable from a Windows board.
On the Windows machine, I'm running MINGW gdb 6.3.
My problem is that I'm required to run gdbserver with sudo, which changes the environment somehow, and the application runs into a segmentation fault.
If however I run the application without sudo, and then attach gdbserver to the running process, things go okay.
The question is how to simulate gdbserver's behavior of stopping the process just after it has been run?
I've been thinking of pidof && kill -STOP, but it seems it doesn't work well if started right after the process.
Is there a better way?
Any help much appreciated!