From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-il1-x12b.google.com (mail-il1-x12b.google.com [IPv6:2607:f8b0:4864:20::12b]) by sourceware.org (Postfix) with ESMTPS id 3A855385AFBE for ; Tue, 18 Jul 2023 18:52:18 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 3A855385AFBE 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-il1-x12b.google.com with SMTP id e9e14a558f8ab-345a8a78bcfso30143555ab.2 for ; Tue, 18 Jul 2023 11:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=adacore.com; s=google; t=1689706336; x=1692298336; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:from:to:cc:subject :date:message-id:reply-to; bh=npOUZZL59aC8GamqLlXnSF3ozus8mfwX/FVyoAH0Xqg=; b=UxkshwHe/ICS7LWMoMAF/mSuh9muSZj6Vs10Yq0mboVN3Zn2ggFKEg8qsMvZR4aWvB M5IpYnnGbMAEWoussVA4oP05G73FeCHh7IO9bzLdlfItFd5lKf02qvvU/fBQYuwpFSFi eqpoZN03ZzMIoeELceB/TxFoIBliGfT7F+AVN9gLVmWxt1VewHSqtC/lqliw9KFpEgag izWy/xlWCQ85F8CXOeYnEoG9S69myfBe1a6ZRRwtM/N6TNzkdZe1xYolzTBImbE/S2On V3lXgoKZ701PJ5HdeoUvscTa88yKrheCLeINE1eWbXDwhIAwHh9UaMDumM9oRyEa3XdX qt2Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1689706336; x=1692298336; h=content-transfer-encoding:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=npOUZZL59aC8GamqLlXnSF3ozus8mfwX/FVyoAH0Xqg=; b=A7jXyxRqsy3V7alhwWzdohozWcLxwyiuHSGbAi+cnr0M43v8leHacEBAt8pcvC32vT GMPEUD4NISKMqK0QJED7HkNOid65BP6ibO6ga5B9ypT5xIdwJvvpWGqwIM90wGLlEoqz oy0Y+4XS0Wmk4IAxrhahagm5f0kammq+48+ZC8/OI4JmqfnQMcaedaQqDhzXVGNWF7Ak a09uPIcfl8M+FAwmEIEr37H45aeQlNvgPJwJsilIAzg8HhoY7cav3DU/+7jdgSAqTVUk DQ8LHGN6SzLuxysdiEotogh5CIRB0FE1OL2hBXbJJMr70i9yFBQePBaCgN69BABMJ+jB XvfQ== X-Gm-Message-State: ABy/qLbdyIQzvDvYApBJzNtYtrSUUaSS6f70yjVh78tehFzQkPc9e2KT jw8vXPggnAeFVLUZsdaHkh2P0Q== X-Google-Smtp-Source: APBJJlEpSIu6D9lbr/2VPk5tWGqWyvn/KpRFSoWFXwkWHthUWsVpIsV3TMs7KbbtzRvsM5liu9QP/A== X-Received: by 2002:a05:6e02:b42:b0:345:d2fe:da92 with SMTP id f2-20020a056e020b4200b00345d2feda92mr3517173ilu.10.1689706336141; Tue, 18 Jul 2023 11:52:16 -0700 (PDT) Received: from murgatroyd (75-166-135-140.hlrn.qwest.net. [75.166.135.140]) by smtp.gmail.com with ESMTPSA id z5-20020a029f05000000b0042b358194acsm689262jal.114.2023.07.18.11.52.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 18 Jul 2023 11:52:15 -0700 (PDT) From: Tom Tromey To: Matt Rice Cc: Tom Tromey , Simon Farre via Gdb-patches , Simon Farre Subject: Re: [PATCH v1] gdb/DAP Introduce new methods to to Pretty Printers References: <20230625092116.252503-1-simon.farre.cx@gmail.com> <87jzv3o8ck.fsf@tromey.com> X-Attribution: Tom Date: Tue, 18 Jul 2023 12:52:14 -0600 In-Reply-To: (Matt Rice's message of "Mon, 17 Jul 2023 21:53:21 +0000") Message-ID: <877cqxm4rl.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.2 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-5.4 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 List-Id: >>>>> "Matt" =3D=3D Matt Rice writes: Matt> On Thu, Jul 13, 2023 at 8:38=E2=80=AFPM Tom Tromey via Gdb-patches Matt> wrote: >>=20 >> Maybe one way out would be to define a new way to do pretty-printers, >> with a compatibility shim. Matt> FWIW, there has been a bit of spit-balling within the rust community Matt> about leveraging Debug trait implementations Matt> within pretty printers, where what seemed to me like the obvious way Matt> to leverage these was to compile Debug impls to wasm, Matt> and write a python wrapper which calls into the wasm. I haven't Matt> thought or looked into it too much to have considered any hurdles of Matt> this approach really, but it would be nice if languages with wasm Matt> toolchains could define/compile pretty printers in their own language, Matt> since often they already exist for the purpose of runtime logging... Matt> Seemed worth bringing up if we're spit-balling here too. Ages ago I looked into this a little, the idea being to compile selected functions to Python using the gdb API. In the end though it seemed too hard for the value it would deliver. Anyway, the wasm approach seems fine -- they solved all the toolchain problems, which is nice. The main issue is that, IIUC, debug traits just emit a string representation -- but IMO the debugger really wants a more key-value / array-like representation. This seems like something that could be implemented "on the side", like the way that gdb-natvis exists. Tom