From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca (simark.ca [158.69.221.121]) by sourceware.org (Postfix) with ESMTPS id 893FA3858D32 for ; Mon, 17 Oct 2022 19:45:14 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 893FA3858D32 Received: from [10.0.0.11] (unknown [217.28.27.60]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPSA id 4AEF91E0CB; Mon, 17 Oct 2022 15:45:14 -0400 (EDT) Message-ID: Date: Mon, 17 Oct 2022 15:45:13 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.1 Subject: Re: [PATCH] internal_error: remove need to pass __FILE__/__LINE__ Content-Language: en-US To: Pedro Alves , gdb-patches@sourceware.org References: <20221017185019.3233941-1-pedro@palves.net> <6e5b27a9-abd4-60f3-fc3a-d9f8fa9f6a64@simark.ca> <037dc77f-a3f9-34de-adcd-82d775c5d90f@palves.net> From: Simon Marchi In-Reply-To: <037dc77f-a3f9-34de-adcd-82d775c5d90f@palves.net> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.3 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, SPF_HELO_PASS, 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 X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 17 Oct 2022 19:45:16 -0000 On 2022-10-17 15:37, Pedro Alves wrote: > On 2022-10-17 8:27 p.m., Simon Marchi wrote: > >>> Most probably. I prefer keeping internal_error for it being more pervasive >>> and older. gdb_assert_not_reached is a more recent addition. >> >> Fine with me. >> >>>> The only difference is that gdb_assert_not_reached includes the >>>> function name, but I don't think it's an important difference. I think >>>> we could switch to a single one that does include the function name. >>> >>> I don't think it needs to be in this patch, though? >>> >>> This one is just making internal_error more convenient to call. We can >>> always look at doing something to its internals separately. >> >> Sure, it's just an idea for eventually. > > Cool, thanks. > > I guess I am not sure whether your earlier comment meant that you're OK > with the patch itself (rather than the idea), though. :-) Heh, I forgot to look at the code. It all looks good, except black reformats gdbarch.py for me here. With that fixed you can add my Reviewed-By or Approved-By (not sure which one we use when someone who can approve a patch reviews the patch of someone else who can approve). Another though for later: like gdb_assert_not_reached, we could move the gettext translation call, `_(...)`, into the internal_error macro. That would make the callers a bit simpler (although IMO these strings don't really need translation, since they are meant for GDB developers). Simon