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



## rhyous (Jan 3, 2010)

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...
> 
> ...



Read the full "How to" here...


----------



## graudeejs (Jan 3, 2010)

I'd add to /etc/make.conf

```
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...


----------



## danger@ (Jan 3, 2010)

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.


----------



## graudeejs (Jan 3, 2010)

maybe.... dunno


----------



## MG (Jan 4, 2010)

When your FreeBSD src.tar.gz is installed and CFLAGS has the -g option in /ec/make.conf:


```
cd /usr/src/usr.sbin/sysinstall
make && make install (or grab the files yourself in /usr/obj/usr/src/usr.sbin)
```


----------



## dennylin93 (Jan 4, 2010)

danger@ said:
			
		

> 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.



More info here: 6.0R GENERIC makeoptions DEBUG=-g.


----------

