From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id C32933858D28 for ; Tue, 22 Aug 2023 15:45:55 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org C32933858D28 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=gnu.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=gnu.org Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qYTZr-00018U-Bg; Tue, 22 Aug 2023 11:45:55 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Mdz1oG3dZRcCMXY6RVkh1uimrpN/v7dUKLd2ltqKvqg=; b=cjT1dV5kfsgw Ux76tjU2WJz/swWL65U5B1eSdNBluKZL8PqxQ64xvyzkNjPrdLoxex7xQ4a4ys/C4Si5RMGItX5oQ mLTHXV8Fe90V8xE/OLVOdSjxelzS/XGOSo/gBtdRAWxvhNXSHxjw+ERqtcsgvu1likimTG90YVLvm fHb7ALgwdCeHM+LsYrRxyRn6JAcrVMZwkM7ghFd+FT0UN+NATwoxksUYcDyE3pHlZF/8CWzg0MCQo opDhP47yOsLaN76DYaspiJ50S//6awlw5u/y8nyTmzhFf/mX8yQ5sLDiZ57uw/kZQdJiSRdgT5OPp uUycbTiqYUgv3PJYMCE2hA==; Date: Tue, 22 Aug 2023 18:46:16 +0300 Message-Id: <83v8d7rsfr.fsf@gnu.org> From: Eli Zaretskii To: Tom Tromey Cc: gdb-patches@sourceware.org In-Reply-To: <20230822-array-and-string-like-v1-7-2dcea29b0567@adacore.com> (message from Tom Tromey via Gdb-patches on Tue, 22 Aug 2023 09:25:13 -0600) Subject: Re: [PATCH 7/8] Add new Python APIs to support DAP value display References: <20230822-array-and-string-like-v1-0-2dcea29b0567@adacore.com> <20230822-array-and-string-like-v1-7-2dcea29b0567@adacore.com> X-Spam-Status: No, score=0.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,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 List-Id: > Date: Tue, 22 Aug 2023 09:25:13 -0600 > From: Tom Tromey via Gdb-patches > > gdb's language code may know how to display values specially. For > example, the Rust code understands that &str is a string-like type, or > Ada knows how to handle unconstrained arrays. This knowledge is > exposed via val-print, and via varobj -- but currently not via DAP. > > This patch adds some support code to let DAP also handle these cases, > though in a somewhat more generic way. > > Type.is_array_like and Value.to_array are added to make Python aware > of the cases where gdb knows that a structure type is really > "array-like". > > Type.is_string_like is added to make Python aware of cases where gdb's > language code knows that a type is string-like. > > Unlike Value.string, these cases are handled by the type's language, > rather than the current language. > --- > gdb/NEWS | 8 ++++++++ > gdb/doc/python.texi | 24 ++++++++++++++++++++++ > gdb/python/py-type.c | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++ > gdb/python/py-value.c | 37 +++++++++++++++++++++++++++++++++ > 4 files changed, 126 insertions(+) Thanks, the documentation parts are okay. Reviewed-By: Eli Zaretskii