This is the mail archive of the
gdb-patches@sources.redhat.com
mailing list for the GDB project.
Re: RFC ARM multi-arch and object format detection
- From: Richard Earnshaw <rearnsha at arm dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: Richard dot Earnshaw at arm dot com
- Date: Fri, 15 Feb 2002 13:44:27 +0000
- Subject: Re: RFC ARM multi-arch and object format detection
- Organization: ARM Ltd.
- Reply-to: Richard dot Earnshaw at arm dot com
Right, I've revised the patch slightly and committed it.
The main difference is that with a flash of inspiration last night as I
was driving home from work, I realized that there is a simple way to
support the multiple ABI variants and their corresponding tdep files
without having to always link all of them into a single gdb session (you
can do if you want, but it's not required).
The new patch adds a new arm-specific gdbarch registration function
(arm_gdbarch_register_os_abi) to arm-tdep.c, using which the other arm
tdep files can register their ability to handle that ABI variant. ABI
detection is still handled by the common code -- a design decision which I
think is correct, but can be changed at a later date.
It is acceptable for a tdep file to register the ability to handle more
than one abi variant, but it is not acceptable to have more than one tdep
file trying to handle a variant.
2002-02-15 Richard Earnshaw <rearnsha@arm.com>
* arm-tdep.h (enum arm_abi): New enum.
(struct gdbarch_tdep): New structure.
(LOWEST_PC): Provide a default.
(arm_gdbarch_register_os_abi): Declare new function.
* arm-tdep.c (arm_abi_names): New array.
(process_note_abi_tag_sections): New function.
(get_elfosabi): New function.
(arm_gdbarch_register_os_abi): New function.
(arm_gdbarch_init): Try to determine the ABI of the inferior. If
support for that ABI has been built in, then call the appropriate
configuration routine. Use gdbarch_num_regs() to get the number
of registers.
(arm_dump_tdep): New function.
(arm_init_abi_eabi_v1, arm_init_abi_eabi_v2, arm_init_abi_apcs): New
place-holder functions.
(_initialize_arm_tdep): Register them.
* config/arm/tm-arm.h (LOWEST_PC): Delete.
* armnbsd-tdep.c: New file.
* Makefile.in (armnbsd-tdep.o): Add dependencies.
* config/arm/nbsd.mt (TDEPFILES): Add it.
* config/arm/tm-nbsd.h (LOWEST_PC): Delete.
* armnbsd-nat.c: Include regcache.h.
* Makefile.in (armnbsd-nat.o): Update dependency list.
* arm-tdep.c (arm_get_next_pc): Use printf_filtered for error message.