public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH v2 3/4] reggroups: Create reggroup_gdbarch_new for dynamic reggroups
  2017-06-10 13:59 [PATCH v2 0/4] Support for arbitrary reggroups Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 1/4] reggroups: Add test and docs for `info reg $reggroup` feature Stafford Horne
@ 2017-06-10 13:59 ` Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 2/4] reggroups: Convert reggroups from post_init to pre_init Stafford Horne
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stafford Horne @ 2017-06-10 13:59 UTC (permalink / raw)
  To: GDB patches; +Cc: Stafford Horne

Traditionally reggroups have been created via reggroup_new() during
initialization code and never freed.  Now, if we want to initialize
reggroups dynamically (i.e. in target description) we should be able to
free them.  Create this function reggroup_gdbarch_new() which will
allocate the reggroup memory onto the passed gdbarch obstack.

gdb/ChangeLog:

2017-06-10  Stafford Horne  <shorne@gmail.com>

	* reggroups.c (reggroup_gdbarch_new): New function.
	* reggroups.h (reggroup_gdbarch_new): New function.
---
 gdb/reggroups.c | 12 ++++++++++++
 gdb/reggroups.h |  4 ++++
 2 files changed, 16 insertions(+)

diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index bf40964..c7126f7 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -46,6 +46,18 @@ reggroup_new (const char *name, enum reggroup_type type)
   return group;
 }
 
+struct reggroup *
+reggroup_gdbarch_new (struct gdbarch *gdbarch, const char *name,
+		      enum reggroup_type type)
+{
+  struct reggroup *group = GDBARCH_OBSTACK_ZALLOC (gdbarch,
+						   struct reggroup);
+
+  group->name = gdbarch_obstack_strdup (gdbarch, name);
+  group->type = type;
+  return group;
+}
+
 /* Register group attributes.  */
 
 const char *
diff --git a/gdb/reggroups.h b/gdb/reggroups.h
index 18fc1bf..c1653cd 100644
--- a/gdb/reggroups.h
+++ b/gdb/reggroups.h
@@ -41,6 +41,10 @@ extern struct reggroup *const restore_reggroup;
 /* Create a new local register group.  */
 extern struct reggroup *reggroup_new (const char *name,
 				      enum reggroup_type type);
+/* Create a new register group allocated onto the gdbarch obstack.  */
+extern struct reggroup *reggroup_gdbarch_new (struct gdbarch *gdbarch,
+					      const char *name,
+					      enum reggroup_type type);
 
 /* Add a register group (with attribute values) to the pre-defined list.  */
 extern void reggroup_add (struct gdbarch *gdbarch, struct reggroup *group);
-- 
2.9.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 0/4] Support for arbitrary reggroups
@ 2017-06-10 13:59 Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 1/4] reggroups: Add test and docs for `info reg $reggroup` feature Stafford Horne
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Stafford Horne @ 2017-06-10 13:59 UTC (permalink / raw)
  To: GDB patches; +Cc: Stafford Horne

Traditionally registers have been limited to names like "vector",
"general", "system" which are hard coded in the gdbarch.  This patch allows
additional reggroups to be defined by the xml target description.

This is necessary for architectures like OpenRISC which have many
registers.

This series also adds documentation on tests for the feature of listing
register groups via the "info reg $reggroup" command.

-Stafford

--

Changes since v1
 * On 'info reg $reggroup' test and docs patch
  - Suggested by Eli - Fix changelog
  - Suggested by Simon
    > Added help text in 'help info registers'
    > Fixed 'register' typos
    > Fixed style of test program
    > Fixed copyright '2017'
    > Fixed code styles in expect
 * On 'arbitrary strings' patch
  - Suggested by Simon
    > Allow for freeing reggroups
  - Suggested by Eli
    > Add documentation for this feature

Stafford Horne (4):
  reggroups: Add test and docs for `info reg $reggroup` feature
  reggroups: Convert reggroups from post_init to pre_init
  reggroups: Create reggroup_gdbarch_new for dynamic reggroups
  tdesc: handle arbitrary strings in tdesc_register_in_reggroup_p

 gdb/NEWS                             |  4 ++
 gdb/doc/gdb.texinfo                  | 14 +++++--
 gdb/infcmd.c                         |  8 +++-
 gdb/reggroups.c                      | 27 +++++++------
 gdb/reggroups.h                      |  4 ++
 gdb/target-descriptions.c            | 74 ++++++++++++++++++------------------
 gdb/testsuite/gdb.base/reggroups.c   |  5 +++
 gdb/testsuite/gdb.base/reggroups.exp | 63 ++++++++++++++++++++++++++++++
 gdb/testsuite/gdb.xml/extra-regs.xml |  1 +
 gdb/testsuite/gdb.xml/tdesc-regs.exp |  3 ++
 10 files changed, 149 insertions(+), 54 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/reggroups.c
 create mode 100644 gdb/testsuite/gdb.base/reggroups.exp

-- 
2.9.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 2/4] reggroups: Convert reggroups from post_init to pre_init
  2017-06-10 13:59 [PATCH v2 0/4] Support for arbitrary reggroups Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 1/4] reggroups: Add test and docs for `info reg $reggroup` feature Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 3/4] reggroups: Create reggroup_gdbarch_new for dynamic reggroups Stafford Horne
@ 2017-06-10 13:59 ` Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 4/4] tdesc: handle arbitrary strings in tdesc_register_in_reggroup_p Stafford Horne
  2017-06-10 14:03 ` [PATCH v2 0/4] Support for arbitrary reggroups Eli Zaretskii
  4 siblings, 0 replies; 6+ messages in thread
From: Stafford Horne @ 2017-06-10 13:59 UTC (permalink / raw)
  To: GDB patches; +Cc: Stafford Horne

Currently the reggroups gdbarch_data cannot be manipulated until after
the gdbarch is completely initialized.  This is usually done when the
object init depends on architecture specific fields.  In the case of
reggroups it only depends on the obstack being available.

Coverting this to pre_init allows using reggroups during gdbarch
initialization.  This is needed to allow registering arbitrary reggroups
during gdbarch initializations.

gdb/ChangeLog:

2017-06-06  Stafford Horne  <shorne@gmail.com>

	* reggroups.c (reggroups_init): Change to depend only on
	obstack rather than gdbarch.
	(reggroup_add): Remove logic for forcing premature init.
	(_initialize_reggroup): Set `reggroups_data` with
	gdbarch_data_register_pre_init() rather than
	gdbarch_data_register_post_init().
---
 gdb/reggroups.c | 15 ++++-----------
 1 file changed, 4 insertions(+), 11 deletions(-)

diff --git a/gdb/reggroups.c b/gdb/reggroups.c
index ae7d4ce..bf40964 100644
--- a/gdb/reggroups.c
+++ b/gdb/reggroups.c
@@ -26,6 +26,7 @@
 #include "regcache.h"
 #include "command.h"
 #include "gdbcmd.h"		/* For maintenanceprintlist.  */
+#include "gdb_obstack.h"
 
 /* Individual register groups.  */
 
@@ -76,10 +77,9 @@ struct reggroups
 static struct gdbarch_data *reggroups_data;
 
 static void *
-reggroups_init (struct gdbarch *gdbarch)
+reggroups_init (struct obstack *obstack)
 {
-  struct reggroups *groups = GDBARCH_OBSTACK_ZALLOC (gdbarch,
-						     struct reggroups);
+  struct reggroups *groups = OBSTACK_ZALLOC (obstack, struct reggroups);
 
   groups->last = &groups->first;
   return groups;
@@ -105,13 +105,6 @@ reggroup_add (struct gdbarch *gdbarch, struct reggroup *group)
   struct reggroups *groups
     = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data);
 
-  if (groups == NULL)
-    {
-      /* ULGH, called during architecture initialization.  Patch
-         things up.  */
-      groups = (struct reggroups *) reggroups_init (gdbarch);
-      deprecated_set_gdbarch_data (gdbarch, reggroups_data, groups);
-    }
   add_group (groups, group,
 	     GDBARCH_OBSTACK_ZALLOC (gdbarch, struct reggroup_el));
 }
@@ -300,7 +293,7 @@ extern initialize_file_ftype _initialize_reggroup; /* -Wmissing-prototypes */
 void
 _initialize_reggroup (void)
 {
-  reggroups_data = gdbarch_data_register_post_init (reggroups_init);
+  reggroups_data = gdbarch_data_register_pre_init (reggroups_init);
 
   /* The pre-defined list of groups.  */
   add_group (&default_groups, general_reggroup, XNEW (struct reggroup_el));
-- 
2.9.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 4/4] tdesc: handle arbitrary strings in tdesc_register_in_reggroup_p
  2017-06-10 13:59 [PATCH v2 0/4] Support for arbitrary reggroups Stafford Horne
                   ` (2 preceding siblings ...)
  2017-06-10 13:59 ` [PATCH v2 2/4] reggroups: Convert reggroups from post_init to pre_init Stafford Horne
@ 2017-06-10 13:59 ` Stafford Horne
  2017-06-10 14:03 ` [PATCH v2 0/4] Support for arbitrary reggroups Eli Zaretskii
  4 siblings, 0 replies; 6+ messages in thread
From: Stafford Horne @ 2017-06-10 13:59 UTC (permalink / raw)
  To: GDB patches; +Cc: Stafford Horne

tdesc_register_in_reggroup_p in now able to handle arbitrary
groups. This is useful when groups are created while the
target descriptor file is received from the remote.

This can be the case of a soft core target processor where
registers/groups can change.

gdb/ChangeLog:

2017-06-06  Franck Jullien  <franck.jullien@gmail.com>
	    Stafford Horne  <shorne@gmail.com>

	* target-descriptions.c (tdesc_register_in_reggroup_p): Support
	arbitrary strings.
	* NEWS (Changes since GDB 8.0): Announce that GDB supports
	arbitrary reggroups.

gdb/testsuite/ChangeLog:

2017-06-06  Stafford Horne  <shorne@gmail.com>

	* gdb.xml/extra-regs.xml: Add example foo reggroup.
	* gdb.xml/tdesc-regs.exp: Add test to check for foo reggroup.

gdb/doc/ChangeLog:

2017-06-06  Stafford Horne  <shorne@gmail.com>

	* gdb.texinfo (Target Description Format): Explain that arbitrary
	strings are now allowed for register groups.
---
 gdb/NEWS                             |  4 ++
 gdb/doc/gdb.texinfo                  |  9 +++--
 gdb/target-descriptions.c            | 74 ++++++++++++++++++------------------
 gdb/testsuite/gdb.xml/extra-regs.xml |  1 +
 gdb/testsuite/gdb.xml/tdesc-regs.exp |  3 ++
 5 files changed, 50 insertions(+), 41 deletions(-)

diff --git a/gdb/NEWS b/gdb/NEWS
index 8dab5d3..fbe8fdb 100644
--- a/gdb/NEWS
+++ b/gdb/NEWS
@@ -3,6 +3,10 @@
 
 *** Changes since GDB 8.0
 
+* GDB now supports dynamically creating arbitrary register groups specified
+  in xml target descriptors.  This allows for finer grain grouping of
+  registers on systems with a large amount of registers.
+
 * On Unix systems, GDBserver now does globbing expansion and variable
   substitution in inferior command line arguments.
 
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index a5e4257..49694f3 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -41000,10 +41000,11 @@ architecture's normal floating point format) of the correct size for
 @var{bitsize}.  The default is @code{int}.
 
 @item group
-The register group to which this register belongs.  It must
-be either @code{general}, @code{float}, or @code{vector}.  If no
-@var{group} is specified, @value{GDBN} will not display the register
-in @code{info registers}.
+The register group to which this register belongs.  It can be one of the
+standard register groups @code{general}, @code{float}, @code{vector} or an
+arbitrary string.  The string should be limited to alphanumeric characters
+and internal hyphens.  If no @var{group} is specified, @value{GDBN} will
+not display the register in @code{info registers}.
 
 @end table
 
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 9a7e2dd..2f7503d 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -63,12 +63,11 @@ typedef struct tdesc_reg
   int save_restore;
 
   /* The name of the register group containing this register, or NULL
-     if the group should be automatically determined from the
-     register's type.  If this is "general", "float", or "vector", the
-     corresponding "info" command should display this register's
-     value.  It can be an arbitrary string, but should be limited to
-     alphanumeric characters and internal hyphens.  Currently other
-     strings are ignored (treated as NULL).  */
+     if the group should be automatically determined from the register's
+     type.  This is traditionally "general", "float", "vector" but can
+     also be an arbitrary string.  If defined the corresponding "info"
+     command should display this register's value.  The string should be
+     limited to alphanumeric characters and internal hyphens.  */
   char *group;
 
   /* The size of the register, in bits.  */
@@ -1081,17 +1080,13 @@ tdesc_remote_register_number (struct gdbarch *gdbarch, int regno)
 }
 
 /* Check whether REGNUM is a member of REGGROUP.  Registers from the
-   target description may be classified as general, float, or vector.
-   Unlike a gdbarch register_reggroup_p method, this function will
-   return -1 if it does not know; the caller should handle registers
-   with no specified group.
-
-   Arbitrary strings (other than "general", "float", and "vector")
-   from the description are not used; they cause the register to be
-   displayed in "info all-registers" but excluded from "info
-   registers" et al.  The names of containing features are also not
-   used.  This might be extended to display registers in some more
-   useful groupings.
+   target description may be classified as general, float, vector or other
+   register groups registered with reggroup_add().  Unlike a gdbarch
+   register_reggroup_p method, this function will return -1 if it does not
+   know; the caller should handle registers with no specified group.
+
+   The names of containing features are not used.  This might be extended
+   to display registers in some more useful groupings.
 
    The save-restore flag is also implemented here.  */
 
@@ -1101,26 +1096,9 @@ tdesc_register_in_reggroup_p (struct gdbarch *gdbarch, int regno,
 {
   struct tdesc_reg *reg = tdesc_find_register (gdbarch, regno);
 
-  if (reg != NULL && reg->group != NULL)
-    {
-      int general_p = 0, float_p = 0, vector_p = 0;
-
-      if (strcmp (reg->group, "general") == 0)
-	general_p = 1;
-      else if (strcmp (reg->group, "float") == 0)
-	float_p = 1;
-      else if (strcmp (reg->group, "vector") == 0)
-	vector_p = 1;
-
-      if (reggroup == float_reggroup)
-	return float_p;
-
-      if (reggroup == vector_reggroup)
-	return vector_p;
-
-      if (reggroup == general_reggroup)
-	return general_p;
-    }
+  if (reg != NULL && reg->group != NULL
+      && (strcmp (reg->group, reggroup_name (reggroup)) == 0))
+	return 1;
 
   if (reg != NULL
       && (reggroup == save_reggroup || reggroup == restore_reggroup))
@@ -1231,6 +1209,28 @@ tdesc_use_registers (struct gdbarch *gdbarch,
 	void **slot = htab_find_slot (reg_hash, reg, INSERT);
 
 	*slot = reg;
+	/* Add reggroup if its new.  */
+	if (reg->group != NULL)
+	  {
+	    struct reggroup *group;
+	    bool group_exists = false;
+
+	    for (group = reggroup_next (gdbarch, NULL);
+		 group != NULL;
+		 group = reggroup_next (gdbarch, group))
+	      {
+		if (strcmp (reg->group, reggroup_name (group)) == 0)
+		  {
+		    group_exists = true;
+		    break;
+		  }
+	      }
+
+	    if (!group_exists)
+	      reggroup_add (gdbarch, reggroup_gdbarch_new (gdbarch,
+							   reg->group,
+							   USER_REGGROUP));
+	  }
       }
 
   /* Remove any registers which were assigned numbers by the
diff --git a/gdb/testsuite/gdb.xml/extra-regs.xml b/gdb/testsuite/gdb.xml/extra-regs.xml
index 997d659..302e64c 100644
--- a/gdb/testsuite/gdb.xml/extra-regs.xml
+++ b/gdb/testsuite/gdb.xml/extra-regs.xml
@@ -53,5 +53,6 @@
     <reg name="bitfields" bitsize="64" type="struct2"/>
     <reg name="flags" bitsize="32" type="flags"/>
     <reg name="mixed_flags" bitsize="32" type="mixed_flags"/>
+    <reg name="groupreg" bitsize="32" type="uint32" group="foo"/>
   </feature>
 </target>
diff --git a/gdb/testsuite/gdb.xml/tdesc-regs.exp b/gdb/testsuite/gdb.xml/tdesc-regs.exp
index 70fc0e0..21f6fcc 100644
--- a/gdb/testsuite/gdb.xml/tdesc-regs.exp
+++ b/gdb/testsuite/gdb.xml/tdesc-regs.exp
@@ -187,6 +187,9 @@ gdb_test "ptype \$flags" \
     "type = flag flags {\r\n *bool X @0;\r\n *uint32_t Y @2;\r\n}"
 gdb_test "ptype \$mixed_flags" \
     "type = flag mixed_flags {\r\n *bool A @0;\r\n *uint32_t B @1-3;\r\n *bool C @4;\r\n *uint32_t D @5;\r\n *uint32_t @6-7;\r\n *enum {yes = 1, no = 0, maybe = 2, so} Z @8-9;\r\n}"
+# Reggroups should have at least general and the extra foo group
+gdb_test "maintenance print reggroups" \
+    " Group\[ \t\]+Type\[ \t\]+\r\n.* general\[ \t\]+user\[ \t\]+\r\n.* foo\[ \t\]+user\[ \t\]+"
 
 load_description "core-only.xml" "" "test-regs.xml"
 # The extra register from the previous description should be gone.
-- 
2.9.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH v2 1/4] reggroups: Add test and docs for `info reg $reggroup` feature
  2017-06-10 13:59 [PATCH v2 0/4] Support for arbitrary reggroups Stafford Horne
@ 2017-06-10 13:59 ` Stafford Horne
  2017-06-10 13:59 ` [PATCH v2 3/4] reggroups: Create reggroup_gdbarch_new for dynamic reggroups Stafford Horne
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Stafford Horne @ 2017-06-10 13:59 UTC (permalink / raw)
  To: GDB patches; +Cc: Stafford Horne

Until now this feature has existed but was not documented.  Adding docs
and tests.

gdb/ChangeLog:

2017-06-06  Stafford Horne  <shorne@gmail.com>

	* infcmd.c (_initialize_infcmd): Add help for info reg $reggroup
	feature.

gdb/doc/ChangeLog:

2017-06-06  Stafford Horne  <shorne@gmail.com>

	* gdb.texinfo (Registers): Document info reg $reggroup feature.

gdb/testsuite/ChangeLog:

2017-06-06  Stafford Horne  <shorne@gmail.com>

	* gdb.base/reggroups.c: New file.
	* gdb.base/reggroups.exp: New file.
---
 gdb/doc/gdb.texinfo                  |  5 +++
 gdb/infcmd.c                         |  8 +++--
 gdb/testsuite/gdb.base/reggroups.c   |  5 +++
 gdb/testsuite/gdb.base/reggroups.exp | 63 ++++++++++++++++++++++++++++++++++++
 4 files changed, 79 insertions(+), 2 deletions(-)
 create mode 100644 gdb/testsuite/gdb.base/reggroups.c
 create mode 100644 gdb/testsuite/gdb.base/reggroups.exp

diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index 8d7a1c9..a5e4257 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@@ -10879,6 +10879,11 @@ and vector registers (in the selected stack frame).
 Print the names and values of all registers, including floating-point
 and vector registers (in the selected stack frame).
 
+@item info registers @var{reggroup} @dots{}
+Print the name and value of the registers in each of the specified
+@var{reggroup}.  The @var{reggoup} can be any of those returned by
+@code{maint print reggroups}.
+
 @item info registers @var{regname} @dots{}
 Print the @dfn{relativized} value of each specified register @var{regname}.
 As discussed in detail below, register values are normally relative to
diff --git a/gdb/infcmd.c b/gdb/infcmd.c
index 09060b5..145f317 100644
--- a/gdb/infcmd.c
+++ b/gdb/infcmd.c
@@ -3423,13 +3423,17 @@ interrupt all running threads in non-stop mode, use the -a option."));
 
   c = add_info ("registers", nofp_registers_info, _("\
 List of integer registers and their contents, for selected stack frame.\n\
-Register name as argument means describe only that register."));
+Register name as argument means describe only that register.\n\
+Register group name as argument means describe the registers in the\n\
+named register group."));
   add_info_alias ("r", "registers", 1);
   set_cmd_completer (c, reg_or_group_completer);
 
   c = add_info ("all-registers", all_registers_info, _("\
 List of all registers and their contents, for selected stack frame.\n\
-Register name as argument means describe only that register."));
+Register name as argument means describe only that register.\n\
+Register group name as argument means describe the registers in the\n\
+named register group."));
   set_cmd_completer (c, reg_or_group_completer);
 
   add_info ("program", program_info,
diff --git a/gdb/testsuite/gdb.base/reggroups.c b/gdb/testsuite/gdb.base/reggroups.c
new file mode 100644
index 0000000..8e8f518
--- /dev/null
+++ b/gdb/testsuite/gdb.base/reggroups.c
@@ -0,0 +1,5 @@
+int
+main()
+{
+  return 0;
+}
diff --git a/gdb/testsuite/gdb.base/reggroups.exp b/gdb/testsuite/gdb.base/reggroups.exp
new file mode 100644
index 0000000..c10f025
--- /dev/null
+++ b/gdb/testsuite/gdb.base/reggroups.exp
@@ -0,0 +1,63 @@
+# This testcase is part of GDB, the GNU debugger.
+
+# Copyright 2017 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+# Test listing reggroups and the registers in each group.
+
+standard_testfile
+
+if {[prepare_for_testing "failed to prepare" $testfile $srcfile debug]} {
+    return -1
+}
+
+if ![runto_main] then {
+    fail "can't run to main"
+    return 0
+}
+
+proc fetch_reggroups {test} {
+    global gdb_prompt
+    global expect_out
+
+    set reggroups {}
+    gdb_test_multiple "maint print reggroups" "get reggroups" {
+	-re "maint print reggroups\r\n" {
+	    exp_continue
+	}
+	-re "^ Group\[ \t\]+Type\[ \t\]+\r\n" {
+	    exp_continue
+	}
+	-re "^ (\[0-9a-zA-Z\-\]+)\[ \t\]+(user|internal)\[ \t\]+\r\n" {
+	    lappend reggroups $expect_out(1,string)
+	    exp_continue
+	}
+	-re ".*$gdb_prompt $" {
+	    if { [llength $reggroups] != 0 } {
+		pass $test
+	    } else {
+		fail "$test - didn't fetch any reggroups"
+	    }
+	}
+    }
+
+    return $reggroups
+}
+
+set reggroups [fetch_reggroups "fetch reggroups"]
+
+foreach reggroup $reggroups {
+    gdb_test "info reg $reggroup" ".*" "info reg $reggroup"
+}
-- 
2.9.4

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH v2 0/4] Support for arbitrary reggroups
  2017-06-10 13:59 [PATCH v2 0/4] Support for arbitrary reggroups Stafford Horne
                   ` (3 preceding siblings ...)
  2017-06-10 13:59 ` [PATCH v2 4/4] tdesc: handle arbitrary strings in tdesc_register_in_reggroup_p Stafford Horne
@ 2017-06-10 14:03 ` Eli Zaretskii
  4 siblings, 0 replies; 6+ messages in thread
