From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-xd32.google.com (mail-io1-xd32.google.com [IPv6:2607:f8b0:4864:20::d32]) by sourceware.org (Postfix) with ESMTPS id 234C83858D39 for ; Thu, 27 Jul 2023 16:36:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 234C83858D39 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-xd32.google.com with SMTP id ca18e2360f4ac-78372625badso46323639f.3 for ; Thu, 27 Jul 2023 09:36:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1690475769; x=1691080569; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=Iv4ChAgajOsazMwmz7uAlfBo0q0/ulf9e8Rdk7xFG/Y=; b=PGmrwAAW2iHP5aqOqrz+wJrkDYFRcetdXPWAyhOGzo/hM84vvEXZ9S8kqszc/UinWa aHmOfHfn6DHgQj/8YGdyt4CKQvqjsKCgEMOLqp2KLWe15si2EKasnQ8mBXNI/QqPb+UF uoLwflIwr/ByRMpjfHVEdmFIuYehvm3yyUD2+Ms0IUuDHBy8PsGO+y6mjXpsEN3x8F6Y VFjBLkK4Z2eLRr441MSlqXVPv8CjWj6ZA0myhZj6XJrOYhPFEkZO6rWiDUMCxxJtrujY hRO4+u+j38oErRm4g4jNQin8CsX4VrxdqH1qePUaJIGa1KtFlVSc8d2dFUrpjFsB2pbu Rtcw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690475769; x=1691080569; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=Iv4ChAgajOsazMwmz7uAlfBo0q0/ulf9e8Rdk7xFG/Y=; b=a3EWvMDMbfiw1feieU80ynG72rnQieq2Um443AtSQcgCfiRaeH7g5rkDFDRf+BIRBk oJJrjkPWlMUGLE06JW4NRj+pLu2zt6zXcMmpc0dzd5Rf8LBEahzn8Z1cq5N/3ftj7JJC jZBCT4mLLkeOdTXjEIqv4PyJ7QIIXaOZXnWYQ2TfWABygMLWmdktRz8jBSnhtwSEI3mX OW/aQ3bbsn0Y9YYRn2QsBd1+tWu+hZ50tJAUtIDTGzfnGPpviHcu8L66cyE30Txoogf7 OjbJlbXdS/7HWwtev1FxgtiiybFFr4yEMYQil10YrtX8qkMFXJ3b7XzE4QnH4ewJV1/6 NbLw== X-Gm-Message-State: ABy/qLZNpnisLhQCRthdIxcPeBqM5Gjq0snExja2upPysPaDOwFknAcB KDVna8pm4OZavf9unCYJuwI2pwgvzT7/BwAA/d/9Cw== X-Google-Smtp-Source: APBJJlFyFXJ6QTORWOtToQStSrMW1Rvv05QLEkxWkknZLwyhyLruzMBKZhYs/AkGDhv9wqGk7K3qEw== X-Received: by 2002:a05:6602:4254:b0:783:6361:17ea with SMTP id cc20-20020a056602425400b00783636117eamr44762iob.8.1690475769737; Thu, 27 Jul 2023 09:36:09 -0700 (PDT) Received: from localhost.localdomain (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id w5-20020a02cf85000000b0042b3e86dfd8sm521610jar.141.2023.07.27.09.36.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 27 Jul 2023 09:36:09 -0700 (PDT) From: Tom Tromey To: gdb-patches@sourceware.org Cc: Tom Tromey Subject: [pushed] Report supportsBreakpointLocationsRequest Date: Thu, 27 Jul 2023 10:35:59 -0600 Message-Id: <20230727163559.2459578-1-tromey@adacore.com> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-11.6 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: While looking at the DAP spec, I noticed that the breakpointLocations request is gated behind a capability. This patch changes gdb to report this capability. I've also added a comment to explain the fact that arguments to breakpointLocations are not optional, even though the spec says they are. --- gdb/python/lib/gdb/dap/locations.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gdb/python/lib/gdb/dap/locations.py b/gdb/python/lib/gdb/dap/locations.py index 6c591579920..594f1bad45b 100644 --- a/gdb/python/lib/gdb/dap/locations.py +++ b/gdb/python/lib/gdb/dap/locations.py @@ -18,7 +18,7 @@ import gdb # This is deprecated in 3.9, but required in older versions. from typing import Optional -from .server import request +from .server import capability, request from .startup import in_gdb_thread, send_gdb_with_response @@ -32,7 +32,15 @@ def _find_lines(filename, start_line, end_line): return {"breakpoints": [{"line": x} for x in sorted(lines)]} +# Note that the spec says that the arguments to this are optional. +# However, calling this without arguments is nonsensical. This is +# discussed in: +# https://github.com/microsoft/debug-adapter-protocol/issues/266 +# This points out that fixing this would be an incompatibility but +# goes on to propose "if arguments property is missing, debug adapters +# should return an error". @request("breakpointLocations") +@capability("supportsBreakpointLocationsRequest") def breakpoint_locations(*, source, line: int, endLine: Optional[int] = None, **extra): if endLine is None: endLine = line -- 2.40.1