[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: Hi help required for setting up a debug setup



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(&params, 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]