From patchwork Thu May 4 14:21:21 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 55736 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 869063856DDA for ; Thu, 4 May 2023 14:21:49 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 869063856DDA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1683210109; bh=kZW+MFyXOGw/kyWAhUyNLPtXl0gSpEV8rf5WYieCnWc=; h=Subject:Date:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=Yc3x3Jx5YUJdDLQ2UmkE/gFaXk4cGRhJaWv3bfT5GsaLDFhTrZfsMa2pzIicxNm5F oMgGVgtgzwDM+8UsXpWB5b3ZUVRs60N6wZfb24kkN0hL4LvlqnHAs5QsDDlSyfYPOY LJDy4BOO4F6RZ/kYv6nzZnF7ubkto/lAFr8TpWMM= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd35.google.com (mail-io1-xd35.google.com [IPv6:2607:f8b0:4864:20::d35]) by sourceware.org (Postfix) with ESMTPS id EFEB73858D33 for ; Thu, 4 May 2023 14:21:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org EFEB73858D33 Received: by mail-io1-xd35.google.com with SMTP id ca18e2360f4ac-76372a83c8eso9585439f.3 for ; Thu, 04 May 2023 07:21:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683210084; x=1685802084; h=to:content-transfer-encoding:mime-version:message-id:date:subject :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=kZW+MFyXOGw/kyWAhUyNLPtXl0gSpEV8rf5WYieCnWc=; b=XCfqVahjt+NTudxfrHZuZCAuWWnXRp/VNWQOpZWdLNbI/JSEI94UJ6TZkC7iKpnTHy ejaWmAuEeBzF+e4OX3lSJ6prRCKI/ERYlbDbZLRFdEiLNwEK6vwwLznQNGeP3Ltq6yVI IYNteHRFSs2E2A4DpuO4n2WJec7qJGwChcYgFogR6Pa+v4MKxD+CJ5hdEuJ3q3xc4QSi L3WWjF4U6ttfTA3/DyDGIc/aFP+4SkyTLOWdw7cIfYzgCK66t434nhJinPWzoS03XdQ5 5eCgGOE1PFtYmAK6iY+dKX6SQPASqvHmbIsuJu/Sg/I9v24nMAwFciXjpJglwbmWMwyl hThA== X-Gm-Message-State: AC+VfDyIke1/FXYpe0vTnJd/XOpJ1UZNvY0HH0JZSm1+oWWsv8WdvSsk mWpXLOJVa4Qo3l1k9Vy72K7PZlC4rZEVYSZxhWRHQw== X-Google-Smtp-Source: ACHHUZ7U7vPL2lIGtG+0RGJfBG6c8ENlBVW1pqKCtf1H+0lUe7jMuOmshIj6GzdTqPMQOASLJ5G2sA== X-Received: by 2002:a5e:890d:0:b0:74c:8cec:548e with SMTP id k13-20020a5e890d000000b0074c8cec548emr16394896ioj.4.1683210083907; Thu, 04 May 2023 07:21:23 -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.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 07:21:23 -0700 (PDT) Subject: [PATCH 00/11] Fix frame-less expression evaluation in DAP Date: Thu, 04 May 2023 08:21:21 -0600 Message-Id: <20230504-frameless-v1-0-4191201740b0@adacore.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIAGG/U2QC/x2N0QqDMBAEf0XuuYE0tUX8ldKHS9zUA03LnYgg/ ntjH4edZXYyqMCob3ZSrGLyKRWul4bSyOUNJ0NlCj7c/N23LivPmGDmQuIcH6FDN7RU/cgGF5V LGs/HzLZAz+GryLL9I8/XcfwAdr48onQAAAA= To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 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, 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 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-Patchwork-Original-From: Tom Tromey via Gdb-patches From: Tom Tromey Reply-To: Tom Tromey Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" In DAP, an evaluation request without a frame ID should be done at the global scope. This series implements this. Most of the series is minor cleanups to the parser API, to make the final code a bit cleaner. Regression tested on x86-64 Fedora 36. --- Tom Tromey (11): Avoid forward declaration in parse.c Move innermost_block_tracker to expression.h Introduce and use parser flags Simplify parser_state constructor Boolify parser_state::comma_terminates Rearrange parser_state Add PARSER_DEBUG flag Add PARSER_LEAVE_BLOCK_ALONE flag Add flags to parse_and_eval Add global_context parameter to gdb.parse_and_eval Handle DAP evaluate request without a frame ID gdb/NEWS | 4 ++ gdb/ada-exp.y | 2 +- gdb/ax-gdb.c | 3 +- gdb/breakpoint.c | 3 +- gdb/c-exp.y | 2 +- gdb/d-exp.y | 2 +- gdb/doc/python.texi | 7 ++- gdb/eval.c | 7 +-- gdb/expression.h | 78 ++++++++++++++++++++++++++-- gdb/f-exp.y | 2 +- gdb/go-exp.y | 2 +- gdb/parse.c | 97 ++++++++++++++++------------------- gdb/parser-defs.h | 73 ++++++-------------------- gdb/printcmd.c | 5 +- gdb/python/lib/gdb/dap/evaluate.py | 4 +- gdb/python/python.c | 28 +++++++--- gdb/rust-parse.c | 2 +- gdb/testsuite/gdb.dap/frameless.c | 24 +++++++++ gdb/testsuite/gdb.dap/frameless.exp | 62 ++++++++++++++++++++++ gdb/testsuite/gdb.python/py-value.c | 3 ++ gdb/testsuite/gdb.python/py-value.exp | 5 ++ gdb/tracepoint.c | 10 ++-- gdb/value.h | 2 +- 23 files changed, 288 insertions(+), 139 deletions(-) --- base-commit: 3539414584be0094b0a4fe56dfd64ea79d802edc change-id: 20230504-frameless-2cafb628e8d4 Best regards,