Message ID | 20230404-dap-loaded-sources-v1-0-75c796bd644b@adacore.com |
---|---|
Headers |
Return-Path: <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> 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 3ECFE385559F for <patchwork@sourceware.org>; Tue, 4 Apr 2023 17:09:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 3ECFE385559F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1680628194; bh=7ub3tTmJps+2UxLJz930GvZ28jBoR1esr5kC9tbbylM=; h=Subject:Date:To:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=H3jxC6KHpQ9NRfzeMecnD0T0mzDEoyKShUfDp7uCA+44/gyZSdZEQkaqKFKNy4ouv FOkU16eVGGTdvsfl5Yh0rLWxcurotvtWez2BM+ecW8t4jKQ7fnvMtzO8+2Fu0+QwuM wUu5VfHBJrkiMtu42ObL4rEZU7Cx4PnJnfdysMuk= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org Received: from mail-il1-x132.google.com (mail-il1-x132.google.com [IPv6:2607:f8b0:4864:20::132]) by sourceware.org (Postfix) with ESMTPS id 6B6B33858C5E for <gdb-patches@sourceware.org>; Tue, 4 Apr 2023 17:08:52 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 6B6B33858C5E Received: by mail-il1-x132.google.com with SMTP id q8so2811869ilo.1 for <gdb-patches@sourceware.org>; Tue, 04 Apr 2023 10:08:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680628131; 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=7ub3tTmJps+2UxLJz930GvZ28jBoR1esr5kC9tbbylM=; b=oCtm6hH/ivZFVWe78katKktbRsyZZC7hR4fhnsZ1eEYt1e/SeLLMGA5Qr3Lp6epgSn 7XNdmJNM3Jw54MXLoGF+dEJJIXDUnaarkJ9jv85sq4wmvMusHlQS8JVgJZAtwpyFhEEn T5F6hO4vJSCjnJ0PvwlmAVO2dfS0HPqrV08jwfAWbQ9wpZHmOsa5ASHuMbqQgW+08zWG iF+9ia4rFRkZXEjvPXI+sbRBGk3hxXRA5twOVFA6FJxv1aMzS/eM9BaHKDUYKStXXagd vzOoGsJJlL7k9LubDlc8yzhRXpT7CxeBrRCxorCtsd4croOXQijnnFFhCl6trKXVISN2 Tpbw== X-Gm-Message-State: AAQBX9fuDV+7vtqwwssCd5VJrH4MWP49qctl8+S45easObbsX4eUxjxg pqMv1o83GN5JWyZ2SndBGdDIf6jrEq9GZwjq+/J3GA== X-Google-Smtp-Source: AKy350avgjrU3KAnfbxX3CyATA5bz3Ghzv2zB5ntgL9gr/2dE0p9h+WMsOUAbvhdnZvpwOwGkgVFdg== X-Received: by 2002:a92:dd0c:0:b0:326:4313:db91 with SMTP id n12-20020a92dd0c000000b003264313db91mr3573314ilm.23.1680628131422; Tue, 04 Apr 2023 10:08:51 -0700 (PDT) Received: from localhost.localdomain (71-211-185-113.hlrn.qwest.net. [71.211.185.113]) by smtp.gmail.com with ESMTPSA id f4-20020a02a104000000b0040b4c29010fsm1188306jag.140.2023.04.04.10.08.50 for <gdb-patches@sourceware.org> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 04 Apr 2023 10:08:51 -0700 (PDT) Subject: [PATCH 0/9] Implement the DAP "loadedSources" request Date: Tue, 04 Apr 2023 11:08:48 -0600 Message-Id: <20230404-dap-loaded-sources-v1-0-75c796bd644b@adacore.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAKBZLGQC/x2NywrCQAwAf6XkbGBfXvwV8ZBuUruguyXRIpT+u 9seh2GYDUy0iMFt2EBlLVZa7eAvA+SZ6lOwcGcILkSXXEKmBV+NWBitfTWL4ZWdjyGSD8lBD0c ywVGp5vlI32Qf0UMsKlP5nbf7Y9//PjOP230AAAA= To: gdb-patches@sourceware.org X-Mailer: b4 0.12.2 X-Spam-Status: No, score=-5.6 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 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 <gdb-patches.sourceware.org> List-Unsubscribe: <https://sourceware.org/mailman/options/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=unsubscribe> List-Archive: <https://sourceware.org/pipermail/gdb-patches/> List-Post: <mailto:gdb-patches@sourceware.org> List-Help: <mailto:gdb-patches-request@sourceware.org?subject=help> List-Subscribe: <https://sourceware.org/mailman/listinfo/gdb-patches>, <mailto:gdb-patches-request@sourceware.org?subject=subscribe> From: Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> Reply-To: Tom Tromey <tromey@adacore.com> Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" <gdb-patches-bounces+patchwork=sourceware.org@sourceware.org> |
Series |
Implement the DAP "loadedSources" request
|
|
Message
Tom Tromey
April 4, 2023, 5:08 p.m. UTC
This series implements the DAP "loadedSources" request. However, it does so by exposing MI commands to Python, with MI output being converted to Python objects via a new ui_out implementation. Regression tested on x86-64 Fedora 36. --- Tom Tromey (9): Use field_signed from Python MI commands Use member initializers in mi_parse Use accessor for mi_parse::args Change mi_parse_argv to a method Introduce "static constructor" for mi_parse Introduce mi_parse helper methods Add second mi_parse constructor Implement gdb.execute_mi Implement DAP loadedSources request gdb/Makefile.in | 1 + gdb/NEWS | 3 + gdb/data-directory/Makefile.in | 1 + gdb/doc/python.texi | 29 ++++ gdb/mi/mi-cmds.c | 6 +- gdb/mi/mi-cmds.h | 5 + gdb/mi/mi-main.c | 19 +- gdb/mi/mi-parse.c | 192 +++++++++++++++----- gdb/mi/mi-parse.h | 81 ++++++--- gdb/python/lib/gdb/dap/__init__.py | 1 + gdb/python/lib/gdb/dap/sources.py | 40 +++++ gdb/python/py-mi.c | 298 ++++++++++++++++++++++++++++++++ gdb/python/py-micmd.c | 20 ++- gdb/python/python-internal.h | 5 + gdb/python/python.c | 5 + gdb/testsuite/gdb.dap/basic-dap.exp | 3 + gdb/testsuite/gdb.python/py-exec-mi.exp | 32 ++++ gdb/testsuite/gdb.python/py-mi-cmd.py | 18 ++ 18 files changed, 682 insertions(+), 77 deletions(-) --- base-commit: 02d44d76584e4d483fe0fc677c12066ec23d67f4 change-id: 20230404-dap-loaded-sources-5d01323a1240 Best regards,
Comments
Can't comment much on the implementation, not being much of a c++ person, But tried it out, the output looks really sane & much nicer than the attempts I had made in the bug report, From what I can tell, you solved most of the issues I'd run into in that bug report by parsing the table description, and then building the dictionaries based upon the column information which seems like a great idea. Very happy to see those issues apparently resolved. On Tue, Apr 4, 2023 at 5:09 PM Tom Tromey via Gdb-patches <gdb-patches@sourceware.org> wrote: > > This series implements the DAP "loadedSources" request. However, it > does so by exposing MI commands to Python, with MI output being > converted to Python objects via a new ui_out implementation. > > Regression tested on x86-64 Fedora 36. > > --- > Tom Tromey (9): > Use field_signed from Python MI commands > Use member initializers in mi_parse > Use accessor for mi_parse::args > Change mi_parse_argv to a method > Introduce "static constructor" for mi_parse > Introduce mi_parse helper methods > Add second mi_parse constructor > Implement gdb.execute_mi > Implement DAP loadedSources request > > gdb/Makefile.in | 1 + > gdb/NEWS | 3 + > gdb/data-directory/Makefile.in | 1 + > gdb/doc/python.texi | 29 ++++ > gdb/mi/mi-cmds.c | 6 +- > gdb/mi/mi-cmds.h | 5 + > gdb/mi/mi-main.c | 19 +- > gdb/mi/mi-parse.c | 192 +++++++++++++++----- > gdb/mi/mi-parse.h | 81 ++++++--- > gdb/python/lib/gdb/dap/__init__.py | 1 + > gdb/python/lib/gdb/dap/sources.py | 40 +++++ > gdb/python/py-mi.c | 298 ++++++++++++++++++++++++++++++++ > gdb/python/py-micmd.c | 20 ++- > gdb/python/python-internal.h | 5 + > gdb/python/python.c | 5 + > gdb/testsuite/gdb.dap/basic-dap.exp | 3 + > gdb/testsuite/gdb.python/py-exec-mi.exp | 32 ++++ > gdb/testsuite/gdb.python/py-mi-cmd.py | 18 ++ > 18 files changed, 682 insertions(+), 77 deletions(-) > --- > base-commit: 02d44d76584e4d483fe0fc677c12066ec23d67f4 > change-id: 20230404-dap-loaded-sources-5d01323a1240 > > Best regards, > -- > Tom Tromey <tromey@adacore.com> >