This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: patch to eliminate ADDR on loading symbols of Linux module
- From: Daniel Jacobowitz <drow at false dot org>
- To: Caz Yokoyama <cazyokoyama at gmail dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Thu, 24 Sep 2009 16:16:44 -0400
- Subject: Re: patch to eliminate ADDR on loading symbols of Linux module
- References: <4D3A256890A9458FB055F19527A022A2@xpjpn>
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