How to add "-g" to the Makefile?

ruifeng yang yrffren at gmail.com
Wed Jun 3 08:22:21 UTC 2009


Thanks a lot,now I can do gdb command by your advice:
[root at beijing2008 busybox-1.13.4]#export CFLAGS=-g
[root at beijing2008 busybox-1.13.4]#make clean
[root at beijing2008 busybox-1.13.4]#make
[root at beijing2008 busybox-1.13.4]#ls -l busybox_unstripped
[root at beijing2008 busybox-1.13.4]#gdb busybox_unstripped
GNU gdb Red Hat Linux (5.3post-0.20021129.18rh)
Copyright 2003 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i386-redhat-linux-gnu"...
(gdb) list
744     #endif /* !defined(SINGLE_APPLET_MAIN) */
745
746
747
748     #if ENABLE_BUILD_LIBBUSYBOX
749     int lbb_main(char **argv)
750     #else
751     int main(int argc UNUSED_PARAM, char **argv)
752     #endif
753     {
(gdb)


2009/6/3, Rob Landley <rob at landley.net>:
>
> On Wednesday 03 June 2009 00:55:34 ruifeng yang wrote:
> >    I add:
> > > export CFLAGS=-g
> >
> >    to the Makefile,but (no debugging symbols found)...
> > Will you please send Makefile to me by e-mail?
>
> You don't add it to the makefile, you export it as an environment variable
> before you run "make".  You can pass in arbitrary flags to the c compiler
> that
> way in most build systems.
>
> export CFLAGS=-g
> make clean
> make
> ls -l busybox_unstripped
>
> Rob
> --
> Latency is more important than throughput. It's that simple. - Linus
> Torvalds
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.busybox.net/pipermail/busybox/attachments/20090603/e2f6004c/attachment.htm>


More information about the busybox mailing list