Revert "gdb: Do not print empty-group regs when printing general ones"
authorLuis Machado <luis.machado@linaro.org>
Wed, 4 Mar 2020 16:08:13 +0000 (13:08 -0300)
committerLuis Machado <luis.machado@linaro.org>
Wed, 4 Mar 2020 16:12:17 +0000 (13:12 -0300)
Revert the change since it breaks existing behavior of "info registers"
for some architectures. At least AArch64 and ARM are impacted by this change.

gdb/ChangeLog:

2020-03-04  Luis Machado  <luis.machado@linaro.org>

Revert aa66aac47b4dd38f9524ddb5546c08cc09930d37 due to regressions
in "info registers" for AArch64/ARM.

The change caused "info registers" to not print GPR's.

gdb/ChangeLog:

2020-02-01  Shahab Vahedi  <shahab@synopsys.com>

* target-descriptions.c (tdesc_register_in_reggroup_p): Return 0
when reg->group is empty and reggroup is not.

gdb/ChangeLog
gdb/target-descriptions.c

index edb87811823f57e6aeaa3341b515195a1aab0f74..36b3f3dc439912a428a3fafedd2da9de3f96a72e 100644 (file)
@@ -1,3 +1,17 @@
+2020-03-04  Luis Machado  <luis.machado@linaro.org>
+
+       Revert aa66aac47b4dd38f9524ddb5546c08cc09930d37 due to regressions
+       in "info registers" for AArch64/ARM.
+
+       The change caused "info registers" to not print GPR's.
+
+       gdb/ChangeLog:
+
+       2020-02-01  Shahab Vahedi  <shahab@synopsys.com>
+
+       * target-descriptions.c (tdesc_register_in_reggroup_p): Return 0
+       when reg->group is empty and reggroup is not.
+
 2020-03-03  Tom Tromey  <tromey@adacore.com>
 
        * dwarf2/frame.c (struct dwarf2_frame_cache)
index 06f42a1b95d05df1380af082fd2ccc7407cd60c9..04711ba2fa52b8eabbf7b9ce5d82196b2ade0ee2 100644 (file)
@@ -977,16 +977,13 @@ tdesc_register_in_reggroup_p (struct gdbarch *gdbarch, int regno,
 {
   struct tdesc_reg *reg = tdesc_find_register (gdbarch, regno);
 
-  if (reg != NULL)
-    {
-      if (reggroup == all_reggroup)
+  if (reg != NULL && !reg->group.empty ()
+      && (reg->group == reggroup_name (reggroup)))
        return 1;
 
-      else if (reggroup == save_reggroup || reggroup == restore_reggroup)
-       return reg->save_restore;
-      else
-       return (int) (reg->group == reggroup_name (reggroup));
-    }
+  if (reg != NULL
+      && (reggroup == save_reggroup || reggroup == restore_reggroup))
+    return reg->save_restore;
 
   return -1;
 }