From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19655 invoked by alias); 4 Apr 2008 11:39:15 -0000 Received: (qmail 19628 invoked by uid 22791); 4 Apr 2008 11:39:14 -0000 X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (65.74.133.4) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 04 Apr 2008 11:38:56 +0000 Received: (qmail 13260 invoked from network); 4 Apr 2008 11:38:54 -0000 Received: from unknown (HELO orlando.local) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 4 Apr 2008 11:38:54 -0000 From: Pedro Alves To: gdb@sourceware.org Subject: Re: qXfer:libraries:read Date: Fri, 04 Apr 2008 12:31:00 -0000 User-Agent: KMail/1.9.6 (enterprise 0.20070907.709405) Cc: gdb@semi-evolved.org References: <004701c89637$228665a0$679330e0$@org> In-Reply-To: <004701c89637$228665a0$679330e0$@org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200804041238.54832.pedro@codesourcery.com> 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: 2008-04/txt/msg00041.txt.bz2 A Friday 04 April 2008 10:34:50, gdb@semi-evolved.org wrote: > Hi, > > I'm using GDB 6.8.5.20080320 (because it has bug fixes that I need), to > debug using the remote protocol. > > I have written a version of gdbserver for my remote target (ELF on x86), > which supports the qXfer:libraries:read packet. GDB is compiled with > target=i686-linux-elf. > > GDB reports that support for the packet is switched on: > > (gdb) > show remote library-info-packet > 341-interpreter-exec console "show remote library-info-packet" > Support for the `qXfer:libraries:read' packet is currently enabled. > After the process being debugged loads a library, the target reports a stop > event: > > $T05thread:00000f10;library:XXX;#cf > > However, GDB never asks for the list of loaded libraries. > > Should this work, or does the cygwin port of GDB not support this feature? > > If the latter, would it be possible for someone to point me at the part of > the source I need to update to get it working? > A gdb build as --target=i686-linux-elf doesn't know how to fetch the shared libs using qXfer:libraries:read. You're talking about gdbserver, so I take it you have a full blown OS, so probably you're going to need to add smarts to gdb sooner or later. So, on the GDB side, you'll need to add basic support for your target. Make sure your target configuration links in solib-target.c, and that its -tdep.c file registers solib_target_so_ops as solib_ops handler. You may want to look at i368-cygwin-tdep.c for an example. Minimally, you'd add the triplet of your OS in the relevant configure.* and config.* files so you can build with e.g: --target=i386-unknown-myosname. In gdb/ you'd add a i386-myosname-tdep.c, and in it, you'd add an i386_myosname_osabi_sniffer, an i386_my_osname_init_abi and an _initialize_i386_myosname_tdep routines. -- Pedro Alves