From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by sourceware.org (Postfix) with ESMTPS id D181F3858D39 for ; Tue, 19 Oct 2021 10:17:16 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org D181F3858D39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=embecosm.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=embecosm.com Received: by mail-wm1-x335.google.com with SMTP id y16-20020a05600c17d000b0030db7a51ee2so1701624wmo.0 for ; Tue, 19 Oct 2021 03:17: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=TYoBAHFdxQjRthsiEmZQdVCVdUqZDz0LxdwHIjYVUZw=; b=TLSYccn+gKveuWAEapVSDIcyX4sp0fCXOpqOvkiP9Qpkr5x32zbK9wygGhryHz4F/a rZutzACh5W6ofDESjSKC0w4UIrmw/zvBNLAn/50GGyjnsfLGwzt9Uzygq2N4MJZgQPyE wLQo1JhB5f97uti1Cx/i4Dhse4LuLj8jnt9zN+nVnSMpUhH/HqDfeyjThHjQAYmpHwV5 563GKooeOqQWsM/Df4eb65F7z7n9hQJ76v8OdhzToJwIlWelhTGOlMKuI8WSbD5ZtKVd f0CIsPbUwXF3cKpxUjmwy6JWcrgoiCZrMslc7z+3KK4Z/3KRBKG2cnhLznU0htlO1n31 F8PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=TYoBAHFdxQjRthsiEmZQdVCVdUqZDz0LxdwHIjYVUZw=; b=TuLrL+5EucBaCWGBZfMrIqVn8Hua85woBXMjawlx8nz+E7eMNpHxesQSBUnzIYvhoM BYfXsbC84aswVZFKzQmnXG5labaWYAopnxV7QJJGshUdz3+IrdKjHzQOt+8vv2YVoH2q Lpxsplfw6w6SwwswaPIJfi5KRV9EliKz7xAyP53degSf0sUIYw3M9pSIaRFFZznbISSs h6bKgXp2lmzRV/YqOkiXBzL9DQR/wWt8GvyJF7hoRfYkmQchN1OsaSYEyDNJ9CxNJkZU 5qbUfiRKyHdeU0V5r71Kuyy2YgvBpZQae2tbqOeOXWREvw0AzKx+ozFVrrkBhpZF+5Lf NWYQ== X-Gm-Message-State: AOAM531AvKivnqHPptS0hhjX1r3OncPWpc+/FV0iAy6n+GI3bqGYXaQ/ PN84/1z67zz9G1k8SCataQXkgR2QsSq2wg== X-Google-Smtp-Source: ABdhPJxC+t6m2NieT2On8V9zVZNcm3UjFExMi7ljk9x6nIrnxI6NezPWtUbEP96ZLNHg/IsuYs5vJg== X-Received: by 2002:a1c:7f0a:: with SMTP id a10mr5142185wmd.60.1634638633346; Tue, 19 Oct 2021 03:17:13 -0700 (PDT) Received: from localhost (host212-140-123-151.range212-140.btcentralplus.com. [212.140.123.151]) by smtp.gmail.com with ESMTPSA id u5sm15093625wrg.57.2021.10.19.03.17.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Oct 2021 03:17:12 -0700 (PDT) From: Andrew Burgess To: gdb-patches@sourceware.org Subject: [PATCHv3 0/3] Python API for target connections, and packet sending Date: Tue, 19 Oct 2021 11:17:06 +0100 Message-Id: X-Mailer: git-send-email 2.25.4 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.9 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.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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: Tue, 19 Oct 2021 10:17:18 -0000 Since v2: - Added a gdb.RemoteTargetConnection sub-class, which is used for 'remote' and 'extended-remote' connections. The previous 'send_remote_packet' has become 'send_packet' on this new sub-class. - Tests and documentation have been updated to reflect the above change. - In the first patch, connpy_repr has been modified in order to prepare it for the sub-class that will appear in the later patch. Since v1: - Rebased onto current upstream master and resolved the merge conflicts. - Addressed the documentation feedback from Eli. I'm not 100% sure that I have correctly addressed the concerns about patch #3, so this is probably worth rechecking. --- Andrew Burgess (3): gdb/python: introduce gdb.TargetConnection object type gdb: make packet_command function available outside remote.c gdb/python: add gdb.RemoteTargetConnection.send_packet gdb/Makefile.in | 1 + gdb/NEWS | 22 + gdb/doc/gdb.texinfo | 1 + gdb/doc/python.texi | 114 +++- gdb/observable.c | 1 + gdb/observable.h | 3 + gdb/python/py-all-events.def | 1 + gdb/python/py-connection.c | 523 ++++++++++++++++++ gdb/python/py-event-types.def | 5 + gdb/python/py-inferior.c | 16 + gdb/python/python-internal.h | 6 + gdb/python/python.c | 5 + gdb/remote.c | 67 ++- gdb/remote.h | 34 ++ gdb/target-connection.c | 4 + .../gdb.multi/multi-target-info-inferiors.exp | 38 ++ .../gdb.multi/multi-target-info-inferiors.py | 63 +++ gdb/testsuite/gdb.python/py-connection.c | 22 + gdb/testsuite/gdb.python/py-connection.exp | 63 +++ gdb/testsuite/gdb.python/py-inferior.exp | 20 +- gdb/testsuite/gdb.python/py-send-packet.c | 22 + gdb/testsuite/gdb.python/py-send-packet.exp | 59 ++ gdb/testsuite/gdb.python/py-send-packet.py | 84 +++ 23 files changed, 1148 insertions(+), 26 deletions(-) create mode 100644 gdb/python/py-connection.c create mode 100644 gdb/testsuite/gdb.multi/multi-target-info-inferiors.py create mode 100644 gdb/testsuite/gdb.python/py-connection.c create mode 100644 gdb/testsuite/gdb.python/py-connection.exp create mode 100644 gdb/testsuite/gdb.python/py-send-packet.c create mode 100644 gdb/testsuite/gdb.python/py-send-packet.exp create mode 100644 gdb/testsuite/gdb.python/py-send-packet.py -- 2.25.4