From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr1-x430.google.com (mail-wr1-x430.google.com [IPv6:2a00:1450:4864:20::430]) by sourceware.org (Postfix) with ESMTPS id 7E0C73851C0E for ; Wed, 8 Jul 2020 08:48:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 7E0C73851C0E Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=andrew.burgess@embecosm.com Received: by mail-wr1-x430.google.com with SMTP id z2so25704992wrp.2 for ; Wed, 08 Jul 2020 01:48:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=embecosm.com; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EZ9y1hYKzub9x01fIReP/gmJ4IlBau3Nrt+ddxvaacs=; b=Cy5jXlFPnPsLedLfACqWVPpEyAnvN6ANo5ds4G11jfMx/HKZJMXQpV94zlI+3JsiqF JD53c//9e8Ybm0fsP/xseYfN033Uon1Fq1R4lPgg9/8v2mJ/sfbwnrIB8uUulOTxmdQX Lv3ZHiwNbgO99ypHsx9Mb71TTJmYtcdkrigB7zFWV0OtzmvMrlhNNnKf+gpJCVlcddQe FeldO12UiCDZi70Vofa5bSR4dARMWwYRrSn3fvqYzC3ofrZYOaTwZi8BY1G0QV5D4Dij BW+vig84tasF+v7GreuB9tUwE5Ss0+1G8Xp4IDzkWgFi+EOAMq90ePdsCNkp5J43XbOZ vWnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=EZ9y1hYKzub9x01fIReP/gmJ4IlBau3Nrt+ddxvaacs=; b=k2lPvmUCr2c+WTADT/QHnPXkEYSmdYUkqarHfKaQHgKquT0GpSUMnb1Y6wOkzhInId N/UhNNjaUaiuSMbCoHFkPqLXzXW56XdVzRHOSsfBgzbtIwFAjJTK1gXnuTbP1wbHBMTA tK5WCwmdyQoHyl+zPTZGRWVOUjACxYwYRACtINRgzxrdgxpbdugl3k8jodBPxnt2/CKX iuk+RUrn9B8uU+llVgdCcb3h/28UW878gMiveci4krNrafFPANgWO4q40GRVjyE/mvXT Jc+o9+9YdCf+K2onA6TFS33e7f4IFSerydYl8j97Ljvl+jEGLPgBSu1pcMgoRHmAvlxj vTog== X-Gm-Message-State: AOAM533GzKFqMUolYbayEpw639iclbfwbgagSK4LyB5CDN0P+AVPdMVR P0H2UEYjpUt/1logKFOstjzQ6Ecs8GQ= X-Google-Smtp-Source: ABdhPJx7K2YwLXFtHSMUvFOQ5+QrYieIDPslpZsjMO3NARHagdAGX03/gzS2Zspa9Z7UmS8nbNnYsw== X-Received: by 2002:a5d:424f:: with SMTP id s15mr49821340wrr.342.1594198095344; Wed, 08 Jul 2020 01:48:15 -0700 (PDT) Received: from localhost (host109-154-20-168.range109-154.btcentralplus.com. [109.154.20.168]) by smtp.gmail.com with ESMTPSA id v11sm9277507wmb.3.2020.07.08.01.48.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 08 Jul 2020 01:48:14 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCH 0/2] Improvements to Python Register Descriptor API Date: Wed, 8 Jul 2020 09:48:10 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.2 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.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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-List-Received-Date: Wed, 08 Jul 2020 08:48:18 -0000 I was thinking about my recent Python API additions to provide access to register and register group information, and I thought that the implementation of the API could be improved. Currently for both registers and register groups, you ask the architecture for an iterator, and the iterator then returns descriptors. Each descriptor returned is a new object, so if you have two iterators, and ask the the first register you'll get two unique objects that both describe the same register. I thought it might be a nice improvement if the objects returned were the same from every iterator, so in the above example you'd end up with two references to the same object. In this way you can compare the objects for equality. I don't know if this will be useful, but this seems like a better implementation, so I'd like to change things to work this way (assuming nobody disagrees). Thanks, Andrew --- Andrew Burgess (2): gdb/python: Reuse gdb.RegisterDescriptor objects where possible gdb/python: Reuse gdb.RegisterGroup objects where possible gdb/ChangeLog | 19 ++++ gdb/python/py-registers.c | 103 ++++++++++++++---- gdb/testsuite/ChangeLog | 8 ++ .../gdb.python/py-arch-reg-groups.exp | 19 ++++ .../gdb.python/py-arch-reg-names.exp | 19 ++++ 5 files changed, 146 insertions(+), 22 deletions(-) -- 2.25.4