From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17554 invoked by alias); 22 Oct 2010 15:39:06 -0000 Received: (qmail 17542 invoked by uid 22791); 22 Oct 2010 15:39:04 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mail.codesourcery.com (HELO mail.codesourcery.com) (38.113.113.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 22 Oct 2010 15:38:57 +0000 Received: (qmail 16618 invoked from network); 22 Oct 2010 15:38:55 -0000 Received: from unknown (HELO orlando.localnet) (pedro@127.0.0.2) by mail.codesourcery.com with ESMTPA; 22 Oct 2010 15:38:55 -0000 From: Pedro Alves To: Salvatore Lionetti Subject: Re: [GDB] Re: About break and run-time loaded lib Date: Fri, 22 Oct 2010 15:39:00 -0000 User-Agent: KMail/1.13.2 (Linux/2.6.33-29-realtime; KDE/4.4.2; x86_64; ; ) Cc: gdb@sourceware.org References: <530805.97008.qm@web27201.mail.ukl.yahoo.com> In-Reply-To: <530805.97008.qm@web27201.mail.ukl.yahoo.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <201010221638.56458.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: 2010-10/txt/msg00091.txt.bz2 On Friday 22 October 2010 16:22:28, Salvatore Lionetti wrote: > Many thanks Pedro, you are right, work like a charme. Could in generally 'O' packet like an event? (without a request) You can send 'O' packets whenever gdb is waiting for a stop reply, and few other circustances (I'm looking at gdb/remote.c for remote_console_output calls). 'O' is mainly used as a simple remote console, so you can wire it to, say your stub's or your program's debug printf output. > > Now i've a less trivial problem (surely due to my ignorance): > My OS load dinamically some modules, at offset different (although near) over every boot. > So target know the base address (Text/Data/Bss) > > - How could i explain to host gdb this information, when some of these library are loaded on the host? > P.S: I've already 'consumed' the 'qOffsets' packet I think you want to teach your stub about the qXfer:libraries:read packet. If you use GDB 7.2 (or mainline), gdb defaults to query the target about shared libraries using that packet. If you're using previous GDBs, you'll need to teach gdb that your target uses gdb/solib-target.c as shared library backend. (You don't need to do that in 7.2, because solib-target.c was made the default). Then, gdb will see your target's dynamically loaded modules as shared libraries, and the user can see them with "info sharedlibrary". This assumes your modules are elf or some other format gdb already groks. -- Pedro Alves