This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[PATCH, M68K] Fix initialization
- From: Maxim Kuvyrkov <maxim at codesourcery dot com>
- To: gdb-patches at sourceware dot org
- Cc: Daniel Jacobowitz <dan at codesourcery dot com>
- Date: Tue, 17 Nov 2009 15:32:59 +0300
- Subject: [PATCH, M68K] Fix initialization
- References: <4B029388.5070001@codesourcery.com>
Hi,
This patch makes m68k_gdbarch_init reuse previous initialization if
there is one; this is quite similar to what other targets do.
OK to apply?
Regards,
--
Maxim Kuvyrkov
CodeSourcery
maxim@codesourcery.com
(650) 331-3385 x724
2009-11-17 Daniel Jacobowitz <dan@codesourcery.com>
* m68k-tdep.c (m68k_gdbarch_init): Reuse previous initialization.
gdb/m68k-tdep.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/gdb/m68k-tdep.c b/gdb/m68k-tdep.c
index dcf8779..e6a4177 100644
--- a/gdb/m68k-tdep.c
+++ b/gdb/m68k-tdep.c
@@ -1160,6 +1160,13 @@ m68k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches)
break;
}
+ if (best_arch != NULL)
+ {
+ if (tdesc_data != NULL)
+ tdesc_data_cleanup (tdesc_data);
+ return best_arch->gdbarch;
+ }
+
tdep = xzalloc (sizeof (struct gdbarch_tdep));
gdbarch = gdbarch_alloc (&info, tdep);
tdep->fpregs_present = has_fp;