From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd31.google.com (mail-io1-xd31.google.com [IPv6:2607:f8b0:4864:20::d31]) by sourceware.org (Postfix) with ESMTPS id 3BA0C3858D1E for ; Mon, 30 Jan 2023 18:32:45 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3BA0C3858D1E Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=adacore.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=adacore.com Received: by mail-io1-xd31.google.com with SMTP id r6so2296666ioj.5 for ; Mon, 30 Jan 2023 10:32:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=NenKBqBpfhQlNDkbUJmnd8r01ZVCShGnWUBKcC6Tn24=; b=BW1hAONjaJ2gkbypQelwERhz8MufoPQZabto5CUN3DTlL8p4th066KndItXQQFDVGe yiTVrjejzrdrJsDDIuW8x4UBSYYnTVNykhHY6G2DWLU4X+80L7fglUc3TIMlHTK6Bv4G tBbU3B0Yvq9XlIicA05mTPydY63cLT20IXpdunX367eNd9rxBcouAHGR+XKWKjvTsPDb CgYQQDugWXhP57Ngn+mKWaduWQ5EJvw7L9FBYlFsc/OEL1cVWPOHJfUnaI1kcbq8XuiF nEaSO4IkWzFmM5R8l66Fs05Z4uND8owE7iGaNLuGoX2oTSVhB13nqfCNvrdVZDrnpWEa nYcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:in-reply-to:date:references :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=NenKBqBpfhQlNDkbUJmnd8r01ZVCShGnWUBKcC6Tn24=; b=Oq6L3DDklwb1aS7xoBMbZ6TVNHKBcKtsChieLCPcRSEf9+V+TFzhNow7Pp/RH22Mcz NyaSMYqWNCravd8+wZaVM88BIm2qiXxZAl+8xqMwF7X6ouhjdkLr649sBMhTXf7q1qr/ Im8FBs26WeJ6SGa8xmiCTHJ526wSLT4LZRTfpdJ0FNdKMCJ1mF+Z9isTwACl8czalRVQ HUu33ncuWLgmZW1wD5Iy1ZUuZrl9ajfWiNWGj7Sc0YWsXgV1S+yjDdF17Jrf/luyED9X BI4+4mM09OexIuo7H0mV9SSnScX8vLvANBI25DIp1xr6yOV30nn7N2S0TSqxJycY6uO5 ZyEQ== X-Gm-Message-State: AO0yUKVIzybnoBmBJwSx12jVX9S1hJaoqAacINj/yF604+aRbBwEdnnz TOrE/LYKS1+ptCXVhjA6zV4DfQ== X-Google-Smtp-Source: AK7set+foa6g4xeJa9uPq6TZxhhJDyHHJp8Qcz95uTn8I2KeCXnFplVKW60L32NiG0ZRwbGui/m/5A== X-Received: by 2002:a6b:b40d:0:b0:71b:3544:887 with SMTP id d13-20020a6bb40d000000b0071b35440887mr3875459iof.10.1675103564537; Mon, 30 Jan 2023 10:32:44 -0800 (PST) Received: from murgatroyd (75-166-146-144.hlrn.qwest.net. [75.166.146.144]) by smtp.gmail.com with ESMTPSA id l4-20020a6bd104000000b006f8b7d869a0sm4547086iob.1.2023.01.30.10.32.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Jan 2023 10:32:44 -0800 (PST) From: Tom Tromey To: Pedro Alves Cc: gdb-patches@sourceware.org, Kevin Buettner Subject: Re: [PATCH] Simplify interp::exec / interp_exec - let exceptions propagate References: <20230127230545.77750-1-pedro@palves.net> X-Attribution: Tom Date: Mon, 30 Jan 2023 11:32:43 -0700 In-Reply-To: <20230127230545.77750-1-pedro@palves.net> (Pedro Alves's message of "Fri, 27 Jan 2023 23:05:45 +0000") Message-ID: <87ilgnootw.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,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 List-Id: >>>>> "Pedro" == Pedro Alves writes: Pedro> This patch implements a simplication that I suggested here: Pedro> https://sourceware.org/pipermail/gdb-patches/2022-March/186320.html Pedro> Currently, the interp::exec virtual method interface is such that Pedro> subclass implementations must catch exceptions and then return them Pedro> via normal function return. ... Pedro> And, I can't see why we need to have interp_exec catch the exception Pedro> and return it via the normal return path. That's normally needed when Pedro> we need to handle propagating exceptions across C code, like across Pedro> readline or ncurses, but that's not the case here. I think this is probably a leftover from the old libgdb idea. I don't really know much about it other than what I saw in comments, but I gather the idea was to present a more ordinary C API, so return values rather than longjmp exceptions. Of course we gave up on that ages ago. Pedro> It seems to me that we can simplify things by removing some Pedro> try/catch-ing and just letting exceptions propagate normally. Agreed. Approved-By: Tom Tromey Tom