From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by sourceware.org (Postfix) with ESMTPS id 596623858421 for ; Mon, 24 Oct 2022 16:36:03 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 596623858421 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=palves.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wm1-f43.google.com with SMTP id t4so6886884wmj.5 for ; Mon, 24 Oct 2022 09:36:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:content-language:in-reply-to:mime-version :user-agent:date:message-id:from:references:to:subject :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Qm6/PNGlEKCrptrXbTaTEHPuP55kDpkK/cqHUK81Uqo=; b=PLNCRCBjLeMZU/Mtn6muSPrsNR87VNSjrQ2Imlh8CFJscClaNDXGB6IGcdZvaJvtzH f7y28+YO6DeCs39a4iXtifKPvH/OatdUxVK+qRw2K/ZChb3o47Zq1U6Pgj/CdLylYqvL v8JLQj+us0UZ3bQbgUDfVqC0Vzf5yHQnbhJKUqm0FxpkBO/74kxhNkpL9boh0evPBqkA LHka2ZDSem+F4Hb9hXloxNugQp7yDT0swf0rePlvX01RW5bXsdAYsm15lcO2T2VdIauo wPQVWEruh6CNTxTBQX2pITUZ2/Flaqhe9wt/iAbaxs37IkkP+i7tBq5tokIqQJ/sps7e DO8g== X-Gm-Message-State: ACrzQf3fSKFcm33guX1EBwKZlSH+GGRpAlrLEVuNZaJoDnCYjWK6R6Wu CS/4PI/ZBPJRkz7j6hOzLbS6LHAO3CEqFA== X-Google-Smtp-Source: AMsMyM5ra1D4K1OPEmS173YiDJIk1qL3JgBpsUGGq0wNxCXesp2fu76jhEzJe4uRLPQHYY5ofEsTKA== X-Received: by 2002:a05:600c:4f08:b0:3c7:6e1:7797 with SMTP id l8-20020a05600c4f0800b003c706e17797mr19164428wmq.181.1666629361718; Mon, 24 Oct 2022 09:36:01 -0700 (PDT) Received: from ?IPv6:2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653? ([2001:8a0:f93a:3b00:e038:5cdc:b8bf:4653]) by smtp.gmail.com with ESMTPSA id a8-20020a056000050800b002366fb99cdasm78025wrf.50.2022.10.24.09.36.01 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 24 Oct 2022 09:36:01 -0700 (PDT) Subject: Re: [PATCH 2/2] [gdb] Fix rethrow exception slicing in insert_bp_location To: Tom de Vries , gdb-patches@sourceware.org References: <20221024084913.19429-1-tdevries@suse.de> <20221024084913.19429-3-tdevries@suse.de> From: Pedro Alves Message-ID: Date: Mon, 24 Oct 2022 17:36:00 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.1 MIME-Version: 1.0 In-Reply-To: <20221024084913.19429-3-tdevries@suse.de> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,KAM_DMARC_STATUS,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 2022-10-24 9:49 a.m., Tom de Vries via Gdb-patches wrote: > +#define RETHROW_ON_TARGET_CLOSE_ERROR(E) \ > + do \ > + { \ > + if ((E).reason != 0) \ > + { \ > + /* Can't set the breakpoint. */ \ > + \ > + if ((E).error == TARGET_CLOSE_ERROR) \ > + /* If the target has closed then it will have deleted any \ > + breakpoints inserted within the target inferior, as a \ > + result any further attempts to interact with the \ > + breakpoint objects is not possible. Just rethrow the \ > + error. Don't use E to rethrow, to prevent object \ > + slicing of the exception. */ \ > + throw; \ > + } \ > + } while (0) Is there a reason this is a macro instead of a function?