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.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/target-descriptions.c b/gdb/target-descriptions.c
index 10f3be1..13468e5 100644
--- a/gdb/target-descriptions.c
+++ b/gdb/target-descriptions.c
@@ -2097,6 +2097,12 @@ public:
void visit (const tdesc_reg *reg) override
{
+ if (reg->target_regnum > next_regnum)
+ {
+ printf_unfiltered (" regnum = %ld;\n", reg->target_regnum);
+ next_regnum = reg->target_regnum;
+ }
+
printf_unfiltered (" tdesc_create_reg (feature, \"%s\", regnum++, %d, ",
reg->name, reg->save_restore);
if (reg->group)
@@ -2104,8 +2110,13 @@ public:
else
printf_unfiltered ("NULL, ");
printf_unfiltered ("%d, \"%s\");\n", reg->bitsize, reg->type);
+
+ next_regnum++;
}
+private:
+ /* The register number to use for the next register we see. */
+ int next_regnum = 0;
};
static void