From: Daniel Jacobowitz <drow@mvista.com>
To: Michal Ludvig <mludvig@suse.cz>
Cc: GDB Patches <gdb-patches@sources.redhat.com>
Subject: Re: [RFA] Find the most specific symtab
Date: Mon, 20 Oct 2003 14:31:00 -0000 [thread overview]
Message-ID: <20031020143057.GA29121@nevyn.them.org> (raw)
In-Reply-To: <3F93F058.5060104@suse.cz>
On Mon, Oct 20, 2003 at 04:25:28PM +0200, Michal Ludvig wrote:
> Hi,
> when debugging modules in linux kernel one must load symtab from each
> module using add-symbol-file command. However find_pc_sect_psymtab()
> returns with the first, usually less specific entry among all psymtabs
> instead of the newly added one, which leads to a situation where the
> wrong source file is chosen and therefore the "next", "next", ...
> stepping is unusable.
>
> The attached patch modifies find_pc_sect_psymtab() so that it always
> returns the most specific symtab. Typical debugging session with
> verbosity tured on now looks like:
> $ ./gdb /share/linux-2.4.21-2-mludvig/vmlinux
> GNU gdb 2003-10-20-cvs
> [...]
> (gdb) add-symbol-file /share/lkm/lkm.o 0xffa00180c0
> add symbol table from file "/share/lkm/lkm.o" at
> .text_addr = 0xffa00180c0
> (y or n) y
> Reading symbols from /share/lkm/lkm.o...done.
> (gdb) set verbose
> (gdb) l lkm_exit
> More symtabs for PC=0xffffffffa00181b0 found:
> Ignoring vsyscall.c (vmlinux) PC=0xff802c9400...0xffff60042a
> Choosing lkm.c (lkm.o) PC=0xffa00180c0...0xffa00181d9
> 55 void
> 56 lkm_exit(void)
> 57 {
> 58 printk(KERN_INFO "Exitting LKM (jiffies=%lu)...\n", jiffies);
> 59 lkm_func(jiffies);
> 60 }
> 61
> (gdb)
>
> OK for mainline? Or should there be a different approach?
I'm undecided on whether this patch is a good idea. The best solution
would be to replace texthigh/textlow with a data structure representing
ranges - Jim's posted some suggestions in the past on how to do this,
but it's quite a lot of work.
If this patch goes in please add a comment explaining that it is working
around bugs in the symtab readers and representation.
I don't know how this would affect overlay debugging. I don't suppose
any of our simulators are capable of overlays?
--
Daniel Jacobowitz
MontaVista Software Debian GNU/Linux Developer
next prev parent reply other threads:[~2003-10-20 14:31 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-10-20 14:25 Michal Ludvig
2003-10-20 14:31 ` Daniel Jacobowitz [this message]
2003-10-21 0:06 ` Andrew Cagney
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20031020143057.GA29121@nevyn.them.org \
--to=drow@mvista.com \
--cc=gdb-patches@sources.redhat.com \
--cc=mludvig@suse.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox