How to compile a portion of FreeBSD code with debugging (Sysinstall for example)

Well, here is what I wrote for this week.

How to compile a portion of FreeBSD code with debugging? (Sysinstall for example)

Ok, so maybe you want to work on fixing something in a portion of FreeBSD code, but you lack the knowledge to get started. That is what this document is for, to get you started.

For this example, I am going to use Sysinstall...

So lets get started.

Step 1 – Install FreeBSD
...
Step 2 – Download the FreeBSD Source
...
Step 3 – Find the location of the portion of source you wish to compile (Sysinstall in this example)
...
Step 4 - Compile with debugging.

Read the full "How to" here...
 
I'd add to /etc/make.conf
Code:
CFLAGS+=-g
CXXFLAGS+=-g
and then rebuild everything

Note that FreeBSD will be slower.
also read GENERIC kernel configuration file if you need to debug kernel....

P.S.
This is what I would try.... I haven't done this...
 
I havent done any benchmarking, but I was in the impression that -g only makes the binaries bigger in the size and does not affect the performance.
 
When your FreeBSD src.tar.gz is installed and CFLAGS has the -g option in /ec/make.conf:

Code:
cd /usr/src/usr.sbin/sysinstall
make && make install (or grab the files yourself in /usr/obj/usr/src/usr.sbin)
 
Back
Top