From patchwork Fri May 28 16:35:40 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hauke Mehrtens X-Patchwork-Id: 1485276 X-Patchwork-Delegate: hauke@hauke-m.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.openwrt.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org; receiver=) Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=IurasjmT; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 4Fs9R70yS6z9sTD for ; Sat, 29 May 2021 02:40:34 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type:List-Help: Reply-To:List-Archive:List-Unsubscribe:List-Subscribe:From:List-Post:List-Id: Message-ID:MIME-Version:Date:Subject:To:Cc:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=mc1cGUw+tJGApcCPc8VzwineE/Jlv7VLRcFW19k3xuA=; b=IurasjmThvwRJO47Ez+2yrpjPz JcGJ4Yg6tH/D9rK/SpIberTczUaB8Q/au6xEePtJc6DfyaqXrlsyZARC3eNOfBo8wOT8FMorICmd5 djTkv8CFry+9qLczEhcfa3FFqOzjlu7MyywDwLwyvD2/jF78zq1bezL0yaVuEqdtuFIsEbDZzngAm 1GIZwunZd+tbzTRpgJVL5C2qr1YJLSOyF3qu09iAyRn1JVdo0wqKHLLuUziFCY/MeV2fpja021NC3 C0Wx4dYtT6cwSd3l93abAEweqyw0HsBO11dx3myXjSSucb0hBNDDjygd7oHIbZThG/DtHZ3Vdv1gz pECgubnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1lmfUd-00H5EL-14; Fri, 28 May 2021 16:37:51 +0000 To: Subject: [PATCH] toolchain: gdb: Add optional python support Date: Fri, 28 May 2021 18:35:40 +0200 MIME-Version: 1.0 Message-ID: List-Id: OpenWrt Development List List-Post: X-Patchwork-Original-From: Hauke Mehrtens via openwrt-devel From: Hauke Mehrtens Precedence: list X-Mailman-Version: 2.1.34 X-BeenThere: openwrt-devel@lists.openwrt.org List-Subscribe: , List-Unsubscribe: , List-Archive: Reply-To: Hauke Mehrtens List-Help: Sender: "openwrt-devel" Errors-To: openwrt-devel-bounces+incoming=patchwork.ozlabs.org@lists.openwrt.org The sender domain has a DMARC Reject/Quarantine policy which disallows sending mailing list messages using the original "From" header. To mitigate this problem, the original message has been wrapped automatically by the mailing list software. Compile gdb with python support optionally. To use the Python support in gdb some extra python files are needed, install them too. While at it also install other shared files which we did not install before. If gdb is built without Python support the python folder does not exists. Signed-off-by: Hauke Mehrtens --- toolchain/Config.in | 8 ++++++++ toolchain/gdb/Makefile | 11 ++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/toolchain/Config.in b/toolchain/Config.in index 6dda9af92d..8ff5438d79 100644 --- a/toolchain/Config.in +++ b/toolchain/Config.in @@ -259,6 +259,14 @@ config GDB help Enable if you want to build the gdb. +config GDB_PYTHON + bool + depends on GDB + prompt "Build gdb with python binding" + + help + Enable the python bindings for GDB to allow using python in the gdb shell. + config USE_GLIBC default y if !TOOLCHAINOPTS && !EXTERNAL_TOOLCHAIN && !NATIVE_TOOLCHAIN && (arc) bool diff --git a/toolchain/gdb/Makefile b/toolchain/gdb/Makefile index 05e3c7de3c..2708eff869 100644 --- a/toolchain/gdb/Makefile +++ b/toolchain/gdb/Makefile @@ -36,7 +36,6 @@ HOST_CONFIGURE_ARGS = \ --without-included-gettext \ --enable-threads \ --with-expat \ - --without-python \ --disable-unit-tests \ --disable-ubsan \ --disable-binutils \ @@ -44,11 +43,21 @@ HOST_CONFIGURE_ARGS = \ --disable-gas \ --disable-sim +ifneq ($(CONFIG_GDB_PYTHON),) + HOST_CONFIGURE_ARGS+= --with-python +else + HOST_CONFIGURE_ARGS:= --without-python +endif + define Host/Install mkdir -p $(TOOLCHAIN_DIR)/bin $(INSTALL_BIN) $(HOST_BUILD_DIR)/gdb/gdb $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb ln -fs $(TARGET_CROSS)gdb $(TOOLCHAIN_DIR)/bin/$(GNU_TARGET_NAME)-gdb strip $(TOOLCHAIN_DIR)/bin/$(TARGET_CROSS)gdb + mkdir -p $(TOOLCHAIN_DIR)/share/gdb + -cp -R $(HOST_BUILD_DIR)/gdb/data-directory/python $(TOOLCHAIN_DIR)/share/gdb/ + cp -R $(HOST_BUILD_DIR)/gdb/data-directory/syscalls $(TOOLCHAIN_DIR)/share/gdb/ + cp -R $(HOST_BUILD_DIR)/gdb/data-directory/system-gdbinit $(TOOLCHAIN_DIR)/share/gdb/ endef define Host/Clean