delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1998/06/05/11:33:59

From: smith AT sztaki DOT hu (Jozsef Kovacs)
Subject: GDB Attach command
5 Jun 1998 11:33:59 -0700 :
Message-ID: <Pine.SOL.3.95.980605105009.17616A-100000.cygnus.gnu-win32@lutra.sztaki.hu>
References: <Pine DOT SOL DOT 3 DOT 95 DOT 980528155530 DOT 22204A-100000 AT lutra DOT sztaki DOT hu>
Mime-Version: 1.0
To: gnu-win32 AT cygnus DOT com

 Hi.

 In the next I show what gdb does when trying to attach a running
 process. This demo is very simple and even this case gdb can't attach
 to it. If I start it from gdb it works properly.

/*********************************************************************
 bash-2.01$ gcc -g demo.c -o demo.exe
 bash-2.01$ gdb -nw -q
 (gdb) file demo.exe
 Reading symbols from demo.exe...done.
 ----> Starting demo.exe
 ----> Looking up PID in Task Manager
 (gdb) attach 63
 Attaching to program `/demo/demo.exe', process 63
 0x0 in ?? ()
 ----> Program didn't even stop as shown in Task Manager !!???
 (gdb) where
 #0  0x0 in ?? ()
 ----> What can I do?
 (gdb) continue
 Continuing.
 error return /home/noer/src/97r2/devo/gdb/win32-nat.c:855 was 6
 
 ----> And demo.exe is running forever, so let's kill it
 Program exited with code 0200400.
 (gdb)
 
/******************************************************************
 And the source file for demo.c:
 #include <stdio.h>
 
 int main()
 {
 	char buffer[20];
 	int i;
 
 	for(;;)
 	{
 		/* Just for system call */
 		sprintf(buffer,"i: %i",i);
 	}
 
 	return;
 }
 
/****************************************************** 

 I've already tried attaching to different programs but gdb
 did not work at any of them. 

 What to do?

 Thanks.

-
For help on using this list (especially unsubscribing), send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019