aboutsummaryrefslogtreecommitdiff
path: root/gdb/target-descriptions.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/target-descriptions.c')
-rw-r--r--gdb/target-descriptions.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 04711ba..06f42a1b 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -977,13 +977,16 @@ tdesc_register_in_reggroup_p (struct gdbarch *gdbarch, int regno,
{
struct tdesc_reg *reg = tdesc_find_register (gdbarch, regno);
- if (reg != NULL && !reg->group.empty ()
- && (reg->group == reggroup_name (reggroup)))
+ if (reg != NULL)
+ {
+ if (reggroup == all_reggroup)
return 1;
- if (reg != NULL
- && (reggroup == save_reggroup || reggroup == restore_reggroup))
- return reg->save_restore;
+ else if (reggroup == save_reggroup || reggroup == restore_reggroup)
+ return reg->save_restore;
+ else
+ return (int) (reg->group == reggroup_name (reggroup));
+ }
return -1;
}