Patchwork [01/25] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c

login
register
mail settings
Submitter Yao Qi
Date June 13, 2017, 8:07 a.m.
Message ID <86a85ce2f2.fsf@gmail.com>
Download mbox | patch
Permalink /patch/20980/
State New
Headers show

Comments

Yao Qi - June 13, 2017, 8:07 a.m.
"Maciej W. Rozycki" <macro@imgtec.com> writes:

>  Can you please wrap the commit description such that it does not go past 
> 80th column?  Bear in mind that GIT indents by 4 characters, but if you 
> stick to our general 74-column rule for text you'll be good.
>

OK, I adjust the line width in the commit log.  Patch below is pushed.

Patch

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 2956819..c2bceeb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,16 @@ 
+2017-06-13  Yao Qi  <yao.qi@linaro.org>
+
+	* mips-linux-nat.c: Move include features/mips*-linux.c to
+	mips-linux-tdep.c.
+	(_initialize_mips_linux_nat): Move initialize_tdesc_mips* calls
+	to mips-linux-tdep.c.
+	* mips-linux-tdep.c: Include features/mips*-linux.c
+	(_initialize_mips_linux_tdep): Call initialize_tdesc_mips*
+	functions.
+	* mips-linux-tdep.h (tdesc_mips_linux): Declare.
+	(tdesc_mips_dsp_linux, tdesc_mips64_linux): Declare.
+	(tdesc_mips64_dsp_linux): Declare.
+
 2017-06-12  Tom Tromey  <tom@tromey.com>
 
 	* valprint.h (val_print_type_code_int): Remove.
diff --git a/gdb/mips-linux-nat.c b/gdb/mips-linux-nat.c
index 8041d84..1fd3365 100644
--- a/gdb/mips-linux-nat.c
+++ b/gdb/mips-linux-nat.c
@@ -38,11 +38,6 @@ 
 
 #include "nat/mips-linux-watch.h"
 
-#include "features/mips-linux.c"
-#include "features/mips-dsp-linux.c"
-#include "features/mips64-linux.c"
-#include "features/mips64-dsp-linux.c"
-
 #ifndef PTRACE_GET_THREAD_AREA
 #define PTRACE_GET_THREAD_AREA 25
 #endif
@@ -803,10 +798,4 @@  triggers a breakpoint or watchpoint."),
 
   linux_nat_add_target (t);
   linux_nat_set_new_thread (t, mips_linux_new_thread);
-
-  /* Initialize the standard target descriptions.  */
-  initialize_tdesc_mips_linux ();
-  initialize_tdesc_mips_dsp_linux ();
-  initialize_tdesc_mips64_linux ();
-  initialize_tdesc_mips64_dsp_linux ();
 }
diff --git a/gdb/mips-linux-tdep.c b/gdb/mips-linux-tdep.c
index ccfdcdf..f144a2e 100644
--- a/gdb/mips-linux-tdep.c
+++ b/gdb/mips-linux-tdep.c
@@ -40,6 +40,11 @@ 
 #include "xml-syscall.h"
 #include "gdb_signals.h"
 
+#include "features/mips-linux.c"
+#include "features/mips-dsp-linux.c"
+#include "features/mips64-linux.c"
+#include "features/mips64-dsp-linux.c"
+
 static struct target_so_ops mips_svr4_so_ops;
 
 /* This enum represents the signals' numbers on the MIPS
@@ -1739,4 +1744,10 @@  _initialize_mips_linux_tdep (void)
 			      GDB_OSABI_LINUX,
 			      mips_linux_init_abi);
     }
+
+  /* Initialize the standard target descriptions.  */
+  initialize_tdesc_mips_linux ();
+  initialize_tdesc_mips_dsp_linux ();
+  initialize_tdesc_mips64_linux ();
+  initialize_tdesc_mips64_dsp_linux ();
 }
diff --git a/gdb/mips-linux-tdep.h b/gdb/mips-linux-tdep.h
index 407b577..cca4798 100644
--- a/gdb/mips-linux-tdep.h
+++ b/gdb/mips-linux-tdep.h
@@ -105,3 +105,9 @@  enum {
 /* Return 1 if MIPS_RESTART_REGNUM is usable.  */
 
 int mips_linux_restart_reg_p (struct gdbarch *gdbarch);
+
+/* Target descriptions.  */
+extern struct target_desc *tdesc_mips_linux;
+extern struct target_desc *tdesc_mips64_linux;
+extern struct target_desc *tdesc_mips_dsp_linux;
+extern struct target_desc *tdesc_mips64_dsp_linux;