From patchwork Sun Oct 2 16:53:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Burgess X-Patchwork-Id: 55165 Return-Path: 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 18A2F3856DC0 for ; Sun, 2 Oct 2022 16:53:37 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 18A2F3856DC0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1664729617; bh=YSkwApJh4YfpsESmJMiNuuSlkIuWaH6ziRIzrEqkv+o=; h=To:Subject:Date:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=KeuaRbi+P1j1t0Phgeg8xLBYd6mobQLM9CDSAk4hrvh1FCb2ug0nrVP9//42KknYC GmmD4IYliLeD3en+VgbbFj7C2UZBYvdNgThJe17AePE1wuzqXF53PoPIAn9ncyWUou aWj/Ay5ZKV+hPa4xBmJg17WtannOln/gs05Z7FEo= X-Original-To: gdb-patches@sourceware.org Delivered-To: gdb-patches@sourceware.org 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 B19C13858D32 for ; Sun, 2 Oct 2022 16:53:12 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B19C13858D32 Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_128_GCM_SHA256) id us-mta-65-qq-WZ8g1OmesDs8lwopCEQ-1; Sun, 02 Oct 2022 12:53:11 -0400 X-MC-Unique: qq-WZ8g1OmesDs8lwopCEQ-1 Received: by mail-wm1-f71.google.com with SMTP id 5-20020a05600c028500b003b4d2247d3eso4616789wmk.0 for ; Sun, 02 Oct 2022 09:53:11 -0700 (PDT) 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; bh=YSkwApJh4YfpsESmJMiNuuSlkIuWaH6ziRIzrEqkv+o=; b=g0SDYP0vRWJFZdJKrfkiisXf1911dqgwu4xjbB1jD7OUJFpju+onaCMMHbkh8zSbUK tgKYqDN8FY3JDpeM/MxxQb4w104pbD70JMIWOILGYU17vT0YZcGGpqAIWavm7vt+vBS0 ypJ2ExRrRYrmxOf1vpbUVdi/AH9ClKGqTPOdwkeHfrcbqoClFiH/CyNv8rOJT3Obgvqr 9//8x2MeLjYMJyttXwvOp4b59YUyKRTsGQLBis/A0cC8YGseRwTbsirPvqnrWXNbdAMe I/Xh7JuSaC4XqSVxh34k/4ImVXWASt9h6V1q/QVCqYyj8Vsdpnggrxnqsf8rq1xlPd1+ wNoA== X-Gm-Message-State: ACrzQf2KWn3sOP7LyLdNdk1NNMHJxfmmoS0de6ahJOVpn19As3ggXSrM UgJQmEvg0MJkl9maG7mCRc5v+54ww3Ok3xzfmx9a37Ac5eRVdsaWx6ZMwpbRu+DN4I2jOBWdmCu rMEGJGb+Tf/F2quY2FtyO8q5oyNdeelH9HmVOM2d2H72uI0McJBvB+4a6Rigb+w1l1r5yGDrBAQ == X-Received: by 2002:adf:cf0a:0:b0:22e:3f43:a5f7 with SMTP id o10-20020adfcf0a000000b0022e3f43a5f7mr122369wrj.634.1664729589811; Sun, 02 Oct 2022 09:53:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM4bSylV+o6asx1b6ivmJru1ZC0B4lvO91YIBJMQ6Fqj5WI4AqBIhhOIBZ0geD1bwZf15sgjew== X-Received: by 2002:adf:cf0a:0:b0:22e:3f43:a5f7 with SMTP id o10-20020adfcf0a000000b0022e3f43a5f7mr122351wrj.634.1664729589469; Sun, 02 Oct 2022 09:53:09 -0700 (PDT) Received: from localhost (52.72.115.87.dyn.plus.net. [87.115.72.52]) by smtp.gmail.com with ESMTPSA id bj2-20020a0560001e0200b0022cc4b7861fsm7772545wrb.97.2022.10.02.09.53.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 02 Oct 2022 09:53:09 -0700 (PDT) To: gdb-patches@sourceware.org Subject: [PATCH 0/3] New mechanism to initialise Python components in GDB Date: Sun, 2 Oct 2022 17:53:02 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, RCVD_IN_BARRACUDACENTRAL, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no 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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-Patchwork-Original-From: Andrew Burgess via Gdb-patches From: Andrew Burgess Reply-To: Andrew Burgess Errors-To: gdb-patches-bounces+patchwork=sourceware.org@sourceware.org Sender: "Gdb-patches" This series is a rewrite of how we initialise Python components within GDB. Patch #3 is where the actual change took place. Patches #1 and #2 relate to dependencies between different Python components. Currently there are two pairs of components that have an initialisation order dependency. The change I propose in patch #3 revealed these dependencies which I think are otherwise pretty hidden. In patches #1 and #2 I've tweaked things so these dependencies are now (I think) more explicit. This is a pure refactoring project. I've had a rough outline of patch #3 kicking about for a while, but I recently thought I would need to add a new Python component finalize function (similar to gdbpy_finalize_micommands), so took the time to finish this series off... ... then it turned out I didn't need to add a new finalize function at all. Personally, I think this is an improvement, so I'm posting it, but I'd love to hear others thoughts. Thanks, Andrew --- Andrew Burgess (3): gdb/python: break dependencies between gdbpy_initialize_* functions gdb/python: break more dependencies between gdbpy_initialize_* functions gdb/python: add gdbpy_register_subsystem mechanism gdb/python/py-arch.c | 11 ++- gdb/python/py-auto-load.c | 9 ++- gdb/python/py-block.c | 9 ++- gdb/python/py-breakpoint.c | 30 ++++++-- gdb/python/py-cmd.c | 9 ++- gdb/python/py-connection.c | 4 +- gdb/python/py-disasm.c | 11 ++- gdb/python/py-event.c | 9 ++- gdb/python/py-evtregistry.c | 9 ++- gdb/python/py-finishbreakpoint.c | 14 +++- gdb/python/py-frame.c | 9 ++- gdb/python/py-function.c | 9 ++- gdb/python/py-gdb-readline.c | 10 ++- gdb/python/py-inferior.c | 11 ++- gdb/python/py-infthread.c | 11 ++- gdb/python/py-instruction.c | 50 +++++++++++--- gdb/python/py-instruction.h | 13 ++-- gdb/python/py-lazy-string.c | 9 ++- gdb/python/py-linetable.c | 9 ++- gdb/python/py-membuf.c | 11 ++- gdb/python/py-micmd.c | 9 ++- gdb/python/py-objfile.c | 9 ++- gdb/python/py-param.c | 9 ++- gdb/python/py-progspace.c | 9 ++- gdb/python/py-record-btrace.c | 9 ++- gdb/python/py-record.c | 11 ++- gdb/python/py-registers.c | 11 ++- gdb/python/py-symbol.c | 9 ++- gdb/python/py-symtab.c | 9 ++- gdb/python/py-tui.c | 9 ++- gdb/python/py-type.c | 9 ++- gdb/python/py-unwind.c | 34 +++++---- gdb/python/py-value.c | 9 ++- gdb/python/py-xmethods.c | 9 ++- gdb/python/python-internal.h | 114 ++++++++++++------------------- gdb/python/python.c | 73 ++++++++++---------- 36 files changed, 427 insertions(+), 172 deletions(-)