From patchwork Mon Oct 14 12:12:06 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Guinevere Larsen X-Patchwork-Id: 98867 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 3C1A0385AC29 for ; Mon, 14 Oct 2024 12:17:00 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTP id BB3E33858433 for ; Mon, 14 Oct 2024 12:16:26 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org BB3E33858433 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org BB3E33858433 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=170.10.129.124 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728908199; cv=none; b=oToSwViQqCnCFZ1Rv8R1J2Xxn0YU0kpcYqYwCbyh5jOrEKEhL4+TAemyOwUsZVSIKwIkAV+X5XU+HZbAZ7AYEgzyCyuJxu671n9ciV2wQcLU514wRKjvwx+UFjHKe53jcbaqZfYVtiGwAuE9EpsxZGtq5LAAGLZ0OJ+SEmdubLo= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1728908199; c=relaxed/simple; bh=SCU+oCjsqd66hOKx1EMD/w6E1nJmJ5Yk0ml3Gq9JQNQ=; h=DKIM-Signature:From:To:Subject:Date:Message-ID:MIME-Version; b=K6yO9UO+Z9nH+hax+Yv2S5rjJDiWlqzIJ4LG03YcB/G1fLySqiZ2quxrpvsQ2f4NNA/2i94ra3GVTxgJXWjy8GVd5Pop/DuPyMe9+MREmC6ziXuYGZSYeOy9zxLMJVvh9DJsd5sk11H9sdfWrvdReF0uGWzeERVbmEDNi6vhSjA= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1728908186; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=V32fWXsYeCNlpADnJ5xpesQMc7MI/610Xon6GA/d13A=; b=KrrmRzmq1dvs0b7/Xillmoes2d5votY1Krdq10M2boUteK6GbsLVwUppBRCLfsq9ouM7wR Bb0OVKN4lC+BCOfLJIavGBF0MEMHA96RAMzvgCBPMWxAgPwnKFbgtoAc5AxXSMOs/4lexY +MYUVlyU6f6x3YuUM4KfqHZ2HEbEUks= Received: from mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-183-812ApBepNsmMKyAk-nVukQ-1; Mon, 14 Oct 2024 08:16:25 -0400 X-MC-Unique: 812ApBepNsmMKyAk-nVukQ-1 Received: from mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.4]) (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 mx-prod-mc-05.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 68A171956088 for ; Mon, 14 Oct 2024 12:16:24 +0000 (UTC) Received: from fedora.redhat.com (unknown [10.96.134.65]) by mx-prod-int-01.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id D5DC93000198; Mon, 14 Oct 2024 12:16:22 +0000 (UTC) From: Guinevere Larsen To: gdb-patches@sourceware.org Cc: Guinevere Larsen Subject: [OBV PATCH] gdb: make frame_unwind_try_unwinder return bool Date: Mon, 14 Oct 2024 09:12:06 -0300 Message-ID: <20241014121205.1421183-2-guinevere@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.4.1 on 10.30.177.4 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H3, RCVD_IN_MSPIKE_WL, RCVD_IN_SBL_CSS, SPF_HELO_NONE, SPF_NONE, 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.30 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org Before this commit, the function frame_unwind_try_unwinder would return an int, where 1 meant the unwinder works, and 0 it doesn't. This is just a boolean with extra steps, so this commit updates the function to return bool instead. --- This was pushed as obvious, as suggested by Simon in this email: https://inbox.sourceware.org/gdb-patches/20241010172220.3700189-1-guinevere@redhat.com/T/#m77c2e9864a2bb4d815e910261fc1eea78e38eb13 --- gdb/frame-unwind.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/gdb/frame-unwind.c b/gdb/frame-unwind.c index e5f108d3257..fecd1070e91 100644 --- a/gdb/frame-unwind.c +++ b/gdb/frame-unwind.c @@ -119,10 +119,10 @@ frame_unwind_append_unwinder (struct gdbarch *gdbarch, } /* Call SNIFFER from UNWINDER. If it succeeded set UNWINDER for - THIS_FRAME and return 1. Otherwise the function keeps THIS_FRAME - unchanged and returns 0. */ + THIS_FRAME and return true. Otherwise the function keeps THIS_FRAME + unchanged and returns false. */ -static int +static bool frame_unwind_try_unwinder (const frame_info_ptr &this_frame, void **this_cache, const struct frame_unwind *unwinder) { @@ -157,7 +157,7 @@ frame_unwind_try_unwinder (const frame_info_ptr &this_frame, void **this_cache, thus most unwinders aren't able to determine if they're the best fit. Keep trying. Fallback prologue unwinders should always accept the frame. */ - return 0; + return false; } throw; } @@ -165,7 +165,7 @@ frame_unwind_try_unwinder (const frame_info_ptr &this_frame, void **this_cache, if (res) { frame_debug_printf ("yes"); - return 1; + return true; } else { @@ -173,7 +173,7 @@ frame_unwind_try_unwinder (const frame_info_ptr &this_frame, void **this_cache, /* Don't set *THIS_CACHE to NULL here, because sniffer has to do so. */ frame_cleanup_after_sniffer (this_frame); - return 0; + return false; } gdb_assert_not_reached ("frame_unwind_try_unwinder"); }