From patchwork Tue Jun 8 15:18:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 1489478 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=smtp2.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20161025 header.b=qB9aPU3m; dkim-atps=neutral Received: from smtp2.osuosl.org (smtp2.osuosl.org [140.211.166.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 4Fzv6T4C8Fz9sSn for ; Wed, 9 Jun 2021 01:19:29 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp2.osuosl.org (Postfix) with ESMTP id C38C9402D1; Tue, 8 Jun 2021 15:19:27 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp2.osuosl.org ([127.0.0.1]) by localhost (smtp2.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id T2DcWzyWO1zy; Tue, 8 Jun 2021 15:19:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp2.osuosl.org (Postfix) with ESMTP id 30B85402CB; Tue, 8 Jun 2021 15:19:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 303281BF867 for ; Tue, 8 Jun 2021 15:18:52 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 2039882C35 for ; Tue, 8 Jun 2021 15:18:52 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Authentication-Results: smtp1.osuosl.org (amavisd-new); dkim=pass (2048-bit key) header.d=gmail.com Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id IkM62NIb14of for ; Tue, 8 Jun 2021 15:18:51 +0000 (UTC) X-Greylist: whitelisted by SQLgrey-1.8.0 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by smtp1.osuosl.org (Postfix) with ESMTPS id 2FB2882BC0 for ; Tue, 8 Jun 2021 15:18:51 +0000 (UTC) Received: by mail-ed1-x530.google.com with SMTP id d13so11417783edt.5 for ; Tue, 08 Jun 2021 08:18:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=cAyIKqWdnEguNL6UQrSMESV+1rLJlIj0DhRxfCAa0q0=; b=qB9aPU3mq6DM99uBNJzzzm1fmSk06zJLtHNRw3dBEQwgdiUpzx+O5A+X2fWO4lRPEH gpyqayYQsdw8Fd7vx9nP349bn7SZOcCJ5SXP8LHeY+VDVrliFPCefGTxCjfN4LO+eK5A nu6KsBo9sMSr2BfAw4P6VDrTCz3AUdF4W/rv6zECkyNRmP5X1XXIa4R3sjAConvoab5z u2yYABI56Q5jKhGNxMdf6dbNWcZq6e513QRqwPIw2KX07pSVMaBMDnjq6kDJdx9G3MQZ OLKT8w+Jil9iKw2pkOU2vMj9y5eSgVV5p7thZhMZVCguc44Zx2TXlaJO77bZzjysn0aa Pydg== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=cAyIKqWdnEguNL6UQrSMESV+1rLJlIj0DhRxfCAa0q0=; b=DNdYrIFlpSAoKB0O9M1Tz5y2/39I6DBLwmF4Cdin2XNlWDLfT0qSAU8mCM7Rhuiuq0 gWp0BhIMF3faGN9pSAAgAQfE4CBmQUqUJFDA7UuprGGnd9BxmDurHOJ+OLxEvw8GkRSL JNLfTc5H7ikwunDAczaBDIHFRlCa9PFg16bs1Gkxl0KxfSibMLIU72jrf+HM/lheo/ok otYTqo5sRogxUOMRjkA0djuq22CurGVvQfiGvc7mbQewRqrpRtEbX1kTo8kOj6BjMRkq 8QFMgdpuLwEjMOFiy6Ox0S2r1zU3L53JG3sDO4HdaE9g9+lpDiDxMA+5MCWQlLFxdPZ9 HrbQ== X-Gm-Message-State: AOAM532AcGUNORWboYdRjgRxJ1vFWqmtEnRZMYhgFdZ4pbVJeqS4mPgZ zk1Ezs804pBpsJhSksS1G+iY7A8hdrUuJki1 X-Google-Smtp-Source: ABdhPJy5H6Gd8dY1/PM4d9zG1YuqJErahHODRkrYIlg1Kxaflbp76jYGf+gwVSXFr2ZytgPA79PfGg== X-Received: by 2002:aa7:cfd4:: with SMTP id r20mr26406925edy.237.1623165529337; Tue, 08 Jun 2021 08:18:49 -0700 (PDT) Received: from localhost (ptr-5gw9tx0z7f066xyxzn.18120a2.ip6.access.telenet.be. [2a02:1810:510:3800:124:6af2:167b:d993]) by smtp.gmail.com with ESMTPSA id h2sm19327edr.50.2021.06.08.08.18.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Jun 2021 08:18:48 -0700 (PDT) From: Thomas De Schampheleire To: buildroot@buildroot.org Date: Tue, 8 Jun 2021 17:18:39 +0200 Message-Id: <20210608151840.20917-4-patrickdepinguin@gmail.com> X-Mailer: git-send-email 2.26.3 In-Reply-To: <20210608151840.20917-1-patrickdepinguin@gmail.com> References: <20210608151840.20917-1-patrickdepinguin@gmail.com> MIME-Version: 1.0 Subject: [Buildroot] [PATCHv2 3/3] toolchain: mark sysroot as 'safe' path for gdb auto-load X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Romain Naour , Thomas Petazzoni , Thomas De Schampheleire Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" From: Thomas De Schampheleire gdb can automatically load certain files as described in [1]. Such files could install pretty-printers for complex data structures. libstdcxx (C++ standard library) provided by gcc, is one example of a library for which such auto-load file is available. But there are other examples too, like libglib2. However, gdb will only auto-load files if the file is located in one of the locations treated as 'safe'. The Buildroot sysroot is not by default in that list. Provide a better debugging experience by adding the sysroot to the 'safe' list, via the gdbinit file prepared by Buildroot. [1] https://sourceware.org/gdb/onlinedocs/gdb/objfile_002dgdbdotext-file.html Signed-off-by: Thomas De Schampheleire --- toolchain/helpers.mk | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/toolchain/helpers.mk b/toolchain/helpers.mk index 17bc159f3e..dfb2581ed5 100644 --- a/toolchain/helpers.mk +++ b/toolchain/helpers.mk @@ -483,7 +483,8 @@ check_toolchain_ssp = \ # gen_gdbinit_file = \ mkdir -p $(STAGING_DIR)/usr/share/buildroot/ ; \ - echo "set sysroot $(STAGING_DIR)" > $(STAGING_DIR)/usr/share/buildroot/gdbinit + echo "set sysroot $(STAGING_DIR)" > $(STAGING_DIR)/usr/share/buildroot/gdbinit ; \ + echo "add-auto-load-safe-path $(STAGING_DIR)" >> $(STAGING_DIR)/usr/share/buildroot/gdbinit # Given a path, determine the relative prefix (../) needed to return to the # root level. Note that the last component is treated as a file component; use a