From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7637 invoked by alias); 24 Sep 2009 20:16:53 -0000 Received: (qmail 7629 invoked by uid 22791); 24 Sep 2009 20:16:52 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 24 Sep 2009 20:16:47 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id 064A410DCE; Thu, 24 Sep 2009 20:16:52 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id D082F105BF; Thu, 24 Sep 2009 20:16:51 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1Mquk8-00088D-KM; Thu, 24 Sep 2009 16:16:44 -0400 Date: Thu, 24 Sep 2009 20:16:00 -0000 From: Daniel Jacobowitz To: Caz Yokoyama Cc: gdb-patches@sourceware.org Subject: Re: patch to eliminate ADDR on loading symbols of Linux module Message-ID: <20090924201644.GA30712@caradoc.them.org> Mail-Followup-To: Caz Yokoyama , gdb-patches@sourceware.org References: <4D3A256890A9458FB055F19527A022A2@xpjpn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4D3A256890A9458FB055F19527A022A2@xpjpn> User-Agent: Mutt/1.5.20 (2009-06-14) X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-09/txt/msg00758.txt.bz2 On Thu, Sep 24, 2009 at 01:11:02PM -0700, Caz Yokoyama wrote: > Hello, > When we debug a loadable module of Linux kernel, we use the command, > add-symbol-file to read its symbols. We have to specify its loaded address > like > (gdb) add-symbol-file drivers/net/e1000e/e1000e.ko 0xfffffffffa008000 > The address is appeared in /proc/modules. Someone said several months ago > that the address is taken by python script. But I don't know how. Therefore, > I did by my way. I want to make this fully automatic. But if you're going to keep using add-symbol-file, it's not hard to do this automatically from a script without having to rebuild GDB. Yes, you have to use the new Python interface. Have the script search the module list and then issue an appropriate gdb.execute(). ... Except you'd need gdb.parse_and_eval, wouldn't you. Tom, that missed 7.0, I guess? I firmly maintain that GDB should not have code baked into it that knows about the layout of the Linux kernel. That's impossible to maintain. -- Daniel Jacobowitz CodeSourcery