From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 740 invoked by alias); 15 Jul 2003 19:31:52 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 733 invoked from network); 15 Jul 2003 19:31:52 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 15 Jul 2003 19:31:52 -0000 Received: from drow by nevyn.them.org with local (Exim 3.36 #1 (Debian)) id 19cVWg-0005eu-00; Tue, 15 Jul 2003 15:31:50 -0400 Date: Tue, 15 Jul 2003 19:31:00 -0000 From: Daniel Jacobowitz To: Pete Huerter Cc: gdb@sources.redhat.com Subject: Re: libthread_db.so question Message-ID: <20030715193150.GA21729@nevyn.them.org> Mail-Followup-To: Pete Huerter , gdb@sources.redhat.com References: <3F14560A.7B1280AF@st.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3F14560A.7B1280AF@st.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2003-07/txt/msg00172.txt.bz2 On Tue, Jul 15, 2003 at 12:29:14PM -0700, Pete Huerter wrote: > Hi, > > Is it possible to use the libthread_db.so library functions to debug a > remote process and it's threads? I.e. must the client of > libthread_db.so be running on the same host as the target process > itself? > > The debugger I work on currently controls remote processes via a > ptrace-based remote debug server. It seems that with the coming of > RedHat 9.0 the old linuxthreads interface that we are currently using is > deprecated, forcing us to move to using libthread_db.so instead. The > debugger can debug a distributed (MPI-based) multi-threaded > (linuxthread-based OpenMP) program. It uses a remote debug server to > control and inspect each remote node. Must libthread_db.so be loaded by > each remote debug server? or can the debugger load a single > libthread_db.so and use it's facilities to control the remote processes > (if a proc_service interface is implemented to them using the low level > (remote) ptrace-based interface of the remote debug server). > > >From reading the man pages on libthread_db.so: > > "libthread_db relies on an "agent thread" in the target process for some > of its operations. The "agent thread" is a system thread started when > libthread_db attaches to a process through td_ta_new(3T) ." > > Is an agent thread created for each target process? Is the agent thread > a child thread of each target process? > > I realize this is a specialized question. If there is a better place to > direct this question, please let me know. I imagine you could load libthread_db on the host. However, it's slower, and it requires that the host be running the same glibc version as the target. That's why gdbserver loads libthread_db on the target instead. The ps_* facilities required by libthread_db are quite minimal. The only heavy one is symbol lookup; we use a callback to the client for that. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer