From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id xtrZChVJq2N4NwoAWB0awg (envelope-from ) for ; Tue, 27 Dec 2022 14:35:49 -0500 Received: by simark.ca (Postfix, from userid 112) id 16E071E222; Tue, 27 Dec 2022 14:35:49 -0500 (EST) Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=syrmia.com header.i=@syrmia.com header.a=rsa-sha256 header.s=selector1 header.b=mkY2S63k; dkim-atps=neutral X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-8.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,NICE_REPLY_A, RCVD_IN_DNSWL_HI,RDNS_DYNAMIC,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 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 C37581E0D3 for ; Tue, 27 Dec 2022 14:35:47 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id BE6403858410 for ; Tue, 27 Dec 2022 19:35:46 +0000 (GMT) Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2126.outbound.protection.outlook.com [40.107.21.126]) by sourceware.org (Postfix) with ESMTPS id 28FC13858D38 for ; Tue, 27 Dec 2022 19:35:34 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 28FC13858D38 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=syrmia.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=syrmia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kXOiAie+l9+MRxB0gZaC3Yg6kUk18XxFEsMccnfvj0o2pNTxj5aODYpSkWJotEtquBoOrgOnvG2NzOMvWcUR8XEydGCeCKNf/QZ299y2X1Wku3bVDKA5vZS/nMbjoPkcOln2eq2ywXXZ16h0UBz1g9Zmb6hytFWfg/ujj4KPjTKEJDTzSm+p1zwnGFZvjS2pAkjRIPYK6zslF6DOz36iBsZGYCajoozDEhfBeSwR6aWvrly9Do16f/Cm6WfcI9BNLeQKXrFH/pKpUbaon2IBVIXoAR+C/3hS7LYL17i9DpF24QMtwKWIuhB7J/JaRHdwzQIyl9spW7tnhDCJ6BPUdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=LIBpu2/jSbeyCe90uIbg/iT836VT+81leXfJNZLjH0E=; b=n78D0eClES0TMVn8DjRyTeVelGNDkl6kE0wrwgNyZxTdx1+RvyKRenQ+wNLbpoqxIvd6C1SbNEJMAkneGhwt1KkdtTAx4mYDz4AbU+/6Y53QCEFOV9xE/DAEEloGzrGzsMqnRyT6YBdwDpdSJZzyKjHakL73m/nUwXwuCCYVJ87D1AV0ft7SnXrlcTXhtpoLocauyFMVmNoW6nETQiqfLyPio2iWLU+vjedYRWdhh+Kz3IHBP68WBgZ1gH5SfEePp4zFcmMLjdNcBbwSy997UZJI7CpeU+Wpap9AvOv5v6L6WGpq0SOs9eUaJuUeX5IJEmq1OiX4XQkX/lj1UGYsxw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=syrmia.com; dmarc=pass action=none header.from=syrmia.com; dkim=pass header.d=syrmia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=syrmia.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LIBpu2/jSbeyCe90uIbg/iT836VT+81leXfJNZLjH0E=; b=mkY2S63kUkUsy+0/EUTOXk46wqCxybnDh9VCtqWzjhOTr3MvnJkwl9JV2ZeyLenlQLk+5V663+DL9Sag4QIrPl6UvhejPnt0QdwhyOwDmOhW27PTQYlPkkGjHAw5Gj0KUpQ/W2W02UuEE8+exbnY+mAk5G+xIvMfEKBb6zgTSVM= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=syrmia.com; Received: from VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) by AS8PR03MB8976.eurprd03.prod.outlook.com (2603:10a6:20b:5ba::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5944.14; Tue, 27 Dec 2022 19:35:30 +0000 Received: from VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::7dd6:296:f108:8767]) by VI1PR03MB4208.eurprd03.prod.outlook.com ([fe80::7dd6:296:f108:8767%7]) with mapi id 15.20.5944.016; Tue, 27 Dec 2022 19:35:30 +0000 Message-ID: <5c3f02e8-737d-c992-f321-abbe7a60e249@syrmia.com> Date: Tue, 27 Dec 2022 20:35:16 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH v5 4/4] sim: mips: Add simulator support for mips32r6/mips64r6 To: Mike Frysinger Cc: gdb-patches@sourceware.org, "Maciej W . Rozycki" , Chao-ying Fu , Faraz Shahbazker References: <20220202101725.23671-1-Dragan.Mladjenovic@syrmia.com> <20220202101725.23671-5-Dragan.Mladjenovic@syrmia.com> Content-Language: en-US From: Dragan Mladjenovic In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-ClientProxiedBy: BYAPR05CA0055.namprd05.prod.outlook.com (2603:10b6:a03:74::32) To VI1PR03MB4208.eurprd03.prod.outlook.com (2603:10a6:803:51::25) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR03MB4208:EE_|AS8PR03MB8976:EE_ X-MS-Office365-Filtering-Correlation-Id: ce6cc975-a9cd-4aeb-ad2d-08dae8418361 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 4U7IBHxYwwyb8It+iwhquBDuzrhUAjQ+UNC5ZESHsoOfZrxsoP9fbly7tr0NPXhqUnReP0MshBX6qeJx4HHvWVPI5h2D5rrAexFotnYAYT47NFs0xj3Ht+WBkmiTOpH0IwzX3hy696E00KuwCSj9IFn5UkQEtKOkHeZK7DPbTV1LwwGcCHem3wywWyhSiuSSpVAFLi0B6Xpm+1Hyifbeve70a3ifX+HCcHEZo4CUcf7mju+qhrEv4HhXDTP1O++r+4+eQke7rWETh/vJXt4X6v+p3C0+8skinYA2HbgjaDGTHK+c8HO1tKZEt9EHDwOqa6+4V99z7jS3TQiN3uOQD2qsK2HY70fvsYVlrD0ncOojlP4sk7ZFmsYksyT0G1AJWQTPUdWtObzfWbrqyClS08lSJuwLGGSzS640e/0yKjwTvW+WT/q1+r2n3rfbcaUEzFZMHZHYAi/JKWMmT8xt8Bmja/+7TA7pPk7BJJkQLDD2lcHkyHUqv69mbvMeBM66pfN0i/GNuWifTtk2TDuiCVP30UkI0bnqt1wWA94oQZ2P4wYQdPl2kO+RmiTMl5NIF1m0LSuYvXyaVBjM0m1h098OQRR7DQXALqfEy3bIi+WLc2A6DDc2Tu26E6TWgwKD512jSnns6tsakAFRB5Gi84RTk3Zys+2sJEd3OXRTN926XDUpwGyDU4vsQCQOwHD3FwnkxhBn5JoNpWj2QjRb08TRPwNFpZHm9eVs+22y3ys= X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:VI1PR03MB4208.eurprd03.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(136003)(396003)(39840400004)(366004)(376002)(346002)(451199015)(8676002)(4326008)(66476007)(66556008)(8936002)(6506007)(66946007)(31686004)(5660300002)(41300700001)(6916009)(54906003)(2906002)(316002)(36756003)(38100700002)(86362001)(6512007)(186003)(478600001)(53546011)(26005)(6486002)(2616005)(31696002)(6666004)(45980500001)(43740500002); DIR:OUT; SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?TFFhMmorZ2MzNUpkWllxS2VMRkt0aGwvSmZnSmdiUEc4a2M4QnVQRkQzb29w?= =?utf-8?B?WjI4bStpREFPbnVlS0o3d3A4Zm1GbDliUmVqM3BDVERGUEJDVGxNUDlZQkZh?= =?utf-8?B?dmZDaXBlSVM5RjFkNS8raWU1VkZoUlRTWGpFdDlyY2tPMjRZNzYvcWJFaXd2?= =?utf-8?B?cjdBWml6SFVTNlBHcURVS0xacCtiNnRVMTdxSFV5MDBOT0h0OUJwc0dpek9L?= =?utf-8?B?MlZSMThhVHhiMU5xbzdmU1BLWEp2bUpyVWhpRm1BZUkvQURUcUpjY2VsaG5O?= =?utf-8?B?SWdJWmtKNzcyY3FSWjlCbk1Zd2lld0FHNEdIVk55a09jWGx6MUtHVEpESlBN?= =?utf-8?B?QkVValRuZy9yclZUcGVyWk1xSXRhMSswWHBHb0k3NU54MEovOHY0aWJzTkZZ?= =?utf-8?B?endxTmxwbWh2cHdnMzhzTGxIV0x4NStIek9JekdqbDNrRUVhUjhITEdtZXpB?= =?utf-8?B?RE1XbG9HcEVWbkJQQmR4MGFob2tyQm9JYk9xMzB5UXRmTGN6bDZUWVpTZEhX?= =?utf-8?B?cTZLL3N0U0NqQ0ljRG03WjkwbEZiT0pvdjBiUURtbmJnT1J4dUs1SCtsWk82?= =?utf-8?B?andtT0IvWVBtdFhab1NqSWh1ZThldVlPV2xPNmZrVS80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MZEZUTVRsbkhmMXFPTlQzczJIc0JLWGNy?= =?utf-8?B?SHcwck4xdzJqKzZBN2VvVDBnMVliMkdFUHJ2TEczMTZwTWhIY2VhVHQ5Yldz?= =?utf-8?B?WlY3ZWtvTXJsaFBoSHZSd1hrQWYydG5weUJvaWx4dmlHWDFqZkY5ZU1FQ3BV?= =?utf-8?B?VTNqYWNWUk1UZ2dNOE1DOHRvc1lBb2VaM3ZIdUtTSjdpeTBDMVduY1hwNFpZ?= =?utf-8?B?ZzBQSDA5MDR2ZnN0SXd3dVMxOXFVNk16TXhXaGFlQk8zWlJHRUJJUFp0VUF5?= =?utf-8?B?UFk0YnZaeTNKQUtkaS9XcFJ4N1MvOTRvTU5MYmFxK08vT1NuN3V6bjA0d1VE?= =?utf-8?B?M216dVYrZVUzdzJRMXMrSVpOcUxxV2hlaDFnekRYNG4rdGxEUVJzQ2hwdUFl?= =?utf-8?B?bVVCVlNwN01PUklELzRIQ0JoVnVUdG9iZFMwRFpuWUFpZ0hzQ1d5b1p4cHhz?= =?utf-8?B?RDB2bkg2V1RDUzgvR0pUdXFCN0ZMMlFldUFrK1BYVElkcEtNTURyVlMyeVhR?= =?utf-8?B?UG9oK2tRWjhyR1R6WnZGK0ZqbjFQU0wwaTlrcDhVenVDeDlvMVN3TmZPYUlG?= =?utf-8?B?YWJ1SlgvWEZvaDhSeVkvZFFybVE2Y2ZKRS83WkVLUE80RHFSWlNLc0J5RmhE?= =?utf-8?B?NHc9PQ==?= X-OriginatorOrg: syrmia.com X-MS-Exchange-CrossTenant-Network-Message-Id: ce6cc975-a9cd-4aeb-ad2d-08dae8418361 X-MS-Exchange-CrossTenant-AuthSource: VI1PR03MB4208.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Dec 2022 19:35:30.5143 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 19214a73-c1ab-4e19-8f59-14bdcb09a66e X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: MjlxugjZxhXb+GkQTb6It1mnGkLA26qE7qKOgOLkYnaNlKpQMLmrCwzt7uylBlyew03O3Rsbsmjpqgo0KaENZ2GYxT6PPGb8WlHoChsnOC8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR03MB8976 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: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org Sender: "Gdb-patches" On 25-Dec-22 01:26, Mike Frysinger wrote: > On 02 Feb 2022 11:17, Dragan Mladjenovic wrote: >> --- a/sim/mips/configure.ac >> +++ b/sim/mips/configure.ac >> @@ -216,6 +227,7 @@ if test ${sim_gen} = MULTI; then >> #include "sim-main.h" >> #include "multi-include.h" >> #include "elf-bfd.h" >> +#include "elfxx-mips.h" >> #include "elf/mips.h" >> >> #define SD sd >> @@ -235,7 +247,11 @@ sim_engine_run (SIM_DESC sd, >> & EF_MIPS_ARCH_ASE_MICROMIPS) >> mach = bfd_mach_mips_micromips; >> else >> - mach = STATE_ARCHITECTURE (SD)->mach; >> + { >> + mach = _bfd_elf_mips_mach (elf_elfheader (STATE_PROG_BFD (sd))->e_flags); >> + if (!mach) >> + mach = STATE_ARCHITECTURE (SD)->mach; >> + } > > why do you need this logic in the main engine run routine ? why isn't the > STATE_ARCHITECTURE value already set to the correct value ? if it isn't set > correctly all the time, this can lead to incorrect behavior elsewhere when > code checks it. > > when the sim is opened, the bfd_mach is either explicitly passed in (which > gdb does), or initialized with a call to the bfd library APIs. see the > sim/common/sim-utils.c:sim_analyze_program code. > -mike Hi, Sorry but the exact reason for doing so eludes me. It is done on internal jump for gdb 8 to gdb 10, permissibly to allow running binary even whet set arch forces older mips isa, but I see little use of that outside of testsuite maybe. Best regards, Dragan