From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66261: Disassembling a regexp's bytecode Date: Fri, 29 Sep 2023 18:06:13 +0300 Message-ID: <83bkdlyq6y.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="20353"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66261@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Sep 29 17:08:08 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qmF67-000509-LN for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 29 Sep 2023 17:08:07 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qmF5r-0007xD-E7; Fri, 29 Sep 2023 11:07:53 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qmF5p-0007wr-5W for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 11:07:49 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qmF5o-0008Jm-Jx for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 11:07:48 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qmF62-0003rw-Hp for bug-gnu-emacs@gnu.org; Fri, 29 Sep 2023 11:08:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 29 Sep 2023 15:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66261 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 66261-submit@debbugs.gnu.org id=B66261.169600003314679 (code B ref 66261); Fri, 29 Sep 2023 15:08:02 +0000 Original-Received: (at 66261) by debbugs.gnu.org; 29 Sep 2023 15:07:13 +0000 Original-Received: from localhost ([127.0.0.1]:56927 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmF5E-0003of-0x for submit@debbugs.gnu.org; Fri, 29 Sep 2023 11:07:13 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:41046) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qmF54-0003o0-Av for 66261@debbugs.gnu.org; Fri, 29 Sep 2023 11:07:11 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qmF4d-00086D-Jj; Fri, 29 Sep 2023 11:06:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=1niKS7KcpfFYTH0T91q0b0rbebzSEszpZp8Sj5OuCp0=; b=b/5DeFN5W9FN ktJkBk3JiwppsTcwac9VS4a6J+DR7R3gu51FfTTn6Xji3ll/elMxwLuVo/ZM7GiHycdiF5VO8081D mLdZP5H59LURuggZ8mRbKEqegDAOMhodGvBMqE0tHMh13JPTPm+XrXhayLzEnZ6yMSCm54pEGFOPF OCVCePPVg5EwPwc1GTnPJVvmPof/enMHPC7fUgyrzCy66/c9zePMN17340eNLxKhYzajiEjww6sel Qwief989s13v8EAvO1Qvs37j++biNAtcZn8mX3srY8qKvJDPQLi86dpJ73MUw0AwBM1CydX0epgsa 0/uu6kPY7Vh7JvyIrmvOwg==; In-Reply-To: (bug-gnu-emacs@gnu.org) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:271497 Archived-At: > Date: Thu, 28 Sep 2023 22:28:16 -0400 > From: Stefan Monnier via "Bug reports for GNU Emacs, > the Swiss army knife of text editors" > > - First, in order to easily use the same code between REGEX_EMACS_DEBUG > and my new `re--describe-compiled`, I need to print sometimes to > `stderr` and sometimes to a string, which I do using `open_memstream`. > AFAIK `open_memstream` is not directly available in Windows (and > maybe under some other Unixes either, tho it's in POSIX-2008, IIUC). > Could someone help me get an `opem_memstream` emulation working > (maybe via gnulib)? Gnulib doesn't have such an emulation, AFAICT. Why cannot you fall back to temporary files when open_memstream is not available? > - I'm thinking of always providing this function. Another option would > be to do it under the control of a compilation flag, tho it doesn't > seem worth adding a new flag just for that. I guess we could > reuse REGEX_EMACS_DEBUG (tho it's too invasive IMO), or > ENABLE_CHECKING, but I'd rather just always offer the function. > After all, it might encourage users to look more carefully at their > regexps and maybe even to help us improve our regexp engine, who knows. I would suggest to have it under ENABLE_CHECKING first, and only remove the condition if there's a demand. (I assume that most people who debug regexps build Emacs with --enable-checking.)