From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23913 invoked by alias); 31 Mar 2011 09:47:22 -0000 Received: (qmail 23902 invoked by uid 22791); 31 Mar 2011 09:47:21 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW X-Spam-Check-By: sourceware.org Received: from mail-vw0-f41.google.com (HELO mail-vw0-f41.google.com) (209.85.212.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 31 Mar 2011 09:47:17 +0000 Received: by vws4 with SMTP id 4so2182192vws.0 for ; Thu, 31 Mar 2011 02:47:16 -0700 (PDT) Received: by 10.52.0.198 with SMTP id 6mr3168910vdg.152.1301564836225; Thu, 31 Mar 2011 02:47:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.220.200.3 with HTTP; Thu, 31 Mar 2011 02:46:56 -0700 (PDT) In-Reply-To: <20110331084729.GA29683@host1.jankratochvil.net> References: <20110331084729.GA29683@host1.jankratochvil.net> From: Kevin Pouget Date: Thu, 31 Mar 2011 09:47:00 -0000 Message-ID: Subject: Re: GDB and LD_PRELOAD library-call interception To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable 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/msg00211.txt.bz2 oh yes, thanks, that's an interesting command ! I was wondering if there could be a way to hack this exec-wrapper to launch for instance the executable in an xterm window? personally, I don't like debugging GDB with GDB from a single terminal, so I need to do a pid-attach; "set exec-wrapper xterm" would be very conveniant for any console-based interactive program, I guess but it it possible to follow easily (two) forks? let me know if you think that the idea is interesting / feasible Cordially, Kevin On Thu, Mar 31, 2011 at 4:47 AM, Jan Kratochvil wrote: > On Thu, 31 Mar 2011 10:25:17 +0200, Kevin Pouget wrote: >> it looks like if the library is loaded twice, without any control on >> the first load ('my_init' pending breakpoint is only resolved before >> the second execution) > > See `set exec-wrapper', GDB runs a normal shell to process the startup, G= DB > traps its first exec() call. =A0Therefore LD_PRELOAD applies already on t= he > shell. > > > Regards, > Jan >