WANTED: busybox debugging guide

Denys Vlasenko vda.linux at googlemail.com
Thu Jan 9 17:13:42 UTC 2014


On Sat, Jan 4, 2014 at 10:10 PM, John Spencer
<maillist-busybox at barfooze.de> wrote:
> i use the following to build busybox in "debug mode"
>
> if [ ! -z "$DEBUGBUILD" ] ; then
>         debugcflags="-O0 -g"
>         sed -i 's/# CONFIG_DEBUG is not set/CONFIG_DEBUG=y/' .config
>         sed -i 's/# CONFIG_DEBUG_PESSIMIZE is not
> set/CONFIG_DEBUG_PESSIMIZE=y/' .config
>         sed -i 's/CONFIG_NO_DEBUG_LIB=y/# CONFIG_NO_DEBUG_LIB is not set/'

The last sed seems to be not really necessary...

> .config
> fi
>
> make V=1 LDFLAGS=-static HOSTLDFLAGS=-static \
> CFLAGS_busybox="$debugcflags -Wl,-z,muldefs
> -Werror-implicit-function-declaration" \
> HOSTCC="$CC -static" CC="$CC -static" HOSTCFLAGS=-D_GNU_SOURCE
>
> and then use busybox_unstripped.
>
> i'm pretty sure there must be a better way as i cant imagine anyone
> debugging busybox copy/pasting for hours. any tips are welcome.

Send a patch to make it easier for others?
(I take it the important part is setting -O0 -g in CFLAGS_busybox?)


More information about the busybox mailing list