From owner-freebsd-questions@FreeBSD.ORG Wed Sep 6 13:18:13 2006 Return-Path: X-Original-To: freebsd-questions@freebsd.org Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 643AD16A4DF for ; Wed, 6 Sep 2006 13:18:13 +0000 (UTC) (envelope-from a@zeos.net) Received: from jan.ukrtel.net (jan.ukrtel.net [195.5.6.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id B855643D4C for ; Wed, 6 Sep 2006 13:18:12 +0000 (GMT) (envelope-from a@zeos.net) Received: from 141-43-207-82.pool.ukrtel.net ([82.207.43.141] helo=localhost.my.domain) by jan.ukrtel.net with esmtpa (Exim 4.63) (envelope-from ) id 1GKxGD-0002G7-BO for freebsd-questions@freebsd.org; Wed, 06 Sep 2006 16:18:10 +0300 Received: from localhost.my.domain (localhost [127.0.0.1]) by localhost.my.domain (8.13.7/8.13.6) with ESMTP id k86DFSbK002221 for ; Wed, 6 Sep 2006 16:15:28 +0300 (EEST) (envelope-from a@zeos.net) Received: (from elisej@localhost) by localhost.my.domain (8.13.7/8.13.6/Submit) id k86DFR0A002220 for freebsd-questions@freebsd.org; Wed, 6 Sep 2006 16:15:27 +0300 (EEST) (envelope-from a@zeos.net) Date: Wed, 6 Sep 2006 16:15:27 +0300 From: a@zeos.net To: freebsd-questions@freebsd.org Message-ID: <20060906131527.GA2027@localhost> Mail-Followup-To: freebsd-questions@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: mutt-ng/devel-r581 (FreeBSD) Subject: gdb does not want to attach to a primitive process X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Sep 2006 13:18:13 -0000 Subject: gdb does not want to attach to a primitive process I have written the next program: // foo.c #include int main(void) { sleep(30); return 0; } compiled it with cc -g -o foo foo.c then run it with ./foo then switched to another tty and tried to attach to the process: --- begin of screenshot --- [elisej@localhost ~/Programming]$ ps PID TT STAT TIME COMMAND ............... 2160 v5 S+ 0:00.00 ./foo ............... [elisej@localhost ~/Programming]$ gdb GNU gdb 6.1.1 [FreeBSD] Copyright 2004 Free Software Foundation, Inc. GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. There is absolutely no warranty for GDB. Type "show warranty" for details. This GDB was configured as "i386-marcel-freebsd". (gdb) attach 2160 Attaching to process 2160 /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/solib-svr4.c:1443: internal-error: legacy_fetch_link_map_offsets called without legacy link_map support enabled. A problem internal to GDB has been detected, further debugging may prove unreliable. Quit this debugging session? (y or n) y /usr/src/gnu/usr.bin/gdb/libgdb/../../../../contrib/gdb/gdb/solib-svr4.c:1443: internal-error: legacy_fetch_link_map_offsets called without legacy link_map support enabled. A problem internal to GDB has been detected, further debugging may prove unreliable. Create a core file of GDB? (y or n) y Abort trap: 6 (core dumped) --- end of screenshot --- ttyv5 (were ./foo was running) reads the following: --- begin of screenshot --- [elisej@localhost ~/Programming]$ ./foo Killed: 9 --- end of screenshot --- Is this program too difficult to gdb? Elisej Babenko