From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd36.google.com (mail-io1-xd36.google.com [IPv6:2607:f8b0:4864:20::d36]) by sourceware.org (Postfix) with ESMTPS id 5FDBD3858CDB for ; Thu, 4 May 2023 14:21:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 5FDBD3858CDB 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-xd36.google.com with SMTP id ca18e2360f4ac-76937f5f9c5so11703039f.1 for ; Thu, 04 May 2023 07:21:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1683210084; x=1685802084; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mIJtkbNyiDmhZt6SfOYqb0KG5wSOzzvmfr6sMzqdCFo=; b=VmlK1aoBrlm2a0M8CVbL9yXAPTTnqwiSecMIPQ1EFY9ascrK8UArr8Z06iEOHv2ZcL 035VbO9rHJHt/lOZMyTRnJ9YkH7griX8SznCtK/ifDTey+ofSBuQDUnusJXrOQ3cD42Z q07wHClU1ZDbh12Ae79za8+3tIRITAl8kioqzj3bGmLCahGqjd9+ySWFzuCcz/MsSLqC VdIgegZsvAvy4dnCqDQ9ahjRdC6sVaE3CJ5lp0r29g7EaFLj68Oi2//k5tAYYPWzvmpx IcmslmjSHFtTvDyJNpmeSh/qrACadxXIlGv7OORmKr+mubGIXvYHQBPysGP1FWhycEDk r+Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683210084; x=1685802084; h=to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mIJtkbNyiDmhZt6SfOYqb0KG5wSOzzvmfr6sMzqdCFo=; b=i/noxkglzPh+4T5jOK9ZOE8OFuGxSepEoANl1Jxl/UXNoVHArBRyeznDnKDouZ6XdS QAUiP3Aps1qyyoo6nmtNXlrZ+n9Z0RCeuz6P50Jan8JntGt/XLNiuxwYPxJA0kqGYFaR 9xoQkVHtdjuLIIWljHMcOYmUEQVkc2agtSoGv+Dc+t4Y3YtmSbyZquEz4JumiqQYpI30 g4KoVhI7vkfKKIdXnyCaw4H5xc2UBljmVRZrJe91mAS71v1SrRec0qE76YRTeDNUc2hq dWgnJEHnmK/TC2EZYVsmEAnWEhJNY3YrbA0MkyA9RTHGZbKNdxsZA334nyysB0nGrng/ zLcA== X-Gm-Message-State: AC+VfDyWwH+x2n4CXCOuLFY4K1y/Su6DMO8/32sNd5jUnlEbJLgYVv5K mlPIVRsCymulM7sRZF1F0IePO/F0vzq2dLSFqL+1tQ== X-Google-Smtp-Source: ACHHUZ6UTA78GUazu3pZJmEH2W8veLadyulvhE8KO4Z89v3K/lzBploWPIADhumWhNJQkHFqZgSXmg== X-Received: by 2002:a5e:c817:0:b0:760:eab2:71b1 with SMTP id y23-20020a5ec817000000b00760eab271b1mr16561591iol.20.1683210084613; Thu, 04 May 2023 07:21:24 -0700 (PDT) Received: from localhost.localdomain (71-211-191-82.hlrn.qwest.net. [71.211.191.82]) by smtp.gmail.com with ESMTPSA id r16-20020a6b4410000000b00760a07e4e09sm9983384ioa.5.2023.05.04.07.21.24 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 07:21:24 -0700 (PDT) From: Tom Tromey Date: Thu, 04 May 2023 08:21:22 -0600 Subject: [PATCH 01/11] Avoid forward declaration in parse.c MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20230504-frameless-v1-1-4191201740b0@adacore.com> References: <20230504-frameless-v1-0-4191201740b0@adacore.com> In-Reply-To: <20230504-frameless-v1-0-4191201740b0@adacore.com> To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-11.3 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE 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: This minorly rearranges parse.c to avoid the need for a forward declaration. --- gdb/parse.c | 42 ++++++++++++++++++------------------------ 1 file changed, 18 insertions(+), 24 deletions(-) diff --git a/gdb/parse.c b/gdb/parse.c index a84b4b64fdb..e4678e9c6e8 100644 --- a/gdb/parse.c +++ b/gdb/parse.c @@ -72,12 +72,6 @@ show_parserdebug (struct ui_file *file, int from_tty, } -static expression_up parse_exp_in_context - (const char **, CORE_ADDR, - const struct block *, int, - bool, innermost_block_tracker *, - std::unique_ptr *); - /* Documented at it's declaration. */ void @@ -328,24 +322,6 @@ copy_name (struct stoken token) } -/* Read an expression from the string *STRINGPTR points to, - parse it, and return a pointer to a struct expression that we malloc. - Use block BLOCK as the lexical context for variable names; - if BLOCK is zero, use the block of the selected stack frame. - Meanwhile, advance *STRINGPTR to point after the expression, - at the first nonwhite character that is not part of the expression - (possibly a null character). - - If COMMA is nonzero, stop if a comma is reached. */ - -expression_up -parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block, - int comma, innermost_block_tracker *tracker) -{ - return parse_exp_in_context (stringptr, pc, block, comma, false, - tracker, nullptr); -} - /* As for parse_exp_1, except that if VOID_CONTEXT_P, then no value is expected from the expression. */ @@ -453,6 +429,24 @@ parse_exp_in_context (const char **stringptr, CORE_ADDR pc, return result; } +/* Read an expression from the string *STRINGPTR points to, + parse it, and return a pointer to a struct expression that we malloc. + Use block BLOCK as the lexical context for variable names; + if BLOCK is zero, use the block of the selected stack frame. + Meanwhile, advance *STRINGPTR to point after the expression, + at the first nonwhite character that is not part of the expression + (possibly a null character). + + If COMMA is nonzero, stop if a comma is reached. */ + +expression_up +parse_exp_1 (const char **stringptr, CORE_ADDR pc, const struct block *block, + int comma, innermost_block_tracker *tracker) +{ + return parse_exp_in_context (stringptr, pc, block, comma, false, + tracker, nullptr); +} + /* Parse STRING as an expression, and complain if this fails to use up all of the contents of STRING. TRACKER, if non-null, will be updated by the parser. VOID_CONTEXT_P should be true to indicate -- 2.39.1