From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 48B933858C66 for ; Thu, 12 Jan 2023 19:19:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 48B933858C66 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1673551170; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=LKxrRx+lPxSLjUPKr5bqCHjIPohURwwLb1IQ16ZFK6Q=; b=NR4+NVSp87nKlT8wlZzcRXw9c4CQfDGnFq5wZppS2f+Z95nKOYnPIOr1kK4+oC9lqg6tg1 btLR9Q5t3DFSqDcwMKjrFAJRAYvOQ3MyWgIsiKphJ7Hcn2mAaQaheUmKBUS60Nes7W+ZQx JItkj7305IEbGdu3jqz8nYHsKI0Z3Yk= Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-551-rL-qvM8VM4qysvvPulu8uw-1; Thu, 12 Jan 2023 14:19:29 -0500 X-MC-Unique: rL-qvM8VM4qysvvPulu8uw-1 Received: by mail-wr1-f72.google.com with SMTP id e29-20020adf9bdd000000b002bb0d0ea681so3749712wrc.20 for ; Thu, 12 Jan 2023 11:19:29 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LKxrRx+lPxSLjUPKr5bqCHjIPohURwwLb1IQ16ZFK6Q=; b=7VNL5LcevO4TiKIe48aVxUePA1Xd45vMqhuFM6Ucl3DxGH+26pIbkCht8vBk0bmmiy SoBQxQ9UQoTD2JTudUWpAW8hsQwPWzerqjuZ6HzcfKuNRl3Yd/DWMU9pClcCsLtDJOVG 9LOJrrRuHh8g7IHef5V9kpcvNQSHD64Ttx24jJ08Wmua63MOKJft5Hq+7GvoWpH0k7+G HWM4wMp6u9kxjiC0mPK/3y0Yzk2oOOj0hqw8eWW1TdC7eEOTG2mDH4/Ewx4sauPiHfob 3k3T2d2OzogIg5uSNw5eKb71TabQH/pUSRnZxURKdY71Scj7N5X6a7Oo1VA7rzPR1REg zJew== X-Gm-Message-State: AFqh2krGdx6cMlFaitMl9GcrbbXAWmwzzkzENKPIB3jzhHG9CbBLCPBR hx5oQTgD3zW3iaoIV1noZKSf67NTXvTboltB2v+eB7YI7mW46VQpaclBQmTnSu0WwAJcSjvNpwh eTUlL4OxFiwn2zVNqBmWsCz0KPGn0jj/2uKBTrAiGwU3CxxdUbaTUi/ua34k8gNauc5YYO+Go7w == X-Received: by 2002:a05:600c:3d11:b0:3cf:8b22:76b3 with SMTP id bh17-20020a05600c3d1100b003cf8b2276b3mr56860631wmb.0.1673551168313; Thu, 12 Jan 2023 11:19:28 -0800 (PST) X-Google-Smtp-Source: AMrXdXtFbuAfF+Tj1aIiKXPxFzGTcnHT6b4HDxQReIbPyU87RmNPsrUt2sX6vu+xPCZ2mqwIifrvZw== X-Received: by 2002:a05:600c:3d11:b0:3cf:8b22:76b3 with SMTP id bh17-20020a05600c3d1100b003cf8b2276b3mr56860621wmb.0.1673551168073; Thu, 12 Jan 2023 11:19:28 -0800 (PST) Received: from localhost (92.40.218.34.threembb.co.uk. [92.40.218.34]) by smtp.gmail.com with ESMTPSA id d6-20020a05600c3ac600b003da0dc39872sm5358625wms.6.2023.01.12.11.19.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Jan 2023 11:19:27 -0800 (PST) From: Andrew Burgess To: gdb-patches@sourceware.org Cc: Andrew Burgess Subject: [PATCH 0/3] Python/TUI Window Creation / Destruction Fixes Date: Thu, 12 Jan 2023 19:19:19 +0000 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII"; x-default=true X-Spam-Status: No, score=-5.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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: Patch #1 started with an observation that the behaviour of gdb.register_window_type doesn't appear to exactly match up with the documentation. While fixing this I observed that the destruction of Python window factory callbacks (as used by gdb.register_window_type) is inconsistent, and that GDB knowingly leaks some memory in this area too. Patches #2 and #3 fix this and make the destruction behaviour consistent. All feedback welcome. Thanks, Andrew --- Andrew Burgess (3): gdb/python: allow Python TUI windows to be replaced gdb/python: deallocate tui window factories at Python shut down gdb/tui: don't leak the known_window_types map gdb/python/py-tui.c | 52 +++++++- gdb/python/python-internal.h | 1 + gdb/python/python.c | 1 + .../gdb.python/tui-window-factory.exp | 112 ++++++++++++++++++ .../gdb.python/tui-window-factory.py | 48 ++++++++ gdb/tui/tui-layout.c | 39 +++--- 6 files changed, 232 insertions(+), 21 deletions(-) create mode 100644 gdb/testsuite/gdb.python/tui-window-factory.exp create mode 100644 gdb/testsuite/gdb.python/tui-window-factory.py base-commit: 1a26a53a0dee39106ba58fcb15496c5f13074652 -- 2.25.4