From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id wGCvAjGDTWLSMAAAWB0awg (envelope-from ) for ; Wed, 06 Apr 2022 08:10:25 -0400 Received: by simark.ca (Postfix, from userid 112) id 08A951F344; Wed, 6 Apr 2022 08:10:25 -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 D521D1E787 for ; Wed, 6 Apr 2022 08:10:23 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 7F32E385842E for ; Wed, 6 Apr 2022 12:10:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 7F32E385842E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1649247023; bh=AvwM06oQsbKBlPca9ohncA4Us58KuITtThXzDpOEK/g=; 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=aJu7kYhS1DeDWsWBnw1wtbK4+fNDJAJHmXbvfQIWFq6hwnHXDPnMUgR8Wg4QHHOyh YqEI4NW+9z0TZH0F6zozEgZEHA6HfZ/Y4gbhyjV8mArDExR1rRJYKqRFnrC9EAS0HP U/A4z43DvXjjt4Duq4q5KzpaPGo4b/KOKzWMcOic= 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 D3E173857419 for ; Wed, 6 Apr 2022 12:05:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D3E173857419 Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-159-egeC2aPtMAyoJ4r51xKw5Q-1; Wed, 06 Apr 2022 08:05:11 -0400 X-MC-Unique: egeC2aPtMAyoJ4r51xKw5Q-1 Received: by mail-wr1-f72.google.com with SMTP id r26-20020adfa15a000000b002061064408fso428474wrr.3 for ; Wed, 06 Apr 2022 05:05:11 -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=AvwM06oQsbKBlPca9ohncA4Us58KuITtThXzDpOEK/g=; b=gLLsV2JgC32F2CXZf/EekqlNFvF+kCFx0Pnd0ho/qxvDBy2WrodThNKvucHIPTRXv/ 4b25pjJTWPJwOFvsF54Gnp8PRkai6vD3e8mRCjMUbVSpgNgN103EGdYU24MoRE81M/VO pswqhHESVNGHk8R8ABzlDy7D0V21LvR+wgvURfna3D9HDDzHidAuQrxKF/3OLqXq8VYu xWR113MzRI3YAdG89K96+urEWaMyaxlwkkgnGNANxkeflE62batYxQ6LK8G9dS03yuDX wCQYwUAFwbjcTgWxQXCU3BwKPOXYeFVL98pHE8EmYavdMxZJ1CfeJ7ya0ZE51ijRmEy4 wU8Q== X-Gm-Message-State: AOAM531mnA4Fq7pU6skPG6IdvY4wjamPwhGLMCid1JA7x3lrMuIBflPB ZjCA//UiZoj+rXdc+/61euOAKB0OWLSAKQA1exqYRZNtSJjcskVJFD8EOa60utdxH0Ac0/V5jxF zH2C1RSnKkh1eeb5vXp21hwJ1yF7BpuxtzM7j1GeEk1NdgA2gbnVVjF2jnCMM5dsblRpHnwC4sA == X-Received: by 2002:a5d:6d8b:0:b0:203:f9b4:be1d with SMTP id l11-20020a5d6d8b000000b00203f9b4be1dmr6491471wrs.298.1649246709773; Wed, 06 Apr 2022 05:05:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxt4hMcNx0oRSREtBDtEUYXWefgrFYyCZLUbRkIHMXRe4b9fryl/cmDAhOIoFIO0gcds7PHGA== X-Received: by 2002:a5d:6d8b:0:b0:203:f9b4:be1d with SMTP id l11-20020a5d6d8b000000b00203f9b4be1dmr6491417wrs.298.1649246709068; Wed, 06 Apr 2022 05:05:09 -0700 (PDT) Received: from localhost (host86-169-131-113.range86-169.btcentralplus.com. [86.169.131.113]) by smtp.gmail.com with ESMTPSA id 14-20020a056000154e00b00203f8adde0csm17994587wry.32.2022.04.06.05.05.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:05:08 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCHv2 09/16] gdb: always add the default register groups Date: Wed, 6 Apr 2022 13:04:42 +0100 Message-Id: <5163f39f318a89b14ca41ecb4121f60ede41351b.1649246539.git.aburgess@redhat.com> 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 cdeeece83c0..98eaeaf8ca4 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 400ccd6bebf..99a81b98da1 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 8713652b099..79b81351039 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