From: Eli Zaretskii @ 2017-06-10 14:03 UTC (permalink / raw)
  To: Stafford Horne; +Cc: gdb-patches, shorne

> From: Stafford Horne <shorne@gmail.com>
> Cc: Stafford Horne <shorne@gmail.com>
> Date: Sat, 10 Jun 2017 22:59:29 +0900
> 
> Traditionally registers have been limited to names like "vector",
> "general", "system" which are hard coded in the gdbarch.  This patch allows
> additional reggroups to be defined by the xml target description.
> 
> This is necessary for architectures like OpenRISC which have many
> registers.
> 
> This series also adds documentation on tests for the feature of listing
> register groups via the "info reg $reggroup" command.
> 
> -Stafford
> 
> --
> 
> Changes since v1
>  * On 'info reg $reggroup' test and docs patch
>   - Suggested by Eli - Fix changelog
>   - Suggested by Simon
>     > Added help text in 'help info registers'
>     > Fixed 'register' typos
>     > Fixed style of test program
>     > Fixed copyright '2017'
>     > Fixed code styles in expect
>  * On 'arbitrary strings' patch
>   - Suggested by Simon
>     > Allow for freeing reggroups
>   - Suggested by Eli
>     > Add documentation for this feature

Thanks, the documentation parts of this series are approved.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2017-06-10 14:03 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-10 13:59 [PATCH v2 0/4] Support for arbitrary reggroups Stafford Horne
2017-06-10 13:59 ` [PATCH v2 1/4] reggroups: Add test and docs for `info reg $reggroup` feature Stafford Horne
2017-06-10 13:59 ` [PATCH v2 3/4] reggroups: Create reggroup_gdbarch_new for dynamic reggroups Stafford Horne
2017-06-10 13:59 ` [PATCH v2 2/4] reggroups: Convert reggroups from post_init to pre_init Stafford Horne
2017-06-10 13:59 ` [PATCH v2 4/4] tdesc: handle arbitrary strings in tdesc_register_in_reggroup_p Stafford Horne
2017-06-10 14:03 ` [PATCH v2 0/4] Support for arbitrary reggroups Eli Zaretskii

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