Message ID | 20240827140021.32660-3-tdevries@suse.de |
---|---|
State | Committed |
Headers |
Return-Path: <gdb-patches-bounces~patchwork=sourceware.org@sourceware.org> 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 B35A8384AB5D for <patchwork@sourceware.org>; Tue, 27 Aug 2024 14:00:17 +0000 (GMT) X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by sourceware.org (Postfix) with ESMTPS id B93CA3860740 for <gdb-patches@sourceware.org>; Tue, 27 Aug 2024 13:59:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org B93CA3860740 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=suse.de Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=suse.de ARC-Filter: OpenARC Filter v1.0.0 sourceware.org B93CA3860740 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=2a07:de40:b251:101:10:150:64:2 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724767159; cv=none; b=jsHHd1zOOvCqWJb0E31emCUANl2pxxYg+KfpXuaQiCgSmQ91YrpNPlrfmqtp89etgrx573NGS0x4K/rTTi3gfu1SpSs1dKdcMxolMVfLApapSC3+ldfPhQpGeWayBxIyL7VLXpOzAfg4rpxBUSC45bA9UgnnlPR7IVxsA/cyy1o= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1724767159; c=relaxed/simple; bh=ia8Icly/X1AmuSTEomg/PpZTL2IRVM5t0r02R6uU8Gw=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature:From: To:Subject:Date:Message-Id:MIME-Version; b=ZoCqndzQ5JZhHCr+QvB53jcrENDq/e6WrLoXbvRDFOqGjvFvjmnt5Pyionsp8lAFKaQSGcklyHz++IrK2sqGQ2CEpwtrTUMurXiLQZQKQxMN9E0zMPCRmFyUgET323nIFx7P6gE8G/8AK4dL8yFxeL/DNZ+AGvPLJ1NzPnGvTw0= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id AC41B1FB6C for <gdb-patches@sourceware.org>; Tue, 27 Aug 2024 13:59:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1724767155; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o+QMjhBoHIZI3HLdpbUF/nLxnmdj7zG2NJNqmgixDPU=; b=tTWM3lLF8oJxMXXalwAeNHrUAh8wjin1GeHVT4D40XEDTRJhCJKnYH5lXDGB90zEuPBRs1 L+/jHgXC/w9WMKJ+vMjXrhw3xc2EKxYJZLm7dcK3Ij7E/4sHYkmPRsSagSkxy/ahh8MdHe FtOaqKYKRDfYwtg33JUUKKhRsQVCEVE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1724767155; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o+QMjhBoHIZI3HLdpbUF/nLxnmdj7zG2NJNqmgixDPU=; b=YDQawD/ve4DgSN4IE/ZNn6UISfND2/n/0GUp91H5HcnISBIFvbLPppPLfv3MqVCiFebwIW do+NNPztn3fioRBg== Authentication-Results: smtp-out2.suse.de; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=tTWM3lLF; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b="YDQawD/v" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1724767155; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o+QMjhBoHIZI3HLdpbUF/nLxnmdj7zG2NJNqmgixDPU=; b=tTWM3lLF8oJxMXXalwAeNHrUAh8wjin1GeHVT4D40XEDTRJhCJKnYH5lXDGB90zEuPBRs1 L+/jHgXC/w9WMKJ+vMjXrhw3xc2EKxYJZLm7dcK3Ij7E/4sHYkmPRsSagSkxy/ahh8MdHe FtOaqKYKRDfYwtg33JUUKKhRsQVCEVE= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1724767155; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o+QMjhBoHIZI3HLdpbUF/nLxnmdj7zG2NJNqmgixDPU=; b=YDQawD/ve4DgSN4IE/ZNn6UISfND2/n/0GUp91H5HcnISBIFvbLPppPLfv3MqVCiFebwIW do+NNPztn3fioRBg== Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id 91B2E13A44 for <gdb-patches@sourceware.org>; Tue, 27 Aug 2024 13:59:15 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id UA7kIbPbzWbvBgAAD6G6ig (envelope-from <tdevries@suse.de>) for <gdb-patches@sourceware.org>; Tue, 27 Aug 2024 13:59:15 +0000 From: Tom de Vries <tdevries@suse.de> To: gdb-patches@sourceware.org Subject: [PATCH 3/7] [gdb] Eliminate catch(...) in execute_fn_to_string Date: Tue, 27 Aug 2024 16:00:17 +0200 Message-Id: <20240827140021.32660-3-tdevries@suse.de> X-Mailer: git-send-email 2.35.3 In-Reply-To: <20240827140021.32660-1-tdevries@suse.de> References: <20240827140021.32660-1-tdevries@suse.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspamd-Queue-Id: AC41B1FB6C X-Spam-Score: -5.01 X-Rspamd-Action: no action X-Spamd-Result: default: False [-5.01 / 50.00]; BAYES_HAM(-3.00)[99.99%]; DWL_DNSWL_MED(-2.00)[suse.de:dkim]; NEURAL_HAM_LONG(-1.00)[-1.000]; MID_CONTAINS_FROM(1.00)[]; R_MISSING_CHARSET(0.50)[]; R_DKIM_ALLOW(-0.20)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-1.000]; MIME_GOOD(-0.10)[text/plain]; MX_GOOD(-0.01)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+]; FUZZY_BLOCKED(0.00)[rspamd.com]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; RBL_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:104:10:150:64:97:from]; ARC_NA(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; FROM_HAS_DN(0.00)[]; DKIM_TRACE(0.00)[suse.de:+]; RCVD_COUNT_TWO(0.00)[2]; PREVIOUSLY_DELIVERED(0.00)[gdb-patches@sourceware.org]; TO_DN_NONE(0.00)[]; RECEIVED_SPAMHAUS_BLOCKED_OPENRESOLVER(0.00)[2a07:de40:b281:106:10:150:64:167:received]; DBL_BLOCKED_OPENRESOLVER(0.00)[imap1.dmz-prg2.suse.org:rdns, imap1.dmz-prg2.suse.org:helo, suse.de:mid, suse.de:dkim] X-Rspamd-Server: rspamd1.dmz-prg2.suse.org X-Spam-Level: X-Spam-Status: No, score=-12.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> Errors-To: gdb-patches-bounces~patchwork=sourceware.org@sourceware.org |
Series | [1/7] Handle ^C in gnu_source_highlight_test | |
Checks
Context | Check | Description |
---|---|---|
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 | success | Build passed |
linaro-tcwg-bot/tcwg_gdb_build--master-arm | success | Build passed |
linaro-tcwg-bot/tcwg_gdb_check--master-aarch64 | success | Test passed |
Commit Message
Tom de Vries
Aug. 27, 2024, 2 p.m. UTC
Remove duplicate code in execute_fn_to_string using SCOPE_EXIT. Tested on aarch64-linux. --- gdb/top.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-)
Comments
>>>>> "Tom" == Tom de Vries <tdevries@suse.de> writes:
Tom> Remove duplicate code in execute_fn_to_string using SCOPE_EXIT.
Tom> Tested on aarch64-linux.
Ok.
Approved-By: Tom Tromey <tom@tromey.com>
Tom
diff --git a/gdb/top.c b/gdb/top.c index d6bf1d448d5..eae54aae1ff 100644 --- a/gdb/top.c +++ b/gdb/top.c @@ -632,19 +632,9 @@ execute_fn_to_string (std::string &res, std::function<void(void)> fn, { string_file str_file (term_out); - try - { - execute_fn_to_ui_file (&str_file, fn); - } - catch (...) - { - /* Finally. */ - res = str_file.release (); - throw; - } + SCOPE_EXIT { res = str_file.release (); }; - /* And finally. */ - res = str_file.release (); + execute_fn_to_ui_file (&str_file, fn); } /* See top.h. */