On Apr 7, 6:58pm, Douglas Kilpatrick wrote:
> I can see globals of the kernel, its globals of a module that I can not
> see. In this case I think I'm getting a different global than I thought
> I was getting. In other cases I get "No symbol 'foo' in current context."
Ah, you're working with modules. I am not an expert here, but I believe
changes are necessary to both kgdb and to gdb in order to see all module
symbols correctly. Those changes are in the latest 2.3 version of kgdb, I
think. Amit Kale had a patch that worked on gdb, but I don't know if it
was ever included in the gdb source. I will include some excerpts from
emails that were exchanged on this subject:
Mail 1:
<some header stuff deleted>
Date: Wed, 12 Jan 2000 10:36:20 -0600
From: David Grothe <dave@xxxxxxxx>
Reply-To: dave@xxxxxxxx
<more header stuff deleted>
"Amit S. Kale" wrote:
<stuff deleted>
> 2. If you find module address and give it to gdb, gdb takes it as start of
text
> segment and may or may not calculate addresses in data and bss segments
> correctly while doint relocating symbols. A workaround for this is to do
> relocations using ld and tell gdb not to do relocations. gdb needs to be
> patched for this.
I just ran into this same problem. I am glad that you have found it and fixed
it.
I will integrate your fixes. If we need to patch gdb itself I think that I
will
place a copy of the patched gdb on our FTP site in the same directory as kgdb
to
make it easy for users.
Any chance that your changes will make it into a future "official" version of
gdb?
<rest deleted>
Mail 2 (similar parts deleted as in previous mail):
From: "Amit S. Kale" <akale@xxxxxxxxxxx>
Organization: Veritas Software (India)
To: David Grothe <dave@xxxxxxxx>
Subject: Re: kgdb-2.3.38 [ Re: kgdb-2.3.35 ]
Date: Fri, 14 Jan 2000 11:28:53 +0530
Cc: Scott Foehner <sfoehner>, Andrea Arcangeli <andrea@xxxxxxx>
Hi,
On Wed, 12 Jan 2000, David Grothe wrote:
> [snip]
> Any chance that your changes will make it into a future "official" version of
gdb?
I wanted to make a patch for current snapshot of gdb. But it already
includes different semantics for add-symbol-file at address -1.
I'll look into this problem make a patch for current snapshot of gdb.
I'll inform you when I post a patch to gdb-patches mailing list.
--------------
Unfortunately, I can't be of much more help than that. I believe it is
possible to do kgdb debugging on modules in 2.3. I don't know about 2.2,
though. You might want to ask Amit Kale, who seems to be a gdb expert,
or David Grothe, who is the maintainer of the kgdb patch, what the status
of debugging modules with kgdb is.
Scott
--
Scott Foehner SGI
sfoehner@xxxxxxxxxxxx Computer Systems Business Unit
650-933-3473 Core OS
|