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: Alpha completely broken: build_regcache never called


> On Thu, Apr 04, 2002 at 12:15:04AM -0500, Andrew Cagney wrote:
> 
>> >I believe this patch is responsible:
>> >
>> >2002-03-20  Martin M. Hunt  <hunt@redhat.com>
>> >
>> >* regcache.c (_initialize_regcache): No need to call
>> > build_regcache() at this time; it gets called whenever
>> > the gdbarch changes.
>> >
>> >Alpha is completely non-multi-arch.  Thus the gdbarch appears to never
>> >change, and we crash very quickly.
> 
>> 
>> When non-multi-arch, that function should still be called via:
>> 
>> initialize_non_multiarch ();
>> 
>> is this not happening?
> 
> 
> That function only initializes things created with
> register_gdbarch_data... not register_gdbarch_swap.  Adding a call to
> init_gdbarch_swap (&startup_gdbarch) in initialize_non_multiarch causes
> it to be called.  Is that correct?

Er, yes :-(  Does it ``work'' (between the other two functions to match 
gdbarch_update_p())?

There could be a problem (memory leak, NULL test?) if code is doing the 
sequence:

	_initialize_foo()
	  -> build_foo()
	....
	_initialize_non_multiarch()
	  -> init_gdbarch_swap()
	    -> build_foo ()

but I think I can live with that (with liberal commenting :-) as it is 
the non-multi-arch case.

This looks to also be a partial fix to gdb/438.  The underlying problem 
is still there but this further improves things.

Andrew


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