From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4915 invoked by alias); 31 Mar 2011 12:16:33 -0000 Received: (qmail 4887 invoked by uid 22791); 31 Mar 2011 12:16:30 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_FD,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Mar 2011 12:16:21 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p2VCGKBi017963 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Thu, 31 Mar 2011 08:16:20 -0400 Received: from host1.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p2VCGIhx002676 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 31 Mar 2011 08:16:20 -0400 Received: from host1.jankratochvil.net (localhost [127.0.0.1]) by host1.jankratochvil.net (8.14.4/8.14.4) with ESMTP id p2VCGIUm001390; Thu, 31 Mar 2011 14:16:18 +0200 Received: (from jkratoch@localhost) by host1.jankratochvil.net (8.14.4/8.14.4/Submit) id p2VCGHAZ001385; Thu, 31 Mar 2011 14:16:17 +0200 Date: Thu, 31 Mar 2011 12:16:00 -0000 From: Jan Kratochvil To: Kevin Pouget Cc: gdb@sourceware.org Subject: Re: GDB and LD_PRELOAD library-call interception Message-ID: <20110331121617.GA32739@host1.jankratochvil.net> References: <20110331084729.GA29683@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-03/txt/msg00213.txt.bz2 On Thu, 31 Mar 2011 11:46:56 +0200, Kevin Pouget wrote: > I was wondering if there could be a way to hack this exec-wrapper to > launch for instance the executable in an xterm window? It is not such straightforward, GDB expects the PID it has spawned will be debugged while with xterm the process being debugged is its child. I guess you can write a small C helper which will: * create new pty * change its fds 0/1/2 to the slave of this pty * fork xterm -e own-helper-part pty-unique-id In own-helper-part interconnect the pty master part and its fds 0/1/2. Another way is to make fork-child.c more flexible/configurable. > but it it possible to follow easily (two) forks? Yes, `set detach-on-fork off', so-called multi-inferior mode, it has some issues on native GNU/Linux system. Regards, Jan