Hi, Setup build environment as you said earlier, Thanks for help
I did followed all you said. * yum install fedora-rpmdevtools -y yum install rpmdevtools rpmdev-setuptree *
I install the srpm as below
*rpm -i /home/harsha/Download/wpa_supplicant-0.6.4-2.fc10.src.rpm *
every time i will create the tar.gz file of the folder /root/rpmbuild/SOURCE/wpa_supplicant-0.6.4/ and compile as
*rpmbuild -bs wpa_supplicant.spec *
and i put* print statements and debug,* Can any one help me how can i use kdbg and use any kind of debug build where i can debug line by line...
Please help me how to setup debug enveronment in fedora and debug line by line,
I even installed *rpm -i wpa_supplicant-debuginfo-0.6.4-2.fc10.i386.rpm*
the source is present at */usr/src/debug/*
But could not find any pointers in net where i can debug line by line.
Thanks for your replies
Regards Harsha
On Thu, 09 Jul 2009 12:33:10 +0200, Harsha gowda wrote:
use any kind of debug build where i can debug line by line...
If you want to debug wpa_supplicant installed in the system:
$ gdb -q wpa_supplicant Missing separate debuginfos, use: debuginfo-install wpa_supplicant-0.6.8-4.fc11.x86_64 (gdb) quit # debuginfo-install wpa_supplicant-0.6.8-4.fc11.x86_64 $ gdb -q wpa_supplicant (gdb) start Temporary breakpoint 1 at 0x43d690: file main.c, line 115. Starting program: /usr/sbin/wpa_supplicant [Thread debugging using libthread_db enabled]
Temporary breakpoint 1, main (argc=1, argv=0x7fffffffd678) at main.c:115 115 { (gdb) next 122 if (os_program_init()) (gdb) warning: Source file is more recent than executable. 85 return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest)); (gdb) 128 iface = ifaces = os_zalloc(sizeof(struct wpa_interface)); (gdb) 126 params.wpa_debug_level = MSG_INFO; (gdb) list 121 122 if (os_program_init()) 123 return -1; 124 125 os_memset(¶ms, 0, sizeof(params)); 126 params.wpa_debug_level = MSG_INFO; 127 128 iface = ifaces = os_zalloc(sizeof(struct wpa_interface)); 129 if (ifaces == NULL) 130 return -1; (gdb)
and debug line by line,
Just with current gcc and production rpms (built using -O2) the stepping jumps a bit. You should recompile the package with -O0 for serious debugging (for -O2 it should be fixed sometimes during gcc-4.5).
To recompile wpa_supplicant (or the same way some other package) with -O0 try the .spec patch below.
Regards, Jan
--- wpa_supplicant.spec-orig 2009-05-13 16:56:01.000000000 +0200 +++ wpa_supplicant.spec 2009-07-09 17:01:22.000000000 +0200 @@ -63,8 +63,9 @@ Graphical User Interface for wpa_supplic %build pushd wpa_supplicant cp %{SOURCE1} ./.config - CFLAGS="${CFLAGS:-%optflags}" ; export CFLAGS ; - CXXFLAGS="${CXXFLAGS:-%optflags}" ; export CXXFLAGS ; + CFLAGS="${CFLAGS:-%optflags} -O0 -ggdb3" ; export CFLAGS ; + CXXFLAGS="${CXXFLAGS:-%optflags} -O0 -ggdb3" ; export CXXFLAGS ; + # FIXME: wpa_supplicant/wpa_gui/Makefile is left with unchanged {CFLAGS,CXXFLAGS} due to qmake. make %{_smp_mflags} QTDIR=%{_libdir}/qt-3.3 make wpa_gui %{_smp_mflags} popd