diff options
author | Alan Hayward <alan.hayward@arm.com> | 2017-11-24 10:00:54 +0000 |
---|---|---|
committer | Alan Hayward <alan.hayward@arm.com> | 2017-11-24 11:18:19 +0000 |
commit | da434ccbc3e0ed843700790cd16c1d4bb5882460 (patch) | |
tree | 06717af286e287317183ff9d739c142217180fe5 /gdb/aarch64-tdep.c | |
parent | 98ead37e9735438986934f9f1f35f020a093fe07 (diff) | |
download | binutils-gdb-da434ccbc3e0ed843700790cd16c1d4bb5882460.tar.gz |
Add aarch64_create_target_description
gdb/
* Makefile.in: Add new files.
* aarch64-linux-nat.c (aarch64_linux_read_description): Call
aarch64_read_description.
* aarch64-linux-tdep.c (aarch64_linux_core_read_description):
Call aarch64_read_description.
* aarch64-tdep.c (aarch64_read_description): New function.
(aarch64_gdbarch_init): Call aarch64_read_description.
* aarch64-tdep.h (aarch64_read_description): New function.
* arch/aarch64.c: New file.
* configure.tgt: Add new files.
Diffstat (limited to 'gdb/aarch64-tdep.c')
-rw-r--r-- | gdb/aarch64-tdep.c | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 85cabfd215c..541a909edaa 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -2828,6 +2828,20 @@ aarch64_displaced_step_hw_singlestep (struct gdbarch *gdbarch, return 1; } +/* Get the correct target description. */ + +const target_desc * +aarch64_read_description () +{ + static target_desc *aarch64_tdesc = NULL; + target_desc **tdesc = &aarch64_tdesc; + + if (*tdesc == NULL) + *tdesc = aarch64_create_target_description (); + + return *tdesc; +} + /* Initialize the current architecture based on INFO. If possible, re-use an architecture from ARCHES, which is a list of architectures already created during this debugging session. @@ -2851,7 +2865,7 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Ensure we always have a target descriptor. */ if (!tdesc_has_registers (tdesc)) - tdesc = tdesc_aarch64; + tdesc = aarch64_read_description (); gdb_assert (tdesc); |