From patchwork Mon Sep 18 21:26:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Luis Machado X-Patchwork-Id: 76322 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id D71DE386F5F3 for ; Mon, 18 Sep 2023 21:29:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org D71DE386F5F3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1695072573; bh=9UmdYXnaxTBc4xXVGN7BKdoeEX0de5ebIDwrzj0KK2c=; 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=nwEu1Vgi2OqZcV/becSAttEvsUPwVU5+YSpYdpI+d1yyecGSWfcW+D9piavSPBhzD EXJyscNcOKz1Vorpp4hylXQwaOPi2ABzULMar5KmHItrfa+QlrjCYi/b+KwlUX8mVD ciDY3knalGut2JDJiYYYMQpi0tIuNV4iPCcRPSIU= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from EUR01-VE1-obe.outbound.protection.outlook.com (mail-ve1eur01on2072.outbound.protection.outlook.com [40.107.14.72]) by sourceware.org (Postfix) with ESMTPS id C60FC3857438 for ; Mon, 18 Sep 2023 21:27:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C60FC3857438 Received: from AS9PR06CA0243.eurprd06.prod.outlook.com (2603:10a6:20b:45f::6) by DU0PR08MB8640.eurprd08.prod.outlook.com (2603:10a6:10:400::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.24; Mon, 18 Sep 2023 21:27:16 +0000 Received: from AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com (2603:10a6:20b:45f:cafe::e) by AS9PR06CA0243.outlook.office365.com (2603:10a6:20b:45f::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26 via Frontend Transport; Mon, 18 Sep 2023 21:27:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; pr=C Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM7EUR03FT039.mail.protection.outlook.com (100.127.140.224) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6813.16 via Frontend Transport; Mon, 18 Sep 2023 21:27:16 +0000 Received: ("Tessian outbound 5c548696a0e7:v175"); Mon, 18 Sep 2023 21:27:16 +0000 X-CheckRecipientChecked: true X-CR-MTA-CID: 2bb4972aaa581a3b X-CR-MTA-TID: 64aa7808 Received: from d5e1bc342ab8.1 by 64aa7808-outbound-1.mta.getcheckrecipient.com id 91B17659-F263-4A31-8449-D9A18D25F075.1; Mon, 18 Sep 2023 21:27:09 +0000 Received: from EUR04-HE1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id d5e1bc342ab8.1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 18 Sep 2023 21:27:09 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=MhJi+asOb492ANcDXKIRPu9YpK9Db9rHKm88z+gdWJ+44db/mZ4CsmBYybnBPxQSgfQLL8QnOyKUhkFNBINMNkP3+ljxMVb2v6Mwr7p9Z4FDXA+DMeppZDgRwtEH/81NIzt1uvYDgDDkA2px+8j/cu2FXSobAqzsTF+792fFMjX3msYtExwFR1YO32CunSZs/Y22abrvKxx61C7nGkiDAbrRL/OMc5k1CUXzjHKwtyj8jHV7tTu6y2ju3+21V0ElziB7XZUB5uLfUJqoKx8+WNErsw2W53HyPe1MSGEZ7IsZdO6Qq/ZBPrGtfRHQUVpo4MALzfXig9nACYSJDoHfDw== 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=9UmdYXnaxTBc4xXVGN7BKdoeEX0de5ebIDwrzj0KK2c=; b=hEFuu3VT93A6D+36J8BPuIvybFzwF7/WiJUvYd56cu0GDJXBGoskpKQj/faSGq1VAJ7ThWRpTYAf0FU0izQDIicjFFEpdNs7HIjClPycUDhdoWDCj2O/njK0EleGI1XDKONdwuU7x3gt0rLhVuYY+lp8KO8fJjC+IBNXHcydzI+nHS6Y8vwb1M7c4SlpAx2b0qkaT6fC4lLwXx4vLUHIs4nJZ+zprxinW7PPl8iT0PHCuO6wY5lYGWS+GNouz5X9xYsQ96f5vuzQXLEkunuNmxQY5o2RAJD8EgggVhrT1boFQGZTvT7VvgCkHrHrO1bK97SfO/4Vy3oPfHLS1M9BTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 40.67.248.234) smtp.rcpttodomain=sourceware.org smtp.mailfrom=arm.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=arm.com; dkim=none (message not signed); arc=none Received: from AM6P193CA0124.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:85::29) by AM8PR08MB6577.eurprd08.prod.outlook.com (2603:10a6:20b:355::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.27; Mon, 18 Sep 2023 21:27:07 +0000 Received: from AM7EUR03FT009.eop-EUR03.prod.protection.outlook.com (2603:10a6:209:85:cafe::c0) by AM6P193CA0124.outlook.office365.com (2603:10a6:209:85::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6792.26 via Frontend Transport; Mon, 18 Sep 2023 21:27:07 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 40.67.248.234) smtp.mailfrom=arm.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 40.67.248.234 as permitted sender) receiver=protection.outlook.com; client-ip=40.67.248.234; helo=nebula.arm.com; pr=C Received: from nebula.arm.com (40.67.248.234) by AM7EUR03FT009.mail.protection.outlook.com (100.127.140.130) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.6813.16 via Frontend Transport; Mon, 18 Sep 2023 21:27:07 +0000 Received: from AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) by AZ-NEU-EX04.Arm.com (10.251.24.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 18 Sep 2023 21:27:06 +0000 Received: from AZ-NEU-EX04.Arm.com (10.251.24.32) by AZ-NEU-EX02.Emea.Arm.com (10.251.26.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Mon, 18 Sep 2023 21:27:06 +0000 Received: from e129171.arm.com (10.57.64.238) by mail.arm.com (10.251.24.32) with Microsoft SMTP Server id 15.1.2507.27 via Frontend Transport; Mon, 18 Sep 2023 21:27:06 +0000 To: Subject: [PATCH v7 13/18] [gdb/generic] Get rid of linux-core-thread-data Date: Mon, 18 Sep 2023 22:26:46 +0100 Message-ID: <20230918212651.660141-14-luis.machado@arm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230918212651.660141-1-luis.machado@arm.com> References: <20230918212651.660141-1-luis.machado@arm.com> MIME-Version: 1.0 X-EOPAttributedMessage: 1 X-MS-TrafficTypeDiagnostic: AM7EUR03FT009:EE_|AM8PR08MB6577:EE_|AM7EUR03FT039:EE_|DU0PR08MB8640:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b132503-7726-481a-ce0a-08dbb88e080d x-checkrecipientrouted: true NoDisclaimer: true X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: 3kIVo1wzOexCrzJFundqx5v2VpskaxF6F2E7Rx/KZ4NoBNKggF3oOx/Hu4/ltqlAcALbhr8QAFAXUT8DMsXOtXSVXDghj+BM6hljSpsKhSIQN4s4H0YJ93TYPqt/WLu6NDjGoHsy/JzGAWqWHkMmArV/wc4zmzrPZzPiYLPFHmm+SbsO+m89pcqjCxDQhI8RZ74pKZ6iP04cvD+Go5JGGnp7SPJdEobQytWMctY9M8ek3GyQO0eMBuxvBVrYRE6FOW8oJymukhA/iF4IoODW/XwUOJQ+MOUEXAa9sJtJ/a1wXQtsahL847H9Rt+1WHQA5trEUKiOXpoU4ifiV8j4xPvX1hGbtb6+9ZZ5LqMBHFQU6nNCXANn3mNeRgd370VkrTozirHNrTviK1j1iHDW+FBENoZDVMSzts1fFVXz5xo6yJABnwrBBFJO/rHov2vUzKT32dSj1Lz5ipt8asS2MIDP+l3U0imIwVSyNqY/1v8JVEpFd7JEpqniC2Xw84yqQUdWONANNurOdkz7rrcWdm/PhRUuO8Gy6tHi3j2g7065Tz0DCSknnbjV1U/1JjBrZjclSSlDtangUJhjz/Lu3+P00r2rxc9+AZc1M9s2FcxW6NeHh/n15TsV/l+OWkKenfZRw8bj7TuJzkvPQprEue37bo58KI+LuZIINjIc/B6X3wsDJ7r413fAP6LNEH4V84iA1iWvf/zQZODeqG7OkApmANZf0gss3r+uuRCKVcDnUcomlXBXK1HjsjEAqYMQnC7MUdm5B5YgVe2aEgb7ejH0vaXbC+V7TEI+GkJbjvdZOFbqELQNJfxn5YYul9KO X-Forefront-Antispam-Report-Untrusted: CIP:40.67.248.234; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:nebula.arm.com; PTR:InfoDomainNonexistent; CAT:NONE; SFS:(13230031)(4636009)(346002)(39860400002)(136003)(376002)(396003)(82310400011)(1800799009)(451199024)(186009)(46966006)(36840700001)(40470700004)(2616005)(70586007)(70206006)(54906003)(316002)(6916009)(82740400003)(41300700001)(36860700001)(7696005)(6666004)(5660300002)(8936002)(1076003)(4326008)(8676002)(86362001)(478600001)(44832011)(26005)(426003)(336012)(83380400001)(36756003)(40460700003)(40480700001)(356005)(81166007)(2906002)(47076005)(26583001)(41533002)(36900700001); DIR:OUT; SFP:1101; X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR08MB6577 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id-Prvs: e454b01b-b112-4c20-fc42-08dbb88e02b1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u7JnnhLjKfSPrY9axea65ZaFnen7NauJWutHBwjryGP86gRarjfHgRvUvbOV3tlpNydBgtA9d7Ac8H8mJTywr7eJo4KOL10ot7S3otaPBV+JfyS7MH/WFXzoXHNf7JFRxFjVxY7rHicAN1vn45iN0wtrmdrXw5z404C0OEIg2rOeixpz7k68eTn+wVVoisZ8vX/WFiTmANbAG+4TdlW0UgnRoMGiglWpgvoOgVO3ximMeO+0kznvSr6EqbN6/99TxzxtQEpgmtzLoz5yTspMEEGlVi0lywHFIpATtcTq/KHJJpHGUSqdJArDTM2MqjUObRElBdovU0iu3Tc7pAjCH6mwR3+4Er+y7HA8Uk9boJTXwR0q/rlD9m2P10VjvgQmRxtO06o1opDZjsFCT9NZut+pROHBPnzSiGmGbqyfts0HBUVVDZgnjZpixl043zzGdQN8gGzYAoFXlCTqVecw/+qAJnuyYCpn6nptG972lus3VArdZ17y7/JKs/aZGKQhuP4OnUJFp4vKeIZYEyFGlUhXmUOS5agW8ayfvcgX8IuWN6AvcW8ojWKOhizv0OTFRNLuPQbdB+pIEDiAjVz5bBdTCwMlY3klJFAGpRI2MUiePMzoO39LJvhOSp+1Q6BqfSMq0MUfVtQBq3/9Tsj0mEiHeRULq+WkIyG015Dt0Ba7+RIU21Qu2cSc/cuqFz7TEv3OuQ1BgxBDLmQAV+Z0L8eceBWXctgxr9c3tWQvX/EoDClHio0yFtZfFMf+kE0lcj7UbMwNtlSSbgFrtWBt421+gl6M7Ln/Sa8VmiV0qA8= X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFS:(13230031)(4636009)(376002)(39860400002)(346002)(396003)(136003)(451199024)(82310400011)(186009)(1800799009)(36840700001)(46966006)(40470700004)(40480700001)(5660300002)(44832011)(7696005)(86362001)(54906003)(316002)(41300700001)(70586007)(70206006)(6666004)(478600001)(6916009)(8936002)(2616005)(8676002)(81166007)(26005)(82740400003)(2906002)(36860700001)(36756003)(47076005)(336012)(426003)(107886003)(40460700003)(1076003)(4326008)(83380400001)(26583001)(41533002); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2023 21:27:16.2421 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b132503-7726-481a-ce0a-08dbb88e080d X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM7EUR03FT039.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR08MB8640 X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, FORGED_SPF_HELO, GIT_PATCH_0, KAM_DMARC_NONE, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_NONE, TXREP, UNPARSEABLE_RELAY 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Luis Machado via Gdb-patches From: Luis Machado Reply-To: Luis Machado Cc: thiago.bauermann@linaro.org Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This struct type seems to have been used in the past as a callback parameter. Now it seems that case is no longer true, so we can simplify things by passing the individual parameters linux_core_thread_data encapsulates directly to the functions. This is just a cleanup before the next change. Approved-By: Simon Marchi --- gdb/linux-tdep.c | 49 +++++++++++++++--------------------------------- 1 file changed, 15 insertions(+), 34 deletions(-) diff --git a/gdb/linux-tdep.c b/gdb/linux-tdep.c index b5eee5e108c..a4a86b01bdb 100644 --- a/gdb/linux-tdep.c +++ b/gdb/linux-tdep.c @@ -1820,47 +1820,29 @@ linux_get_siginfo_data (thread_info *thread, struct gdbarch *gdbarch) return buf; } -struct linux_corefile_thread_data -{ - linux_corefile_thread_data (struct gdbarch *gdbarch, bfd *obfd, - gdb::unique_xmalloc_ptr ¬e_data, - int *note_size, gdb_signal stop_signal) - : gdbarch (gdbarch), obfd (obfd), note_data (note_data), - note_size (note_size), stop_signal (stop_signal) - {} - - struct gdbarch *gdbarch; - bfd *obfd; - gdb::unique_xmalloc_ptr ¬e_data; - int *note_size; - enum gdb_signal stop_signal; -}; - /* Records the thread's register state for the corefile note section. */ static void linux_corefile_thread (struct thread_info *info, - struct linux_corefile_thread_data *args) + struct gdbarch *gdbarch, bfd *obfd, + gdb::unique_xmalloc_ptr ¬e_data, + int *note_size, gdb_signal stop_signal) { - gcore_elf_build_thread_register_notes (args->gdbarch, info, - args->stop_signal, - args->obfd, &args->note_data, - args->note_size); + gcore_elf_build_thread_register_notes (gdbarch, info, stop_signal, obfd, + ¬e_data, note_size); /* Don't return anything if we got no register information above, such a core file is useless. */ - if (args->note_data != NULL) + if (note_data != nullptr) { gdb::byte_vector siginfo_data - = linux_get_siginfo_data (info, args->gdbarch); + = linux_get_siginfo_data (info, gdbarch); if (!siginfo_data.empty ()) - args->note_data.reset (elfcore_write_note (args->obfd, - args->note_data.release (), - args->note_size, - "CORE", NT_SIGINFO, - siginfo_data.data (), - siginfo_data.size ())); + note_data.reset (elfcore_write_note (obfd, note_data.release (), + note_size, "CORE", NT_SIGINFO, + siginfo_data.data (), + siginfo_data.size ())); } } @@ -2095,17 +2077,16 @@ linux_make_corefile_notes (struct gdbarch *gdbarch, bfd *obfd, int *note_size) else stop_signal = GDB_SIGNAL_0; - linux_corefile_thread_data thread_args (gdbarch, obfd, note_data, note_size, - stop_signal); - if (signalled_thr != nullptr) - linux_corefile_thread (signalled_thr, &thread_args); + linux_corefile_thread (signalled_thr, gdbarch, obfd, note_data, note_size, + stop_signal); for (thread_info *thr : current_inferior ()->non_exited_threads ()) { if (thr == signalled_thr) continue; - linux_corefile_thread (thr, &thread_args); + linux_corefile_thread (thr, gdbarch, obfd, note_data, note_size, + stop_signal); } if (!note_data)