From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 29564 invoked by alias); 16 Jan 2011 02:56:13 -0000 Received: (qmail 29555 invoked by uid 22791); 16 Jan 2011 02:56:12 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,TW_NW,TW_QE,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from csmailer.cs.nctu.edu.tw (HELO csmailer.cs.nctu.edu.tw) (140.113.235.130) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Jan 2011 02:56:01 +0000 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 33987CFE; Sun, 16 Jan 2011 10:58:32 +0800 (CST) Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 2CBCDCFD; Sun, 16 Jan 2011 10:58:32 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.4/8.14.4/Submit) id p0G2twq7061336; Sun, 16 Jan 2011 10:55:58 +0800 (CST) (envelope-from chenwj) Date: Sun, 16 Jan 2011 02:56:00 -0000 From: =?utf-8?B?6Zmz6Z+L5Lu7?= To: Michael Snyder Cc: =?utf-8?B?6Zmz6Z+L5Lu7?= , "gdb@sourceware.org" Subject: Re: How to run gdb with LD_PRELOAD? Message-ID: <20110116025558.GA60714@cs.nctu.edu.tw> References: <20110115144525.GD44658@cs.nctu.edu.tw> <4D322AC5.2020509@vmware.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4D322AC5.2020509@vmware.com> User-Agent: Mutt/1.5.21 (2010-09-15) 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-01/txt/msg00063.txt.bz2 Hi, Michael > (gdb) set environment LD_PRELOAD=3D/path/to/libfoo.so qemu -U LD_PRELOAD > (gdb) run Thanks for your reply. I actually use qemu as an emulator to run a program like "a.out". And the LD_PRELOAD is for qemu not the a.out. I did what you said, but gdb gave me the error below, ERROR: ld.so: object '/nfs_home/chenwj/tools/bin/qemu-i386' from LD_PRELOAD= cannot be preloaded: ignored. ERROR: ld.so: object '-U' from LD_PRELOAD cannot be preloaded: ignored. ERROR: ld.so: object 'LD_PRELOAD' from LD_PRELOAD cannot be preloaded: igno= red. Inconsistency detected by ld.so: rtld.c: 757: init_tls: Assertion `i =3D=3D= _rtld_local._dl_tls_max_dtv_idx' failed! During startup program exited with code 127. Regards, chenwj --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Parallel Processing Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667