From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) by sourceware.org (Postfix) with ESMTPS id DE6523858D1E for ; Mon, 3 Oct 2022 19:16:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DE6523858D1E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f49.google.com with SMTP id iv17so7627464wmb.4 for ; Mon, 03 Oct 2022 12:16:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date; bh=T4iS5o8B+3GalvIVDACMxl8qsXynPT1C+m5fXduP6Uc=; b=HAC3eeTPsFt0m0AlZm17gMp8PgpiZTkSTJEu5UxoWMkL0MLJ7vlVp5bc5I/XGayHHD 8PCrxJqT4/FYOe2xt16LZcC9Wgg00BBOD4QrGUDVdhJGNGi3yU4Z6f+akUXfQZd3slzg 731BJEDyE1qnVzftA7oBxN/SRr6wk3bA1y5jzqWbqdty9B7s2Dh+J9Q5gZQjf0kU2TM2 54FLDaOIVaEXIKOASTkf0GnBGZiTVmnVc1Y1ZoEC8D/TzeQmgYojsWBh2HNf3PJF2/4a VKdSEhAr07VYaezW5BGBZ0NMjBisfyIlb4Xdm3787jWxkgnMrrsEYaw8VcMmBdU7wwBV LAGg== X-Gm-Message-State: ACrzQf2sP3F6G7TWRHwhCA46flpQaDZHQT+EyRbPILG0WpxFawRhNbiC YhdJfBSmJUdGZZFN1SOkWr36g3LBuPg= X-Google-Smtp-Source: AMsMyM5Q9SI4DbESeySYmRH4XoqR6VuNGmHPUvLGJLQFdFCel3W4EnO4Vwy4sFWZDb/EGGTTxaLvHQ== X-Received: by 2002:a05:600c:524d:b0:3b4:8ad0:6d with SMTP id fc13-20020a05600c524d00b003b48ad0006dmr8106602wmb.194.1664824581284; Mon, 03 Oct 2022 12:16:21 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id f5-20020adfdb45000000b0022cc6b8df5esm10429113wrj.7.2022.10.03.12.16.20 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 03 Oct 2022 12:16:20 -0700 (PDT) Subject: Re: [PATCH] [Arm] Remove dead FPA code To: Luis Machado , gdb-patches@sourceware.org References: <20220920123012.189293-1-luis.machado@arm.com> From: Pedro Alves Message-ID: Date: Mon, 3 Oct 2022 20:16:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20220920123012.189293-1-luis.machado@arm.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-11.0 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM, GIT_PATCH_0, HEADER_FROM_DIFFERENT_DOMAINS, KAM_DMARC_STATUS, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org 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: , X-List-Received-Date: Mon, 03 Oct 2022 19:16:25 -0000 On 2022-09-20 1:30 p.m., Luis Machado via Gdb-patches wrote: > diff --git a/gdb/arch/arm.h b/gdb/arch/arm.h > index 36757493406..74a6ba93bc7 100644 > --- a/gdb/arch/arm.h > +++ b/gdb/arch/arm.h > @@ -44,11 +44,6 @@ enum gdb_regnum { > ARM_SP_REGNUM = 13, /* Contains address of top of stack */ > ARM_LR_REGNUM = 14, /* address to return to from a function call */ > ARM_PC_REGNUM = 15, /* Contains program counter */ > - /* F0..F7 are the fp registers for the (obsolete) FPA architecture. */ Shouldn't we leave behind a comment explaining why there's a hole between 15 and 25? IIRC the numbers can't be changed since we need to handle the case when the target doesn't send an xml tdesc, so it'd be good to help future readers understand why there's a hole. > - ARM_F0_REGNUM = 16, /* first floating point register */ > - ARM_F3_REGNUM = 19, /* last floating point argument register */ > - ARM_F7_REGNUM = 23, /* last floating point register */ > - ARM_FPS_REGNUM = 24, /* floating point status register */ > ARM_PS_REGNUM = 25, /* Contains processor status */ > ARM_WR0_REGNUM, /* WMMX data registers. */ > ARM_WR15_REGNUM = ARM_WR0_REGNUM + 15, > @@ -67,7 +62,6 @@ enum gdb_regnum { > ARM_FP_REGNUM = 11, /* Frame register in ARM code, if used. */ > THUMB_FP_REGNUM = 7, /* Frame register in Thumb code, if used. */ > ARM_LAST_ARG_REGNUM = ARM_A4_REGNUM, > - ARM_LAST_FP_ARG_REGNUM = ARM_F3_REGNUM > }; > > diff --git a/gdb/arm-tdep.c b/gdb/arm-tdep.c > index ead9bbf46c5..b33a53612a6 100644 > --- a/gdb/arm-tdep.c > +++ b/gdb/arm-tdep.c > @@ -134,8 +134,6 @@ static struct cmd_list_element *showarmcmdlist = NULL; > static const char *const fp_model_strings[] = > { > "auto", > - "softfpa", > - "fpa", > "softvfp", > "vfp", > NULL > @@ -226,9 +224,7 @@ static const char *const arm_register_names[] = > "r4", "r5", "r6", "r7", /* 4 5 6 7 */ > "r8", "r9", "r10", "r11", /* 8 9 10 11 */ > "r12", "sp", "lr", "pc", /* 12 13 14 15 */ > - "f0", "f1", "f2", "f3", /* 16 17 18 19 */ > - "f4", "f5", "f6", "f7", /* 20 21 22 23 */ > - "fps", "cpsr" }; /* 24 25 */ > + "cpsr" }; /* 25 */ > Don't the array indexes here need to match the register numbers? The "cpsr" string above is no longer at index 25 after this change. > -/* For backward-compatibility we allow two 'g' packet lengths with > - the remote protocol depending on whether FPA registers are > - supplied. M-profile targets do not have FPA registers, but some > - stubs already exist in the wild which use a 'g' packet which > - supplies them albeit with dummy values. So this patch is also removing support for these M-profile targets covered by that last sentence. Are we OK with that? > - The packet format which > - includes FPA registers should be considered deprecated for > - M-profile targets. */ > - > -static void > -arm_register_g_packet_guesses (struct gdbarch *gdbarch) > -{ > - arm_gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); > - > - if (tdep->is_m) > - { > - const target_desc *tdesc; > - > - /* If we know from the executable this is an M-profile target, > - cater for remote targets whose register set layout is the > - same as the FPA layout. */ > - tdesc = arm_read_mprofile_description (ARM_M_TYPE_WITH_FPA); > - register_remote_g_packet_guess (gdbarch, > - ARM_CORE_REGS_SIZE + ARM_FP_REGS_SIZE, > - tdesc); > - > - /* The regular M-profile layout. */ > - tdesc = arm_read_mprofile_description (ARM_M_TYPE_M_PROFILE); > - register_remote_g_packet_guess (gdbarch, ARM_CORE_REGS_SIZE, > - tdesc); > - > - /* M-profile plus M4F VFP. */ > - tdesc = arm_read_mprofile_description (ARM_M_TYPE_VFP_D16); > - register_remote_g_packet_guess (gdbarch, > - ARM_CORE_REGS_SIZE + ARM_VFP2_REGS_SIZE, > - tdesc); > - /* M-profile plus MVE. */ > - tdesc = arm_read_mprofile_description (ARM_M_TYPE_MVE); > - register_remote_g_packet_guess (gdbarch, ARM_CORE_REGS_SIZE > - + ARM_VFP2_REGS_SIZE > - + ARM_INT_REGISTER_SIZE, tdesc); > - > - /* M-profile system (stack pointers). */ > - tdesc = arm_read_mprofile_description (ARM_M_TYPE_SYSTEM); > - register_remote_g_packet_guess (gdbarch, 2 * ARM_INT_REGISTER_SIZE, tdesc); And what about all these other non-FPA guesses? Do you really mean to drop them? > - } > - > - /* Otherwise we don't have a useful guess. */ > -} > - > /* Implement the code_of_frame_writable gdbarch method. */ > > static int