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]

Re: solib.c: solib_extract_address??


Kevin Buettner wrote:
> 
> Could someone explain SOLIB_EXTRACT_ADDRESS / solib_extract_address() in
> solib.c to me?

You mean what is it for?  It takes an integer-like thing 
that is stored in a target data structure and turns it into 
a target address.

> [...]

> Now look carefully at the following statement:
> 
>   return extract_address (memberp, bfd_elf_get_arch_size (exec_bfd) / 8);
> 
> How exactly is this supposed to work?  It looks to me like we're going to
> be always passing the same size for a give architecture without regard
> to the actual size of the data in question, right? 

No... we're going to be passing the "arch size" as extracted by bfd
from the exec_bfd file.  On Sparc/Solaris, this may be 32 or 64.
Which makes a difference in how an address is stored in the target
data structure.


> Anyway, the above code loses for sparc-sun-sunos4.1.4.  When I revert
> it to the 1.20 version of things, it works fine on this platform...

Yeah, but then it would lose for Sparc64 Solaris.
So why and in what way does it lose on sparc-sun-sunos4.1.4?


> I think this code either needs to be reverted in the repository or revised
> so that it will do the right thing (whatever that happens to be).

Well, please don't revert it.  Let's figure out what's wrong
that it doesn't work on Sunos 4.

Michael

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