From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id QJkNMnsYRmJQHAAAWB0awg (envelope-from ) for ; Thu, 31 Mar 2022 17:09:15 -0400 Received: by simark.ca (Postfix, from userid 112) id CA7E01F163; Thu, 31 Mar 2022 17:09:15 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (ip-8-43-85-97.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 9857A1E150 for ; Thu, 31 Mar 2022 17:09:14 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 517C33898C6B for ; Thu, 31 Mar 2022 21:09:14 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 517C33898C6B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1648760954; bh=UpgCTH10fdzgQ+vYEw77AX8eKx9lOxpEaF9knXvah7k=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=Qr2chLt3Rzq8SU0qmqSPUeXCWDA82abH9+x3CS2J3A8FuZtci9UgxQnQ0tPHHOD8z 7qscAsFZpJ/AqdTpYrYs177E+unA2JmUrZECrX7i25DblPKqPL7mpITPuGoew5AvQR nhjpLvgoA6fyiPcLDhsd1Fh8uXy7RYR6LjpFcrzQ= Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 04C6E3839425 for ; Thu, 31 Mar 2022 21:04:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 04C6E3839425 Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-615-LCOldTCgPJyNGj8oxUEUVQ-1; Thu, 31 Mar 2022 17:04:45 -0400 X-MC-Unique: LCOldTCgPJyNGj8oxUEUVQ-1 Received: by mail-wr1-f69.google.com with SMTP id i27-20020adfa51b000000b00205c997f177so195578wrb.21 for ; Thu, 31 Mar 2022 14:04:45 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=UpgCTH10fdzgQ+vYEw77AX8eKx9lOxpEaF9knXvah7k=; b=xW1IHiMkEB+wz24VBoRm+/Tqom4erPlGL27EAq7B6HJNVVoQr0RAe8feEubMAAt2cN f++dTBr86T/npGb67GfpavflmktWEnmLjt5PpL46+p5pKFi/q5UcXA48APcBoDiHbAUk SDbsAOa+pODgYEYsFheLbyzcylVvZrLBK3IXVY+UO2btcjphoZx00pL7BCitFqwFjfqF GFweXfaeyP/Vb93zDN8ykGEO9Q2k61fHIappfRDhOUP67ZnzKbgoJWTE7n0bQgdmfyhm 8b4nFJwq+fGf4kJVgbTfb9fQEMQjS8rGGsY7T2TKuFbTdNzG72juQvhwU3Hg3TRbWT9u 0m+Q== X-Gm-Message-State: AOAM533v+W2YgHIoaxErrIkQ5IaWmzNYaMqVpW7pDFxbdKywWMZCcAPT EiYASrNGJAGateRP5uUjeij71eiGh0oVVcNboivjtN9IM2p9LcLe5MhYpdSBCtPQSxAIZVyJp0x 6jVYOk03Qq4rlIWxFvMjbm7djv3CcnArSc/elN3OAba8QTgAlrwIo7riVqs2kbhRY+sNkmg9/TA == X-Received: by 2002:a5d:4101:0:b0:205:86cb:dd1b with SMTP id l1-20020a5d4101000000b0020586cbdd1bmr5279449wrp.480.1648760683783; Thu, 31 Mar 2022 14:04:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxSfXOfqw6MylSbB7bRl0M/0tOSY4zVido9Xxd1nqgUAQXS2EuZ1GqtI2nf6sodICmJUTO9SQ== X-Received: by 2002:a5d:4101:0:b0:205:86cb:dd1b with SMTP id l1-20020a5d4101000000b0020586cbdd1bmr5279430wrp.480.1648760683295; Thu, 31 Mar 2022 14:04:43 -0700 (PDT) Received: from localhost (host86-169-131-113.range86-169.btcentralplus.com. [86.169.131.113]) by smtp.gmail.com with ESMTPSA id m20-20020a05600c4f5400b0038b5162260csm396253wmq.23.2022.03.31.14.04.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 14:04:42 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 09/16] gdb: always add the default register groups Date: Thu, 31 Mar 2022 22:04:15 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Andrew Burgess via Gdb-patches Reply-To: Andrew Burgess Cc: Andrew Burgess Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" There's a set of 7 default register groups. If we don't add any gdbarch specific register groups during gdbarch initialisation, then when we iterate over the register groups using reggroup_next and reggroup_prev we will make use of these 7 default groups. See the use of default_groups in gdb/reggroups.c for details on this. However, if the gdbarch adds its own groups during gdbarch initialisation, then these groups will be used in preference to the default groups. A problem arises though if the particular architecture makes use of the target description mechanism. If the default target description(s) (i.e. those internal to GDB that are used when the user doesn't provide their own) don't mention any additional register groups then the default register groups will be used. But if the target description does mention additional groups then the default groups are not used, and instead, the groups from the target description are used. The problem with this is that what usually happens is that the target description will mention additional groups, e.g. groups for special registers. Most architectures that use target descriptions work around this by adding all (or most) of the default register groups in all cases. See i386_add_reggroups, aarch64_add_reggroups, riscv_add_reggroups, xtensa_add_reggroups, and others. In this patch, my suggestion is that we should just add the default register groups for every architecture, always. This change is in gdb/reggroups.c. All the remaining changes are me updating the various architectures to not add the default groups themselves. So, where will this change be visible to the user? I think the following commands will possibly change: * info registers / info all-registers: The user can provide a register group to these commands. For example, on csky, we previously never added the 'vector' group. Now, as a default group, this will be available, but (presumably) will not contain any registers. I don't think this is necessarily a bad thing, there's something to be said for having some consistent defaults available. There are other architectures that didn't add all 7 of the defaults, which will now have gained additional groups. * maint print reggroups This prints the set of all available groups. As a maintenance command I'm less concerned with the output changing here. Obviously, for the architectures that didn't previously add all the defaults, this list just got bigger. * maint print register-groups This prints all the registers, and the groups they are in. If the defaults were not previously being added then a register (obviously) can't appear in one of the default groups. Now the groups are available then registers might be in more groups than previously. However, this is again a maintenance command, so I'm less concerned about this changing. --- gdb/aarch64-tdep.c | 17 ------------- gdb/arc-tdep.c | 17 ------------- gdb/csky-tdep.c | 2 -- gdb/i386-tdep.c | 7 ------ gdb/lm32-tdep.c | 11 --------- gdb/m32c-tdep.c | 5 ---- gdb/m68hc11-tdep.c | 7 ------ gdb/mep-tdep.c | 4 ---- gdb/nds32-tdep.c | 8 ------- gdb/or1k-tdep.c | 14 +---------- gdb/reggroups.c | 59 +++++++++++++++++++++++++++------------------- gdb/riscv-tdep.c | 12 +--------- gdb/xtensa-tdep.c | 13 +--------- 13 files changed, 38 insertions(+), 138 deletions(-) diff --git a/gdb/aarch64-tdep.c b/gdb/aarch64-tdep.c index 400719fbd25..c852a0602ae 100644 --- a/gdb/aarch64-tdep.c +++ b/gdb/aarch64-tdep.c @@ -3367,20 +3367,6 @@ aarch64_get_tdesc_vq (const struct target_desc *tdesc) return sve_vq_from_vl (vl); } -/* Add all the expected register sets into GDBARCH. */ - -static void -aarch64_add_reggroups (struct gdbarch *gdbarch) -{ - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - reggroup_add (gdbarch, system_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); -} - /* Implement the "cannot_store_register" gdbarch method. */ static int @@ -3636,9 +3622,6 @@ aarch64_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* Virtual tables. */ set_gdbarch_vbit_in_delta (gdbarch, 1); - /* Register architecture. */ - aarch64_add_reggroups (gdbarch); - /* Hook in the ABI-specific overrides, if they have been registered. */ info.target_desc = tdesc; info.tdesc_data = tdesc_data.get (); diff --git a/gdb/arc-tdep.c b/gdb/arc-tdep.c index d6da2886c49..98bd1c4bc0a 100644 --- a/gdb/arc-tdep.c +++ b/gdb/arc-tdep.c @@ -1952,20 +1952,6 @@ static const struct frame_base arc_normal_base = { arc_frame_base_address }; -/* Add all the expected register sets into GDBARCH. */ - -static void -arc_add_reggroups (struct gdbarch *gdbarch) -{ - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - reggroup_add (gdbarch, system_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); -} - static enum arc_isa mach_type_to_arc_isa (const unsigned long mach) { @@ -2364,9 +2350,6 @@ arc_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) /* This doesn't include possible long-immediate value. */ set_gdbarch_max_insn_length (gdbarch, 4); - /* Add default register groups. */ - arc_add_reggroups (gdbarch); - /* Frame unwinders and sniffers. */ dwarf2_frame_set_init_reg (gdbarch, arc_dwarf2_frame_init_reg); dwarf2_append_unwinders (gdbarch); diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index f1376730c87..feb416a2406 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -2050,8 +2050,6 @@ csky_init_reggroup () static void csky_add_reggroups (struct gdbarch *gdbarch) { - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, general_reggroup); reggroup_add (gdbarch, cr_reggroup); reggroup_add (gdbarch, fr_reggroup); reggroup_add (gdbarch, vr_reggroup); diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index e0c8efa8406..0f9e3fde6ce 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -4546,13 +4546,6 @@ i386_add_reggroups (struct gdbarch *gdbarch) { reggroup_add (gdbarch, i386_sse_reggroup); reggroup_add (gdbarch, i386_mmx_reggroup); - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, system_reggroup); } int diff --git a/gdb/lm32-tdep.c b/gdb/lm32-tdep.c index f3f1f87d6bb..4a781c394e9 100644 --- a/gdb/lm32-tdep.c +++ b/gdb/lm32-tdep.c @@ -59,16 +59,6 @@ struct lm32_frame_cache trad_frame_saved_reg *saved_regs; }; -/* Add the available register groups. */ - -static void -lm32_add_reggroups (struct gdbarch *gdbarch) -{ - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, system_reggroup); -} - /* Return whether a given register is in a given group. */ static int @@ -540,7 +530,6 @@ lm32_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_push_dummy_call (gdbarch, lm32_push_dummy_call); set_gdbarch_return_value (gdbarch, lm32_return_value); - lm32_add_reggroups (gdbarch); set_gdbarch_register_reggroup_p (gdbarch, lm32_register_reggroup_p); return gdbarch; diff --git a/gdb/m32c-tdep.c b/gdb/m32c-tdep.c index 94087302892..5a767c9ed52 100644 --- a/gdb/m32c-tdep.c +++ b/gdb/m32c-tdep.c @@ -981,11 +981,6 @@ make_regs (struct gdbarch *arch) set_gdbarch_dwarf2_reg_to_regnum (arch, m32c_debug_info_reg_to_regnum); set_gdbarch_register_reggroup_p (arch, m32c_register_reggroup_p); - reggroup_add (arch, general_reggroup); - reggroup_add (arch, all_reggroup); - reggroup_add (arch, save_reggroup); - reggroup_add (arch, restore_reggroup); - reggroup_add (arch, system_reggroup); reggroup_add (arch, m32c_dma_reggroup); } diff --git a/gdb/m68hc11-tdep.c b/gdb/m68hc11-tdep.c index f1133fe6780..9d978d88018 100644 --- a/gdb/m68hc11-tdep.c +++ b/gdb/m68hc11-tdep.c @@ -1361,13 +1361,6 @@ m68hc11_add_reggroups (struct gdbarch *gdbarch) { reggroup_add (gdbarch, m68hc11_hard_reggroup); reggroup_add (gdbarch, m68hc11_soft_reggroup); - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, system_reggroup); } static int diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c index 50bea7cb49f..e449c66c9b5 100644 --- a/gdb/mep-tdep.c +++ b/gdb/mep-tdep.c @@ -2428,10 +2428,6 @@ mep_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) set_gdbarch_stab_reg_to_regnum (gdbarch, mep_debug_reg_to_regnum); set_gdbarch_register_reggroup_p (gdbarch, mep_register_reggroup_p); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); reggroup_add (gdbarch, mep_csr_reggroup); reggroup_add (gdbarch, mep_cr_reggroup); reggroup_add (gdbarch, mep_ccr_reggroup); diff --git a/gdb/nds32-tdep.c b/gdb/nds32-tdep.c index 425d7d90d64..a94a03ab2ab 100644 --- a/gdb/nds32-tdep.c +++ b/gdb/nds32-tdep.c @@ -343,14 +343,6 @@ nds32_init_reggroups (void) static void nds32_add_reggroups (struct gdbarch *gdbarch) { - /* Add pre-defined register groups. */ - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - reggroup_add (gdbarch, system_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); - /* Add NDS32 register groups. */ reggroup_add (gdbarch, nds32_cr_reggroup); reggroup_add (gdbarch, nds32_ir_reggroup); diff --git a/gdb/or1k-tdep.c b/gdb/or1k-tdep.c index 9f7fa2f169f..2b906fa69d3 100644 --- a/gdb/or1k-tdep.c +++ b/gdb/or1k-tdep.c @@ -1260,19 +1260,7 @@ or1k_gdbarch_init (struct gdbarch_info info, struct gdbarch_list *arches) } if (tdesc_data != NULL) - { - /* If we are using tdesc, register our own reggroups, otherwise we - will used the defaults. */ - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, system_reggroup); - reggroup_add (gdbarch, float_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); - - tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); - } + tdesc_use_registers (gdbarch, tdesc, std::move (tdesc_data)); /* Hook in ABI-specific overrides, if they have been registered. */ gdbarch_init_osabi (info, gdbarch); diff --git a/gdb/reggroups.c b/gdb/reggroups.c index 6c38ca743f4..e47a6daf9a0 100644 --- a/gdb/reggroups.c +++ b/gdb/reggroups.c @@ -90,15 +90,6 @@ struct reggroups static struct gdbarch_data *reggroups_data; -static void * -reggroups_init (struct obstack *obstack) -{ - struct reggroups *groups = OBSTACK_ZALLOC (obstack, struct reggroups); - - groups->last = &groups->first; - return groups; -} - /* Add a register group (with attribute values) to the pre-defined list. */ @@ -119,13 +110,44 @@ reggroup_add (struct gdbarch *gdbarch, struct reggroup *group) struct reggroups *groups = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data); + /* The same reggroup should not be added multiple times. */ + gdb_assert (groups != nullptr); + for (struct reggroup_el *el = groups->first; + el != nullptr; + el = el->next) + gdb_assert (group != el->group); + add_group (groups, group, GDBARCH_OBSTACK_ZALLOC (gdbarch, struct reggroup_el)); } -/* The default register groups for an architecture. */ +/* Called to initialize the per-gdbarch register group information. */ -static struct reggroups default_groups = { NULL, &default_groups.first }; +static void * +reggroups_init (struct obstack *obstack) +{ + struct reggroups *groups = OBSTACK_ZALLOC (obstack, struct reggroups); + + groups->last = &groups->first; + + /* Add the default groups. */ + add_group (groups, general_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + add_group (groups, float_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + add_group (groups, system_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + add_group (groups, vector_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + add_group (groups, all_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + add_group (groups, save_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + add_group (groups, restore_reggroup, + OBSTACK_ZALLOC (obstack, struct reggroup_el)); + + return groups; +} /* A register group iterator. */ @@ -139,8 +161,7 @@ reggroup_next (struct gdbarch *gdbarch, const struct reggroup *last) creation. If there are no groups, use the default groups list. */ groups = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data); gdb_assert (groups != NULL); - if (groups->first == NULL) - groups = &default_groups; + gdb_assert (groups->first != NULL); /* Return the first/next reggroup. */ if (last == NULL) @@ -171,8 +192,7 @@ reggroup_prev (struct gdbarch *gdbarch, const struct reggroup *curr) creation. If there are no groups, use the default groups list. */ groups = (struct reggroups *) gdbarch_data (gdbarch, reggroups_data); gdb_assert (groups != NULL); - if (groups->first == NULL) - groups = &default_groups; + gdb_assert (groups->first != NULL); prev = NULL; for (el = groups->first; el != NULL; el = el->next) @@ -327,15 +347,6 @@ _initialize_reggroup () { 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)); - add_group (&default_groups, float_reggroup, XNEW (struct reggroup_el)); - add_group (&default_groups, system_reggroup, XNEW (struct reggroup_el)); - add_group (&default_groups, vector_reggroup, XNEW (struct reggroup_el)); - add_group (&default_groups, all_reggroup, XNEW (struct reggroup_el)); - add_group (&default_groups, save_reggroup, XNEW (struct reggroup_el)); - add_group (&default_groups, restore_reggroup, XNEW (struct reggroup_el)); - add_cmd ("reggroups", class_maintenance, maintenance_print_reggroups, _("\ Print the internal register group names.\n\ diff --git a/gdb/riscv-tdep.c b/gdb/riscv-tdep.c index c039904daba..ce62cfeb65c 100644 --- a/gdb/riscv-tdep.c +++ b/gdb/riscv-tdep.c @@ -3497,21 +3497,11 @@ riscv_find_default_target_description (const struct gdbarch_info info) return riscv_lookup_target_description (features); } -/* Add all the expected register sets into GDBARCH. */ +/* Add all the RISC-V specific register groups into GDBARCH. */ static void riscv_add_reggroups (struct gdbarch *gdbarch) { - /* Add predefined register groups. */ - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); - reggroup_add (gdbarch, system_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - - /* Add RISC-V specific register groups. */ reggroup_add (gdbarch, csr_reggroup); } diff --git a/gdb/xtensa-tdep.c b/gdb/xtensa-tdep.c index 62be13643b2..6e478ee893d 100644 --- a/gdb/xtensa-tdep.c +++ b/gdb/xtensa-tdep.c @@ -734,23 +734,12 @@ xtensa_init_reggroups (void) static void xtensa_add_reggroups (struct gdbarch *gdbarch) { - int i; - - /* Predefined groups. */ - reggroup_add (gdbarch, all_reggroup); - reggroup_add (gdbarch, save_reggroup); - reggroup_add (gdbarch, restore_reggroup); - reggroup_add (gdbarch, system_reggroup); - reggroup_add (gdbarch, vector_reggroup); - reggroup_add (gdbarch, general_reggroup); - reggroup_add (gdbarch, float_reggroup); - /* Xtensa-specific groups. */ reggroup_add (gdbarch, xtensa_ar_reggroup); reggroup_add (gdbarch, xtensa_user_reggroup); reggroup_add (gdbarch, xtensa_vectra_reggroup); - for (i = 0; i < XTENSA_MAX_COPROCESSOR; i++) + for (int i = 0; i < XTENSA_MAX_COPROCESSOR; i++) reggroup_add (gdbarch, xtensa_cp[i]); } -- 2.25.4