This is the mail archive of the gdb-patches@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: [PATCH/RFA] Don't gdbarch_init for core files


> -  set_gdbarch_from_file (core_bfd);
>> > +  /* If the core's arch is known and different from the current,
>> > +     reinitialize gdbarch based on the core file.  */
>> > +
>> > +  current_arch_info = gdbarch_bfd_arch_info (current_gdbarch);
>> > +  if (core_bfd->arch_info->arch != bfd_arch_unknown
>> > +      && core_bfd->arch_info->arch != current_arch_info->arch)
>> > +    set_gdbarch_from_file (core_bfd);
> 
>> 
>> is [almost] no different to deleting the call - GDB isn't yet built with
>> multiple architectures so the two architectures will always be identical.
> 
> 
> Will they?  What if, for instance, gdb defaults to sparc32, but
> the corefile is sparc64?

The bfd_arch_sparc would be the same in both cases but bfd_mach... would 
be different.

Any way my bfd_arch_compatible() suggestion has a bug mind:

const bfd_arch_info_type *
bfd_arch_get_compatible PARAMS ((
     const bfd *abfd,
     const bfd *bbfd));

A new interface would be needed.

Andrew



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