From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7400 invoked by alias); 16 Jan 2011 00:52:58 -0000 Received: (qmail 7392 invoked by uid 22791); 16 Jan 2011 00:52:58 -0000 X-SWARE-Spam-Status: No, hits=-0.9 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MIME_CHARSET_FARAWAY,RCVD_IN_DNSWL_LOW,TW_NW,TW_QE X-Spam-Check-By: sourceware.org Received: from mail-wy0-f169.google.com (HELO mail-wy0-f169.google.com) (74.125.82.169) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 16 Jan 2011 00:52:53 +0000 Received: by wyj26 with SMTP id 26so4108592wyj.0 for ; Sat, 15 Jan 2011 16:52:51 -0800 (PST) Received: by 10.216.82.68 with SMTP id n46mr1860134wee.90.1295139169817; Sat, 15 Jan 2011 16:52:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.182.206 with HTTP; Sat, 15 Jan 2011 16:52:29 -0800 (PST) In-Reply-To: <20110115144525.GD44658@cs.nctu.edu.tw> References: <20110115144525.GD44658@cs.nctu.edu.tw> From: Hui Zhu Date: Sun, 16 Jan 2011 00:52:00 -0000 Message-ID: Subject: Re: How to run gdb with LD_PRELOAD? To: =?UTF-8?B?6Zmz6Z+L5Lu7?= Cc: gdb@sourceware.org Content-Type: text/plain; charset=Big5 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/msg00062.txt.bz2 http://sourceware.org/gdb/current/onlinedocs/gdb/Environment.html#Environme= nt On Sat, Jan 15, 2011 at 22:45, =B3=AF=AD=B3=A5=F4 wrote: > Hi, all > > I have a program using LD_PRELOAD. The program should be run like > this, "LD_PRELOAD=3D/path/to/libfoo.so qemu -U LD_PRELOAD a.out", if > without gdb. > > Here are what I did while running gdb. > > -------------------------------------------------------------------- > $ gdb > (gdb) set environment LD_PRELOAD=3D/path/to/libfoo.so > (gdb) file qemu > (gdb) r -U LD_PRELOAD a.out > -------------------------------------------------------------------- > > But gdb gave me the error below, > > ERROR: ld.so: object '/nfs_home/chenwj/lib/libdbo.so' from LD_PRELOAD can= not be preloaded: ignored. > > Any suggestion appreciated. > > Regards, > chenwj > > -- > Wei-Ren Chen (=B3=AF=AD=B3=A5=F4) > Parallel Processing Lab, Institute of Information Science, > Academia Sinica, Taiwan (R.O.C.) > Tel:886-2-2788-3799 #1667 >