This is the mail archive of the gdb@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Symbol reference strangeness


On Thu, Mar 06, 2003 at 02:57:14PM -0500, Bruce Ashfield wrote:
> Hi,
> 
> Shoot. I was hoping they were similar, hard to tell with those
> search results. Here is the additional information, I'll see if
> I can put together a testcase, but I'm suspicious that part of
> the problem is due to the sizes of our images.
> 
> > I'd need a testcase to be able to help much.  Is that the right or
> > wrong address?  What does p &debugLevel say?  Where is it actually 
> > located?   
> 
> ----------
> 
> > powerpc-eabi-gdb /local/ashfield/SW5000/swy/images/ccp_dbg_nopt_nin_v.img
> GNU gdb 5.3
> Copyright 2002 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB.  Type "show warranty" for details.
> This GDB was configured as "--host=i686-pc-linux-gnu --target=powerpc-eabi"...
> (gdb)  p /x debugLevel
> $1 = 0xfffffff
> (gdb)  p &debugLevel
> $2 = (Uint32 *) 0x778e4
> (gdb) p sealKernelMaxConsecutiveCt_g
> $3 = 3
> (gdb) p &sealKernelMaxConsecutiveCt_g
> $4 = (Uint32 *) 0x77848
> (gdb) p /x debugLevel
> Cannot access memory at address 0x40249fc0
> (gdb) p &debugLevel
> $5 = (Uint32 *) 0x40249fc0
> 
> --------
> 
> Very strange indeed. The address is getting corrupted and I'm at a loss
> to explain it. This problem didn't pop up with the gcc-3.0 and older
> gdb's, which isn't that much of a surpise, with the amount of diffs.
> 
> The two variables that I'm accessing are compiled in different parts
> of the system, placed in different static libraries and linked into
> the final image. Once I've crossed the boundary from the .a that is 
> holding debugLevel to the one with sealKernelMaxConsecutiveCt_g, there
> seems to be no way back.
> 
> Let me know what else I can provide (I'll work on that testcase).

Hrm, what's the link map for this thing look like (roughly)?  If the
two are in different parts of the system then why are they only 0x90
bytes or so apart initially?

You're on an intel-linux host; could you try using valgrind (just
google for it) on GDB to see if it shows anything interesting?


-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]