From nobody Thu Aug 31 11:11:26 2023 X-Original-To: dev-commits-doc-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rbz4Z3HTCz4s3kp for ; Thu, 31 Aug 2023 11:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (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 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rbz4Z2s1fz3KFv; Thu, 31 Aug 2023 11:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693480286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0wx7QYjUIc5rZmiFRZAMSnrv7Mu1VRejJNyb4VmElVg=; b=HOQZgbVclxoAne3xUisA0YmtPQ+zbHD1cawErQv+Y4kgJp9kGxil8Qxfy9VTxOmAdHvIN3 Nn/Jtg8kFqKBRsdWlUfw077hL9pldSu9i14CA6fjjIMNm90q7YhlGyWe7yi5G3SE4ftRQD M6Ud6SBgK06rKK+nYZpvlNum//qdbmJoIq5o8FyOARgN57nx5J4UEE/lX/IahOK3eWGbJb hIGh/2KD8DjpP6yr8yW4I6VrfPKqwxRSJPGHyGpwkHSCvV3KJBzvHdqCp4BlpMu/K8Kfcd te5alh458rzKvnktr/mUToEeT4n8aA+qZH+dwFDsxgbUPV9ldTOBTw+t3NGSVA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693480286; a=rsa-sha256; cv=none; b=nBm9VPVjbpTsZK0jb7eiu/tmL5fErn/4u99aAFDOI9lsFIWcoIjNKw0IOkDo63O86vY5QL mdXL8fDEdYS0BYAqYyvbLe45G0CfsFE2TWxeTivELyUEFDhnItSxjjgcWlBYZmjThHOLl2 HUdM/AIP6wqcYgogPQuvU6VWa0r0HwsWIrtO7/bR8cr5/D66cCq2afbdatBhaPHcGxotvx a6hVcygS7TFjVDKSxXATaYBuEhpJGAmHqlMA0Cyl4+9XvI8KPQs4CyubN2wdtsB9YPdZh0 0sImk9m1i7WGW5N/b/dm5nLiIqmAGL/4AqIEFSjPGjFFqUjj4udCIw0tIYWLpA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693480286; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=0wx7QYjUIc5rZmiFRZAMSnrv7Mu1VRejJNyb4VmElVg=; b=tf8jcz0EHoJnUvOyDmqxSsPNXt2gkvao2Tvew4WM51+RsenGOw4VCBHSzCrs6qvFLTEBWw uBOGPgmWknjVl3UaDkbbHuU6v3S5iLggmLZAMs1OGot0CnrhZ/x+Da7VoFKgVShxIXqTDc dHmvxZ+Vs5UcmMz7RXdOu4nWFBnxUFcOMAAv2/hR5ajfzMcloi7VmIAFR4qsWcBEXojhng r6DPG/z+P+nljjy3yL8eQPuj1O73mT7hLOqKFFCG725Ji8ReHvZD0+KFFCvwKxZVFNm7cM 7tSQ+hyHzMjrBcf5IGLqVmD/JuFzsmNBG0k03rj1GE62nb/leyt+XiN8P54W8g== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rbz4Z1wS3z1Kf; Thu, 31 Aug 2023 11:11:26 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37VBBQ8c012608; Thu, 31 Aug 2023 11:11:26 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37VBBQph012605; Thu, 31 Aug 2023 11:11:26 GMT (envelope-from git) Date: Thu, 31 Aug 2023 11:11:26 GMT Message-Id: <202308311111.37VBBQph012605@gitrepo.freebsd.org> To: doc-committers@FreeBSD.org, dev-commits-doc-all@FreeBSD.org From: Fernando =?utf-8?Q?Apestegu=C3=ADa?= Subject: git: 5ff4e8af63 - main - [phb]: Add information on how to debug ports List-Id: Commit messages for all branches of the doc repository List-Archive: https://lists.freebsd.org/archives/dev-commits-doc-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-doc-all@freebsd.org X-BeenThere: dev-commits-doc-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: fernape X-Git-Repository: doc X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 5ff4e8af631f4e36bcf79f7e29ae80c8c587f18e Auto-Submitted: auto-generated The branch main has been updated by fernape: URL: https://cgit.FreeBSD.org/doc/commit/?id=5ff4e8af631f4e36bcf79f7e29ae80c8c587f18e commit 5ff4e8af631f4e36bcf79f7e29ae80c8c587f18e Author: Fernando ApesteguĂ­a AuthorDate: 2023-08-29 11:06:28 +0000 Commit: Fernando ApesteguĂ­a CommitDate: 2023-08-31 11:10:28 +0000 [phb]: Add information on how to debug ports Heavily based on ports(7). PR: 247271 Reported by: pauamma@gundo.com Reviewed by: carlavilla@ Differential Revision: https://reviews.freebsd.org/D41653 --- .../en/books/porters-handbook/testing/_index.adoc | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/documentation/content/en/books/porters-handbook/testing/_index.adoc b/documentation/content/en/books/porters-handbook/testing/_index.adoc index 6f326f6ac8..b4e88cfe4c 100644 --- a/documentation/content/en/books/porters-handbook/testing/_index.adoc +++ b/documentation/content/en/books/porters-handbook/testing/_index.adoc @@ -628,3 +628,39 @@ To skip the prompt and remove all unused files unconditionally, the `-y` argumen .... # poudriere distclean -p portstree -y .... + +[[testing-debugging-ports]] +== Debugging ports + +Sometimes things go wrong and the port fails at run time. +The framework provides some facilities to help in debugging ports. +These helpers are limited since the way of debugging a port heavily depends on +the technology used. +The following variables help with debugging ports: + +* `WITH_DEBUG`. If set, ports are built with debugging symbols. +* `WITH_DEBUG_PORTS`. Specifies a list of ports to be built with `WITH_DEBUG` set. +* `DEBUG_FLAGS`. Used to specify additional flags to `CFLAGS`. Defaults to `-g`. + +When `WITH_DEBUG` is set, either globally or for a list of ports, the resulting +binaries are not stripped. + +These variables can be specified in [.filename]#make.conf# or in the command +line: + +[source,shell] +.... +# cd category/port && make -DWITH_DEBUG DEBUG_FLAGSS="-g -O0" +.... + +[NOTE] +==== +If the port is built using package:ports-mgmt/poudriere[] the debugging +variables must be specified in poudriere's [.filename]#make.conf# and not in +[.filename]#/etc/make.conf#. +Refer to package:ports-mgmt/poudriere[] documentation for details. +==== + +Please refer to the debugging information in the +extref:{developers-handbook}[Developer's Handbook, debugging] for more details +about the debugging tools available.