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: build_regcache


On Thursday 14 March 2002 07:04 pm, Andrew Cagney wrote:
> > Am I misunderstanding something or does it not make sense that the
> > register cache is initialized before any architectures?  Would moving it
> > to the end of COMMON_OBS be an OK solution?
>
> It has worked up until now.  Do you have any more info?

My situation is very complicated.  I'll try to summarize in general what I 
see happening.

build_regcache()  runs through all the registers calling REGISTER_RAW_SIZE().
This normally calls generic_register_raw_size() because we don't have an arch 
registered yet. build_regcache() then allocates enough memory to handle all 
the generic registers it has seen and initializes the memory to zero.

In my case, REGISTER_RAW_SIZE is defined to call 
TYPE_LENGTH(REGISTER_VIRTUAL_SIZE(n)) and REGISTER_VIRTUAL_SIZE returns 
something like builtin_type_int, which is still uninitialized because 
_initialize_gdbtypes() has not been called yet.

I haven't checked what happens if the allocated memory for the registers is 
too small for the actual register set. Maybe it gets reallocated when the 
architecture changes. 

> I do recall that the mixture of pseudo-registers and the wrong
> combination of multi-arch and non-multi-arch register macros can be
> fatal.

That would be one way to explain what I'm dealing with.  
-- 
Martin Hunt
GDB Engineer
Red Hat, Inc.


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