From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KUKKI73OqmX3+QAAWB0awg (envelope-from ) for ; Fri, 19 Jan 2024 14:34:21 -0500 Authentication-Results: simark.ca; dkim=pass (1024-bit key; unprotected) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=vTJubPsF; dkim=pass header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AnfFyF/L; dkim=pass (1024-bit key) header.d=suse.de header.i=@suse.de header.a=rsa-sha256 header.s=susede2_rsa header.b=vTJubPsF; dkim=neutral header.d=suse.de header.i=@suse.de header.a=ed25519-sha256 header.s=susede2_ed25519 header.b=AnfFyF/L; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 7F1A41E0C3; Fri, 19 Jan 2024 14:34:21 -0500 (EST) Received: from server2.sourceware.org (server2.sourceware.org [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 3EF1D1E092 for ; Fri, 19 Jan 2024 14:34:19 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 9DB473858417 for ; Fri, 19 Jan 2024 19:34:18 +0000 (GMT) Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.223.131]) by sourceware.org (Postfix) with ESMTPS id D31F93858C2D for ; Fri, 19 Jan 2024 19:33:27 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org D31F93858C2D 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 D31F93858C2D Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=195.135.223.131 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705692809; cv=none; b=cA0skV917c1QIsk/WJOWBo2inzNiinREqQEQmvG9Ty3IjbZiL5BpsrM8Wt49quj72jRfJYyInocQBTalkItRer2FqwaqCllmiHmuhTUT6oPaM1fYGiPdWr/fVXvndR649HPAR4YBREZtVxVdtTY32dXfSQPU4WoMJ8Axat409/I= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1705692809; c=relaxed/simple; bh=oReGTRVkR3K1NQFOiU93AupiHGQhpzl4a1+GjrHGV9s=; h=DKIM-Signature:DKIM-Signature:DKIM-Signature:DKIM-Signature: Message-ID:Date:MIME-Version:Subject:To:From; b=eJXxIMMFuEfX6ODIeCHO6DcPmZyp0WJSLZYd+H3bfFzU9zlpLAqYNZfU16jaG3JnCiA8tMQnva9WGGsIrDQL9auGQBdWY3uaOvp2Ro1kC7SZdC+Rux6ZDRefOstYIHOPu6MhXiWtPrvC0yw3Xclyo51QjIWV9QXPp7ryxDMBEzU= ARC-Authentication-Results: i=1; server2.sourceware.org Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [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 958601F80A; Fri, 19 Jan 2024 19:33:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705692806; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xNYfXNA4mTf1FzOpE+3vKYJZ4mc98oM5OlszBRfLquk=; b=vTJubPsFCCmKP0zLcTVB1sWv4kJrCnzkZvtxcFbXBi+WaVcgvmApxWU5ufcKp9Ckbpvpbx pPl8A369SQNLIHMT1x/qWI+fWEqrBvwdOAHKj8kaVRooaXTsbrwfhHm2qyB3T90tNaFKMG U1IzE8FWCJGe17TYrci4AT2qj1hrOvg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705692806; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xNYfXNA4mTf1FzOpE+3vKYJZ4mc98oM5OlszBRfLquk=; b=AnfFyF/LPTjJWlTtVkVTfDNmMERDg2jO9r6yUOXn/pma38ys73RGUd6HGE6VQ0zVNQ7lOR V1pPLf7ps4Aqz0Cg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1705692806; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xNYfXNA4mTf1FzOpE+3vKYJZ4mc98oM5OlszBRfLquk=; b=vTJubPsFCCmKP0zLcTVB1sWv4kJrCnzkZvtxcFbXBi+WaVcgvmApxWU5ufcKp9Ckbpvpbx pPl8A369SQNLIHMT1x/qWI+fWEqrBvwdOAHKj8kaVRooaXTsbrwfhHm2qyB3T90tNaFKMG U1IzE8FWCJGe17TYrci4AT2qj1hrOvg= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1705692806; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=xNYfXNA4mTf1FzOpE+3vKYJZ4mc98oM5OlszBRfLquk=; b=AnfFyF/LPTjJWlTtVkVTfDNmMERDg2jO9r6yUOXn/pma38ys73RGUd6HGE6VQ0zVNQ7lOR V1pPLf7ps4Aqz0Cg== 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 66F661375D; Fri, 19 Jan 2024 19:33:26 +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 JM4qF4bOqmVBGAAAD6G6ig (envelope-from ); Fri, 19 Jan 2024 19:33:26 +0000 Message-ID: <6fb49b9c-691a-4a65-9af5-844b31a534af@suse.de> Date: Fri, 19 Jan 2024 20:34:27 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/4 v8] gdb: Buffer output streams during events that might download debuginfo Content-Language: en-US To: Aaron Merey , luis.machado@arm.com Cc: aburgess@redhat.com, thiago.bauermann@linaro.org, gdb-patches@sourceware.org References: <35826cb5-1ff6-4101-9105-ffb9512e7b44@arm.com> <20240119171352.827651-1-amerey@redhat.com> From: Tom de Vries In-Reply-To: <20240119171352.827651-1-amerey@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Authentication-Results: smtp-out2.suse.de; none X-Spam-Level: X-Spam-Score: -1.29 X-Spamd-Result: default: False [-1.29 / 50.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; XM_UA_NO_VERSION(0.01)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; BAYES_HAM(-0.01)[45.15%]; MIME_GOOD(-0.10)[text/plain]; NEURAL_HAM_LONG(-1.00)[-1.000]; RCPT_COUNT_FIVE(0.00)[5]; RCVD_COUNT_THREE(0.00)[3]; DKIM_SIGNED(0.00)[suse.de:s=susede2_rsa,suse.de:s=susede2_ed25519]; NEURAL_HAM_SHORT(-0.20)[-0.998]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; MID_RHS_MATCH_FROM(0.00)[] X-Spam-Status: No, score=-12.3 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: gdb-patches-bounces+public-inbox=simark.ca@sourceware.org On 1/19/24 18:13, Aaron Merey wrote: > Hi Luis, > > On Fri, Jan 19, 2024 at 9:35 AM Luis Machado wrote: >> >> I bisected a number of failures in gdb.dwarf2/dw2-dir-file-name.exp to commit 519d634396592c5698add4a327468e6e6920576e. >> >> In particular, my testing was done on aarch64-linux (Ubuntu 20.04). > > Thanks for finding this. These regressions are due to a last-minute > decision to replace throw_exception with throw in one of the functions > added in commit 519d634. > > I'm going to merge the patch below that restores throw_exception. > Regression tested on Fedora 39 x86_64. > > Aaron > > --- > gdb/ui-out.h: Fix exception handling in do_with_buffered_output > > Replace throw with throw_exeception in do_with_buffered_output. > > This patch fixes regressions in gdb.dwarf2/dw2-dir-file-name.exp > caused by commit 519d63439. > > do_with_buffered_output needs to use throw_exception instead of > throw to ensure that exceptions of the correct type are thrown. > If using throw, gdb_exception_error may be wrongly converted into > gdb_exception during print_frame_info. This prevents the exception > from being caught in print_stack_frame. Hi Aaron, what you're describing here sounds like exception slicing. The easiest way to fix this is by rethrowing using "throw" without argument. See this ( https://en.cppreference.com/w/cpp/language/throw ): ... When rethrowing exceptions, the second form must be used to avoid object slicing in the (typical) case where exception objects use inheritance: ... Thanks, - Tom > --- > gdb/ui-out.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/gdb/ui-out.h b/gdb/ui-out.h > index 71add908a84..5b6ddd55063 100644 > --- a/gdb/ui-out.h > +++ b/gdb/ui-out.h > @@ -543,7 +543,7 @@ do_with_buffered_output (F func, ui_out *uiout, Arg... args) > { > func (uiout, std::forward (args)...); > } > - catch (const gdb_exception &ex) > + catch (gdb_exception &ex) > { > /* Ideally flush would be called in the destructor of buffer_group, > however flushing might cause an exception to be thrown. Catch it > @@ -556,7 +556,7 @@ do_with_buffered_output (F func, ui_out *uiout, Arg... args) > { > } > > - throw (std::move (ex)); > + throw_exception (std::move (ex)); > } > > /* Try was successful. Let any further exceptions propagate. */