public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Yao Qi <qiyaoltc@gmail.com>
To: "Maciej W. Rozycki" <macro@imgtec.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 01/25] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c
Date: Tue, 13 Jun 2017 08:07:00 -0000	[thread overview]
Message-ID: <86a85ce2f2.fsf@gmail.com> (raw)
In-Reply-To: <alpine.DEB.2.00.1706121619150.21750@tp.orcam.me.uk> (Maciej	W. Rozycki's message of "Mon, 12 Jun 2017 16:25:11 +0100")

"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.

-- 
Yao (齐尧)

From 032bb6eae8a0166f9b5d2eac6960383c532ef6d1 Mon Sep 17 00:00:00 2001
From: Yao Qi <yao.qi@linaro.org>
Date: Tue, 13 Jun 2017 09:05:04 +0100
Subject: [PATCH] Move initialize_tdesc_mips* calls from mips-linux-nat.c to
 mips-linux-tdep.c

All target descriptions except mips initialization are called in -tdep.c,
instead of -nat.c, so this patch moves mips target descriptions
initialization to -tdep.c.  Secondly, I want to change the target
descriptions from pre-generated to dynamical creation, so I want to test
that these pre-generated target descriptions equal to these dynamically
created ones.  Move target descriptions initialization to -tdep.c files so
we can test them in any hosts (if they are still -nat.c, we can only test
them on mips-linux host.).

gdb:

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.

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;

  reply	other threads:[~2017-06-13  8:07 UTC|newest]

Thread overview: 82+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-12  8:42 [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible Yao Qi
2017-06-12  8:42 ` [PATCH 02/25] Adjust the order of 32bit-linux.xml and 32bit-sse.xml in i386/i386-linux.xml Yao Qi
2017-06-19 20:22   ` Simon Marchi
2017-06-19 21:24     ` Pedro Alves
2017-06-19 21:48       ` Simon Marchi
2017-06-19 21:56         ` Pedro Alves
2017-06-20  9:20           ` Yao Qi
2017-06-20 10:12             ` Pedro Alves
2017-06-20 11:09               ` Yao Qi
2017-06-12  8:42 ` [PATCH 14/25] [RFC] GDBserver self test Yao Qi
2017-06-28 17:09   ` Pedro Alves
2017-06-29  9:08     ` Yao Qi
2017-06-12  8:42 ` [PATCH 20/25] Centralize amd64-linux target descriptions Yao Qi
2017-06-12  8:42 ` [PATCH 01/25] Move initialize_tdesc_mips* calls from mips-linux-nat.c to mips-linux-tdep.c Yao Qi
2017-06-12 15:25   ` Maciej W. Rozycki
2017-06-13  8:07     ` Yao Qi [this message]
2017-06-12  8:42 ` [PATCH 06/25] Generate c for feature instead of tdesc Yao Qi
2017-06-12 14:48   ` Eli Zaretskii
2017-06-13 12:07     ` Yao Qi
2017-06-13 14:49       ` Eli Zaretskii
2017-06-13 15:31         ` Yao Qi
2017-06-13 15:41           ` Eli Zaretskii
2017-06-14 16:21             ` Yao Qi
2017-06-14 16:32               ` Eli Zaretskii
2017-06-15 13:19                 ` Yao Qi
2017-06-15 14:45                   ` Eli Zaretskii
2017-06-20 10:59   ` Pedro Alves
2017-06-22 14:49     ` Yao Qi
2017-06-22 15:36       ` Pedro Alves
2017-06-22 15:58         ` Yao Qi
2017-06-26 21:38   ` Simon Marchi
2017-06-29 15:24     ` Yao Qi
2017-06-12  8:42 ` [PATCH 12/25] [GDBserver] Centralize tdesc for i386-linux Yao Qi
2017-06-12  8:42 ` [PATCH 18/25] [GDBserver] Use pre-generated tdesc as test Yao Qi
2017-06-12  8:42 ` [PATCH 25/25] Remove features/i386/amd64-*linux.c and features/i386/x32-*linux.c Yao Qi
2017-06-12  8:42 ` [PATCH 08/25] Add "maint check xml-descriptions" to test builtin xml target descriptions Yao Qi
2017-06-28 16:13   ` Pedro Alves
2017-06-12  8:42 ` [PATCH 05/25] Use visitor pattern for "maint print c-tdesc" Yao Qi
2017-06-20 23:37   ` Simon Marchi
2017-06-12  8:42 ` [PATCH 11/25] Use VEC for target_desc.reg_defs Yao Qi
2017-06-28 19:01   ` Pedro Alves
2017-06-29 11:05     ` Yao Qi
2017-06-29 11:31       ` Pedro Alves
2017-06-29 13:24         ` Yao Qi
2017-06-12  8:42 ` [PATCH 04/25] Centralize i386 linux target descriptions Yao Qi
2017-06-19 21:27   ` Simon Marchi
2017-06-12  8:42 ` [PATCH 23/25] [GDBserver] Convert amd64-linux " Yao Qi
2017-06-28 19:00   ` Pedro Alves
2017-06-12  8:42 ` [PATCH 17/25] Remove features/i386/i386-*linux.c Yao Qi
2017-06-12  8:42 ` [PATCH 15/25] [RFC] GDBserver unit test to i386_tdesc Yao Qi
2017-06-28 17:22   ` Pedro Alves
2017-06-29  9:27     ` Yao Qi
2017-06-12  8:42 ` [PATCH 22/25] Regenerate two regformats/i386/.dat files Yao Qi
2017-06-22 12:43   ` Yao Qi
2017-06-12  8:42 ` [PATCH 24/25] [GDBserver] Use pre-generated amd64-linux tdesc as test Yao Qi
2017-06-12  8:42 ` [PATCH 16/25] Dynamically composite xml in reply to GDB Yao Qi
2017-06-12  8:42 ` [PATCH 21/25] Lazily and dynamically create amd64-linux target descriptions Yao Qi
2017-06-12  8:42 ` [PATCH 13/25] Dynamically create tdesc in GDBserver Yao Qi
2017-06-12  8:42 ` [PATCH 10/25] Adjust code generated by regformats/regdat.sh Yao Qi
2017-06-20 11:09   ` Pedro Alves
2017-06-21 14:28     ` Yao Qi
2017-06-12  8:42 ` [PATCH 19/25] GDBserver: remove srv_i386_linux_xmlfiles Yao Qi
2017-06-12  8:42 ` [PATCH 03/25] Class-fy tdesc_reg tdesc_type and tdesc_feature Yao Qi
2017-06-19 20:55   ` Simon Marchi
2017-06-19 21:30   ` Simon Marchi
2017-06-20 10:31     ` Yao Qi
2017-06-12  8:42 ` [PATCH 07/25] Lazily and dynamically create i386-linux target descriptions Yao Qi
2017-06-20 11:01   ` Pedro Alves
2017-06-20 14:07     ` Yao Qi
2017-06-28 15:30       ` Pedro Alves
2017-06-12  8:42 ` [PATCH 09/25] Use target_desc fields expedite_regs and xmltarget ifndef IN_PROCESS_AGENT Yao Qi
2017-06-28 16:16   ` Pedro Alves
2017-06-28 17:42     ` Pedro Alves
2017-06-28 17:45       ` Pedro Alves
2017-06-29 11:45     ` Yao Qi
2017-06-19 19:59 ` [PATCH 00/25 V2] Make GDB builtin target descriptions more flexible Simon Marchi
2017-06-20 11:02   ` Yao Qi
2017-06-26 14:45   ` Tedeschi, Walfred
2017-06-27 13:49     ` Alan Hayward
2017-06-28  8:28       ` Yao Qi
2017-06-28  8:06     ` Yao Qi
2017-06-28 19:06 ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=86a85ce2f2.fsf@gmail.com \
    --to=qiyaoltc@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=macro@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).