From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id lLyeHFdmvmqR4yMAWB0awg (envelope-from ) for ; Thu, 01 Oct 2026 09:55:35 -0400 Authentication-Results: simark.ca; dkim=pass (2048-bit key; unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=a4Q6jw3m; dkim-atps=neutral Received: by simark.ca (Postfix, from userid 112) id 5E0811E051; Thu, 01 Oct 2026 09:55:35 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-25) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-2.4 required=5.0 tests=ARC_SIGNED,ARC_VALID,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_VALIDITY_CERTIFIED_BLOCKED, RCVD_IN_VALIDITY_RPBL_BLOCKED,RCVD_IN_VALIDITY_SAFE_BLOCKED autolearn=ham autolearn_force=no version=4.0.1 Received: from vm01.sourceware.org (vm01.sourceware.org [38.145.34.32]) (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 96C251E01F for ; Thu, 01 Oct 2026 09:55:34 -0400 (EDT) Received: from vm01.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 06F724BB5925 for ; Thu, 1 Oct 2026 13:55:33 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 06F724BB5925 Authentication-Results: sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=a4Q6jw3m Received: from smtp.polymtl.ca (smtp.polymtl.ca [132.207.4.11]) by sourceware.org (Postfix) with ESMTPS id 6717C4BB58D1 for ; Thu, 1 Oct 2026 13:55:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6717C4BB58D1 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=polymtl.ca Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=polymtl.ca ARC-Filter: OpenARC Filter v1.0.0 sourceware.org 6717C4BB58D1 Authentication-Results: sourceware.org; arc=none smtp.remote-ip=132.207.4.11 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790862909; cv=none; b=flBSlFSohJF2/iXKGlHZjuSLMQoYRdk12p5FOnilj5BwlYSFfh7f74mgtRKl2G5FXvmlZEqkKQzX+XlgFd4GhhTa+2grzD1Dj6yvB8Rr46n+TuQCXPiWaVsI7eww6A7paK5/O3heM25dlePp8OU06hAOU1UEhslY8fqBPdHOEzQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1790862909; c=relaxed/simple; bh=LVDZm9JOquwJNPH39uGsqo/ueFlXTByvQs4q10zS/HU=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=nY2JnxTdmV0eFv7DNZIdEHI29UMe5v41iNEEKaB/icKDBns8YNeJ0PxiTkzPQozRSJtHvPIJDUX0Npn+8ctMuxF15nUSkmPL3S/kB0N3PttC8JCbuVGHDeRAQXxhRvCGfNcYOxRHPH/7tBgl+d6wD4krm5Y8hQzkHD4RuXEIdik= ARC-Authentication-Results: i=1; sourceware.org; dkim=pass (2048-bit key, unprotected) header.d=polymtl.ca header.i=@polymtl.ca header.a=rsa-sha256 header.s=oct2025 header.b=a4Q6jw3m DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6717C4BB58D1 Received: from simark.ca (simark.ca [158.69.221.121]) (authenticated bits=0) by smtp.polymtl.ca (8.14.7/8.14.7) with ESMTP id 691DsxpH113429 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 1 Oct 2026 09:55:05 -0400 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp.polymtl.ca 691DsxpH113429 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=polymtl.ca; s=oct2025; t=1790862905; bh=xp0Oh1IGNP0IA504goOVZRr05EkLRMVJYlmrfYqq2hQ=; h=Date:Subject:To:Cc:From:In-Reply-To:From; b=a4Q6jw3mIZXGz8qYk/gq28tXrGc/wxe6ASstTfPLJZAJyOHhrlClD3JoYZtiAIa/T JrCJ2Lb+uc22taHg7C0lROcio2H86lWPibgsdORibWjA8jqxagm3kF1QLBDVp0++Up wyxhyvVFyeF0abveStq50ml41Rd4ju+bxNQIAcsFACYZaB30g+0QDKtu26gYqEt4Fa bcCyLP3jaxm4RZk4LzyOmEXPP7bTUe4oQSiXQKbVDwn0IeInv7BVpPDDCwE7SThyOq Lw+p2t33p5h+tu33+aGuaZtaN9uKSHNESJ6NXUzAYebgVUp+JNkUZrMxSjelTp4c3H dyltED4aw698A== Received: by simark.ca (Postfix) id 395971E01F; Thu, 01 Oct 2026 09:54:59 -0400 (EDT) Message-ID: <88f387e1-f1d5-4565-852c-c1d9a91dfe02@polymtl.ca> Date: Thu, 1 Oct 2026 09:54:58 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 03/11] gdb: factor out regexp compilation from global_symbol_searcher::search To: Andrew Burgess , gdb-patches@sourceware.org Cc: Simon Marchi References: <20260929194119.155169-1-simon.marchi@efficios.com> <20261001020952.698419-4-simon.marchi@polymtl.ca> <877bk1zhgc.fsf@redhat.com> Content-Language: fr From: Simon Marchi In-Reply-To: <877bk1zhgc.fsf@redhat.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Poly-FromMTA: (simark.ca [158.69.221.121]) at Thu, 1 Oct 2026 13:55:00 +0000 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 >> +static std::optional >> +compile_symbol_search_regex (const char *regexp) >> { >> - std::optional name_regex; >> - std::optional type_regex; >> + if (regexp == nullptr) >> + return {}; >> >> - if (m_symbol_name_regexp != NULL) >> - { >> - const char *symbol_name_regexp = m_symbol_name_regexp; >> - std::string symbol_name_regexp_holder; >> + int cflags >> + = REG_NOSUB | (case_sensitivity == case_sensitive_off ? REG_ICASE : 0); >> >> - /* Make sure spacing is right for C++ operators. >> - This is just a courtesy to make the matching less sensitive >> - to how many spaces the user leaves between 'operator' >> - and or . */ >> - const char *op_end; >> - const char *opname = operator_chars (symbol_name_regexp, &op_end); >> + return std::make_optional (regexp, cflags, >> + _("Invalid regexp")); > > I think the indentation of the "Invalid regexp" line is off. Ah yeah it's because I switched to make_optional at the last minute (it avoids using std::in_place. >> - if (m_symbol_type_regexp != NULL) >> + if (*opname) >> { >> - int cflags = REG_NOSUB | (case_sensitivity == case_sensitive_off >> - ? REG_ICASE : 0); >> - type_regex.emplace (m_symbol_type_regexp, cflags, >> - _("Invalid regexp")); >> + /* -1 means ok; otherwise number of spaces needed. */ >> + int fix = -1; >> + >> + if (c_isalpha (*opname) || *opname == '_' || *opname == '$') >> + { >> + /* There should 1 space between 'operator' and 'TYPENAME'. */ > > This comment has a (pre-existing) missing 'be': > > /* There should BE 1 space between .... */ > >> + if (opname[-1] != ' ' || opname[-2] == ' ') >> + fix = 1; >> + } >> + else >> + { >> + /* There should 0 spaces between 'operator' and 'OPERATOR'. */ > > Same missing 'BE' here. Fixed those 2. > > With those all fixed: > > Approved-By: Andrew Burgess Thanks, Simon