From nobody Wed Dec 18 14:33:43 2024 X-Original-To: freebsd-questions@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 4YCx506nntz5hQbN for ; Wed, 18 Dec 2024 14:33:56 +0000 (UTC) (envelope-from stasiapowlessjkk42@gmail.com) Received: from mail-lj1-x233.google.com (mail-lj1-x233.google.com [IPv6:2a00:1450:4864:20::233]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "WR4" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4YCx4z6PCrz4MMB for ; Wed, 18 Dec 2024 14:33:55 +0000 (UTC) (envelope-from stasiapowlessjkk42@gmail.com) Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20230601 header.b=NvgQVKFb; spf=pass (mx1.freebsd.org: domain of stasiapowlessjkk42@gmail.com designates 2a00:1450:4864:20::233 as permitted sender) smtp.mailfrom=stasiapowlessjkk42@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-lj1-x233.google.com with SMTP id 38308e7fff4ca-3022598e213so63649361fa.0 for ; Wed, 18 Dec 2024 06:33:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734532433; x=1735137233; darn=freebsd.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=cBdrxj5umtxO+HCexsM9+SWgItp0kLqs3ProSrsTBCQ=; b=NvgQVKFbcuYlnBcAk94aT4VeTUGsX/ZNIlivYuYQ+/OkENtY90lJ+dvqDECLc/8mIu bDkBUiYHTLBNToF+xX9JuIKo82bSnU1fnOIVKmEy/1n1esvYxdyISxCdUORhtuYWhDrt ZeTXAC3WqlRBjAyAM70T92gKiqywRLLmN4YUUsXoNtThiquJeoqIRwkZLJTR5Eunxq5L HULMmMekaEpnd6UlOeQtSsr6bJP+qUb3BW9FtJJxUYonZ78Wng2V4UUW02Ibc7CN8YtZ fYg5HF2SK+EEiK6zeqNfMF0Lo09qMo27B4FhDw6WSye+ezY1EYJgVcEdcsM8A1skp53V mdWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734532433; x=1735137233; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=cBdrxj5umtxO+HCexsM9+SWgItp0kLqs3ProSrsTBCQ=; b=YEmghm+CMsCgo/tx160nl0J7ndDDC85oASYIa/O0juMEtNd50D3FPq9ILAozKpwmjE iGl5HZyll6k+fH3wKdMcFqjZWGk6J9UW4cPglw4CGuD/P6rzzMVdWhSulnEkQeWY3Sgp Wquo52GBVCGAO6TeFKLa/Tq4ALHczEj1fW23gQzqbgS8yOT/b1aL7xwFWH2ZQz45kLW+ gu94dkiiEmxYm2Is+x7J5diY/yOpw9uoCWcSUAlFw9a5HTjbfAJNFh86qCW/uM+bpqL1 a/EoUFwz9Jk0fmPV0N+YFsLWJwUqEBaKdZcSYWgTsCCwQHK13m0RiLjK1qzKQA2FEyP6 T9vg== X-Gm-Message-State: AOJu0YzdZTutgagsIMA53gyVaACZX8pVycpWufijndX9WQUx/qwePg1a GPlzOROu+PL2GRD36K0oIz2Q0eZQ07Gab/FUQ55762WTtWdU4K7qfFDzTeMnod4HdNjrFMo8idf sj7yvipAr4eK4ASry4U/w/nLGkXcMd2SBLt8= X-Gm-Gg: ASbGncsewYhuh//oJWccn6wJ//fuc3h3y2OncCZJP97pMz2VHYUuSDtyddzCvT75SO+ xUr4XEufKydmt0uijsnpNTBQqwGzQMry6qwG1f3/LJvDKxh0o2Qo1ehGAtyyRBI1SBA== X-Google-Smtp-Source: AGHT+IFmqGzM2okq/RdJqviXRhrwunL5uXpCK9xvQRlbSWkN0hFaObdPeMsHEC8l4q54zgWDChp1jRYcK/ti8fUdJ8o= X-Received: by 2002:a2e:b8cf:0:b0:302:3355:eb5e with SMTP id 38308e7fff4ca-3044db6eb76mr11539131fa.39.1734532431929; Wed, 18 Dec 2024 06:33:51 -0800 (PST) List-Id: User questions List-Archive: https://lists.freebsd.org/archives/freebsd-questions List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: freebsd-questions@freebsd.org Sender: owner-freebsd-questions@FreeBSD.org MIME-Version: 1.0 From: Stasia Powless Date: Wed, 18 Dec 2024 22:33:43 +0800 Message-ID: Subject: How to compile modules with debug symbols To: freebsd-questions@freebsd.org Content-Type: multipart/alternative; boundary="00000000000074e8c406298c4d89" X-Spamd-Result: default: False [-3.99 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.986]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20230601]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36:c]; MIME_GOOD(-0.10)[multipart/alternative,text/plain]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; MIME_TRACE(0.00)[0:+,1:+,2:~]; ARC_NA(0.00)[]; DWL_DNSWL_NONE(0.00)[gmail.com:dkim]; FREEMAIL_FROM(0.00)[gmail.com]; DKIM_TRACE(0.00)[gmail.com:+]; FROM_HAS_DN(0.00)[]; FREEMAIL_ENVFROM(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-questions@freebsd.org]; TO_DN_NONE(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; MISSING_XM_UA(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; MLMMJ_DEST(0.00)[freebsd-questions@freebsd.org]; RCVD_COUNT_ONE(0.00)[1]; RCVD_IN_DNSWL_NONE(0.00)[2a00:1450:4864:20::233:from] X-Rspamd-Queue-Id: 4YCx4z6PCrz4MMB X-Spamd-Bar: --- --00000000000074e8c406298c4d89 Content-Type: text/plain; charset="UTF-8" Hi, everyone. I just learned how to develop device drivers in FreeBSD. A simple one with this Makefile. ``` KMOD= hello SRCS= hello.c .include ``` Type `make` and it works. But no debug symbols by default. I followed `bsd.kmod.mk` and found `sys/conf/kmod.mk`. There are dozens of variables in `sys/conf/kmod.mk` which control the compiling process. But I did not find one that helps to add debug symbols or add `-g` into the CFLAGS. Thanks. --00000000000074e8c406298c4d89 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi, everyone. I just learned how to develop device drivers in FreeBSD.
= A simple one with this Makefile.
```
KMOD=3D =C2= =A0 hello
SRCS=3D =C2=A0 hello.c

.include <bsd.kmod.mk>
```
Type `make` and it works. But no debug symbols by default.

I followed `bsd.kmod.mk= ` and found `sys/conf/km= od.mk`. There are dozens of variables in `sys/conf/kmod.mk` which control the= compiling process. But I did not find one that helps to add debug symbols = or add `-g` into the CFLAGS.

Thanks.
--00000000000074e8c406298c4d89--