From patchwork Wed May 24 16:36:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 55792 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 66FF53855592 for ; Wed, 24 May 2023 16:37:50 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 66FF53855592 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1684946270; bh=Jt7IUGOJTNYtwh1A0wSJwcTVEoB3QFAO9yGLOOxlxAc=; h=Subject:Date:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=ZABINFDgXPm/2pIBCHtqJinrbNHhoAQlbrVapcwPyd38fFiaXGiQy8SElPSfPdPMg VnTzMhe5RPHT5935ZaX7k7K9jSOoHb/qrO5xgmhI0r8nCY6ayEZbIOEc3ugIII/i5Y KqUhEgwM5xysnzjcUz8WsNpDF6/CS7dFKnItNBpc= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-io1-xd2c.google.com (mail-io1-xd2c.google.com [IPv6:2607:f8b0:4864:20::d2c]) by sourceware.org (Postfix) with ESMTPS id 8A74A3858D39 for ; Wed, 24 May 2023 16:37:24 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 8A74A3858D39 Received: by mail-io1-xd2c.google.com with SMTP id ca18e2360f4ac-7665e607d1bso30449139f.3 for ; Wed, 24 May 2023 09:37:24 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684946244; x=1687538244; 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=Jt7IUGOJTNYtwh1A0wSJwcTVEoB3QFAO9yGLOOxlxAc=; b=R9VMqLoSNCCWDHmwtFS/1lYtnjYa2ko4v1l0e/oJu3fWO92Rnz1gh+z9kjzQV6ASfJ vPpwQTQnP97OJIA5ktd1doLjpmri09ZirL+7QXN+Y2FlYAVRo4oy+EsM+HNrMdA/9vk8 OW0XJEaDqkOYRW6zy7uLcnvgHGxk7feit+Ies+vbvbvv7stvwqJbreDXTtpQaSIdJ38i HjI2awvVGHHyXo6/igUTZpQuT3eUBk+o89lOiv+yRvRGQ33/5zjxK8PX4TN1GOqfxOjW fMMV0xi4i+bM4vGfE5Sg2HGo1iSNF1gnUIB0oHesmVZjFxxicqnC78SZ25bLbFvRp6/P MEAQ== X-Gm-Message-State: AC+VfDyqjCnyDo7A6xMn7jfUzga3Dh/sMeUxBErx+HRe4fIyvLNgZDkX 8yT0jRb5e/wrSEciyoPw4u4E/mw0JCnVekWcXoMGbQ== X-Google-Smtp-Source: ACHHUZ4ol00RXbO1MchG4wrDoOqlUoLxzh/taai9oew97xcmbOmyRx8uM7wNMCO4+wv2mIYQEq6p2g== X-Received: by 2002:a5d:9e54:0:b0:774:84b5:cb77 with SMTP id i20-20020a5d9e54000000b0077484b5cb77mr3601506ioi.18.1684946243786; Wed, 24 May 2023 09:37:23 -0700 (PDT) Received: from localhost.localdomain (71-211-130-244.hlrn.qwest.net. [71.211.130.244]) by smtp.gmail.com with ESMTPSA id o22-20020a6bcf16000000b0076c81bf2731sm3397266ioa.20.2023.05.24.09.37.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 May 2023 09:37:23 -0700 (PDT) Subject: [PATCH 00/25] Many updates to DAP implementation Date: Wed, 24 May 2023 10:36:51 -0600 Message-Id: <20230427-ada-catch-exception-v1-0-947caa9905e3@adacore.com> MIME-Version: 1.0 X-B4-Tracking: v=1; b=H4sIACM9bmQC/x2NzQrCQAyEX6XkbKBui3+vIh7SbHRzcC3JIoXSd zf1MvAx8zEruJiKw61bweSrrp8acDx0wIXqS1BzMKQ+Df2YzkiZkKlxQVlY5hZ7vFzzcBojmDK EOZELTkaVy+6+yZvYXswmT13+d/fHtv0AYtp2nn4AAAA= To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-5.0 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" I've been working steadily on the DAP implementation. This series combines a number of patches. It starts with some general refactoring of Ada catchpoints, to make them work more like C++ catchpoints. In particular, now they can be set before the inferior has started. This is then used to implement the DAP setExceptionBreakpoints request. Other patches add DAP features. In some cases a new Python API is added so that it can be used by DAP. I do have some more patches to come after this series goes in. Regression tested on x86-64 Fedora 36. --- Tom Tromey (25): Stop gdb in gnat_runtime_has_debug_info Use gnat_runtime_has_debug_info in Ada catchpoint tests Pass tempflag to ada_catchpoint constructor Transfer ownership of exception string to ada_catchpoint Combine create_excep_cond_exprs and ada_catchpoint::re_set Turn should_stop_exception into a method of ada_catchpoint Mark members of ada_catchpoint "private" Don't require inferior execution for Ada catchpoints Implement DAP setExceptionBreakpoints request Implement DAP attach request Implement DAP stepOut request Add singleThread support to some DAP requests Rename one DAP function Add test for DAP pause request Fix a latent bug in DAP request decorator Use tuples for default arguments in DAP Add type-checking to DAP requests Add gdb.Value.assign method Implement DAP setExpression request Handle DAP supportsVariableType capability Add "target" parameter to DAP attach request Add "stop at main" extension to DAP launch request Implement DAP breakpointLocations request Do not report totalFrames from DAP stackTrace request Implement DAP conditional breakpoints gdb/NEWS | 2 + gdb/ada-lang.c | 210 +++++++++---------------- gdb/ada-lang.h | 2 +- gdb/data-directory/Makefile.in | 2 + gdb/doc/gdb.texinfo | 17 ++ gdb/doc/python.texi | 6 + gdb/mi/mi-cmd-catch.c | 4 +- gdb/python/lib/gdb/dap/__init__.py | 1 + gdb/python/lib/gdb/dap/breakpoint.py | 143 ++++++++++++++--- gdb/python/lib/gdb/dap/bt.py | 14 +- gdb/python/lib/gdb/dap/disassemble.py | 7 +- gdb/python/lib/gdb/dap/evaluate.py | 38 ++++- gdb/python/lib/gdb/dap/launch.py | 42 ++++- gdb/python/lib/gdb/dap/locations.py | 45 ++++++ gdb/python/lib/gdb/dap/memory.py | 4 +- gdb/python/lib/gdb/dap/next.py | 51 ++++-- gdb/python/lib/gdb/dap/scopes.py | 2 +- gdb/python/lib/gdb/dap/server.py | 24 ++- gdb/python/lib/gdb/dap/typecheck.py | 88 +++++++++++ gdb/python/lib/gdb/dap/varref.py | 3 + gdb/python/py-value.c | 30 ++++ gdb/testsuite/gdb.ada/catch_assert_if.exp | 28 +--- gdb/testsuite/gdb.ada/catch_ex.exp | 18 +-- gdb/testsuite/gdb.ada/catch_ex_std.exp | 27 +--- gdb/testsuite/gdb.ada/excep_handle.exp | 24 +-- gdb/testsuite/gdb.ada/mi_catch_assert.exp | 33 +--- gdb/testsuite/gdb.ada/mi_catch_ex.exp | 31 +--- gdb/testsuite/gdb.ada/mi_catch_ex_hand.exp | 32 +--- gdb/testsuite/gdb.ada/mi_ex_cond.exp | 33 +--- gdb/testsuite/gdb.dap/attach.c | 25 +++ gdb/testsuite/gdb.dap/attach.exp | 36 +++++ gdb/testsuite/gdb.dap/basic-dap.c | 12 +- gdb/testsuite/gdb.dap/basic-dap.exp | 35 ++++- gdb/testsuite/gdb.dap/catch-exception.exp | 66 ++++++++ gdb/testsuite/gdb.dap/catch-exception/pck.ads | 18 +++ gdb/testsuite/gdb.dap/catch-exception/prog.adb | 44 ++++++ gdb/testsuite/gdb.dap/cond-bp.c | 26 +++ gdb/testsuite/gdb.dap/cond-bp.exp | 65 ++++++++ gdb/testsuite/gdb.dap/pause.exp | 41 +++++ gdb/testsuite/gdb.dap/remote-dap.exp | 49 ++++++ gdb/testsuite/gdb.dap/stop-at-main.exp | 37 +++++ gdb/testsuite/gdb.dap/type_check.exp | 29 ++++ gdb/testsuite/gdb.dap/type_check.py | 96 +++++++++++ gdb/testsuite/gdb.python/py-value.exp | 14 ++ gdb/testsuite/lib/ada.exp | 2 + gdb/testsuite/lib/dap-support.exp | 43 ++++- 46 files changed, 1199 insertions(+), 400 deletions(-) --- base-commit: 389971df23ca74092314dbde1303310a33766ba7 change-id: 20230427-ada-catch-exception-89d3649d3cad Best regards,