[Qt-creator] [Debugger] Can not step into source code on RHEL5.2?

Ed Sutton ESutton at fescorp.com
Tue May 5 15:43:01 CEST 2009


Andre',

Thank you very much for your assistance.

On Mon, May 04, 2009 at 03:48:03PM -0500, Ed Sutton wrote:
> What are possible problems that can prevent source code debugging from
> operating normally?

Missing debug information is the most common cause. Binaries run from
a location different from the build location without proper adjustments
is number two.

>>  My "Build Configuration" is set to Debug.

>Can you check there's a -g on the compile and link lines?

When I do a make at the command line, I see -g on the compile lines but not the link line.  Is there a way to conditionally insert this into the project file?  What's is the preferred approach so I can easily switch betwewn release and debug?

[esutton at localhost rtleda]$ make
g++ -c -pipe -g -Wall -W -D_REENTRANT -DDEBUG -DQT_CORE_LIB -DQT_SHARED -I../../qtsdk-2009.02/qt/mkspecs/linux-g++ -I. -I../../qtsdk-2009.02/qt/include/QtCore -I../../qtsdk-2009.02/qt/include -Iinclude -I. -I. -o main.o src/main.cpp
src/main.cpp: In function ‘int main(int, char**)’:
src/main.cpp:508: warning: unused variable ‘protocolVersion’
gcc -c -pipe -g -Wall -W -D_REENTRANT -DDEBUG -DQT_CORE_LIB -DQT_SHARED -I../../qtsdk-2009.02/qt/mkspecs/linux-g++ -I. -I../../qtsdk-2009.02/qt/include/QtCore -I../../qtsdk-2009.02/qt/include -Iinclude -I. -I. -o getch.o src/getch.c
g++ -c -pipe -g -Wall -W -D_REENTRANT -DDEBUG -DQT_CORE_LIB -DQT_SHARED -I../../qtsdk-2009.02/qt/mkspecs/linux-g++ -I. -I../../qtsdk-2009.02/qt/include/QtCore -I../../qtsdk-2009.02/qt/include -Iinclude -I. -I. -o dwellbuffer.o src/dwellbuffer.cpp
g++ -Wl,-rpath,/home/esutton/qtsdk-2009.02/qt/lib -o rtleda main.o getch.o dwellbuffer.o    -L/home/esutton/qtsdk-2009.02/qt/lib -L/opt/fontconfig-2.4.2/lib -lQtCore -L/home/esutton/qtsdk-2009.02/qt/lib -lm -pthread -lgthread-2.0 -lrt -lglib-2.0 -ldl -lpthread

>In any case: please send the output of the right pane of the Gdb View.
It's the closest thing to a Crystal Ball we have ;-)

I pasted below.  I apologize if too much.  I did not know what is needed.

status:Starting Debugger: gdb --tty=/tmp/qt_temp.TJ5615 -i mi
status:Gdb Running...
debug:Debugger settings:
debug:
debug:gdb
debug:20
debug:true
debug:
debug:true
debug:
debug:false
debug:true
debug:false
debug:
debug:true
debug:false
debug:false
debug:
input:1show version
input:2set print static-members off
input:3set breakpoint pending on
input:4set print elements 10000
input:5-data-list-register-names
input:6set overload-resolution off
input:7handle SIGSEGV nopass stop print
input:8set unwindonsignal on
input:9pwd
input:10set width 0
input:11set height 0
input:12-file-exec-and-symbols "/home/esutton/projects/rtleda/rtleda"
input:13-exec-arguments -m 239.255.255.7 -n 192.168.1.134
input:14set auto-solib-add off
input:15info target
input:16-file-list-exec-source-files
input:17info shared
input:18disassemble
            08:28:33.911
stdout:~"GNU gdb Red Hat Linux (6.5-37.el5rh)\n"
            08:28:33.914
stdout:~"Copyright (C) 2006 Free Software Foundation, Inc.\n"
            08:28:33.914
stdout:~"GDB is free software, covered by the GNU General Public License, and you are\n"
            08:28:33.915
stdout:~"welcome to change it and/or distribute copies of it under certain conditions.\n"
            08:28:33.916
stdout:~"Type \"show copying\" to see the conditions.\n"
            08:28:33.916
stdout:~"There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"
            08:28:33.917
stdout:~"This GDB was configured as \"i386-redhat-linux-gnu\"."
            08:28:33.917
stdout:~"\n"
            08:28:33.917
stdout:(gdb)
            08:28:33.917
stdout:&"show version\n"
            08:28:33.920
stdout:~"GNU gdb Red Hat Linux (6.5-37.el5rh)\n"
            08:28:33.921
stdout:~"Copyright (C) 2006 Free Software Foundation, Inc.\n"
            08:28:33.921
stdout:~"GDB is free software, covered by the GNU General Public License, and you are\n"
            08:28:33.921
stdout:~"welcome to change it and/or distribute copies of it under certain conditions.\n"
            08:28:33.922
stdout:~"Type \"show copying\" to see the conditions.\n"
            08:28:33.922
stdout:~"There is absolutely no warranty for GDB.  Type \"show warranty\" for details.\n"
            08:28:33.922
stdout:~"This GDB was configured as \"i386-redhat-linux-gnu\".\n"
            08:28:33.922
stdout:1^done
debug:VERSION:1^done,{logstreamoutput="show version
debug:",consolestreamoutput="GNU gdb Red Hat Linux (6.5-37.el5rh)
debug:Copyright (C) 2006 Free Software Foundation, Inc.
debug:GDB is free software, covered by the GNU General Public License, and you are
debug:welcome to change it and/or distribute copies of it under certain conditions.
debug:Type \"show copying\" to see the conditions.
debug:There is absolutely no warranty for GDB.  Type \"show warranty\" for details.
debug:This GDB was configured as \"i386-redhat-linux-gnu\".
debug:GNU gdb Red Hat Linux (6.5-37.el5rh)
debug:Copyright (C) 2006 Free Software Foundation, Inc.
debug:GDB is free software, covered by the GNU General Public License, and you are
debug:welcome to change it and/or distribute copies of it under certain conditions.
debug:Type \"show copying\" to see the conditions.
debug:There is absolutely no warranty for GDB.  Type \"show warranty\" for details.
debug:This GDB was configured as \"i386-redhat-linux-gnu\".
debug:"}
debug:
debug:UNSUPPORTED GDB VERSION GNU gdb Red Hat Linux (6.5-37.el5rh)
debug:Copyright (C) 2006 Free Software Foundation, Inc.
debug:GDB is free software, covered by the GNU General Public License, and you are
debug:welcome to change it and/or distribute copies of it under certain conditions.
debug:Type "show copying" to see the conditions.
debug:There is absolutely no warranty for GDB.  Type "show warranty" for details.
debug:This GDB was configured as "i386-redhat-linux-gnu".
debug:GNU gdb Red Hat Linux (6.5-37.el5rh)
debug:Copyright (C) 2006 Free Software Foundation, Inc.
debug:GDB is free software, covered by the GNU General Public License, and you are
debug:welcome to change it and/or distribute copies of it under certain conditions.
debug:Type "show copying" to see the conditions.
debug:There is absolutely no warranty for GDB.  Type "show warranty" for details.
debug:This GDB was configured as "i386-redhat-linux-gnu".
debug:
            08:28:33.923
stdout:(gdb)
            08:28:33.924
stdout:&"set print static-members off\n"
            08:28:33.924
stdout:2^done
            08:28:33.924
stdout:(gdb)
            08:28:33.924
stdout:&"set breakpoint pending on\n"
            08:28:33.924
stdout:3^done
            08:28:33.924
stdout:(gdb)
            08:28:33.924
stdout:&"set print elements 10000\n"
            08:28:33.924
stdout:4^done
            08:28:33.924
stdout:(gdb)
            08:28:33.924
stdout:5^done,register-names=["eax","ecx","edx","ebx","esp","ebp","esi","edi","eip","eflags","cs","ss","ds","es","fs","gs","st0","st1","st2","st3","st4","st5","st6","st7","fctrl","fstat","ftag","fiseg","fioff","foseg","fooff","fop","xmm0","xmm1","xmm2","xmm3","xmm4","xmm5","xmm6","xmm7","mxcsr","orig_eax","mm0","mm1","mm2","mm3","mm4","mm5","mm6","mm7"]
            08:28:33.926
stdout:(gdb)
            08:28:33.926
stdout:&"set overload-resolution off\n"
            08:28:33.926
stdout:6^done
            08:28:33.926
stdout:(gdb)
            08:28:33.926
stdout:&"handle SIGSEGV nopass stop print\n"
            08:28:33.926
stdout:~"Signal        Stop\tPrint\tPass to program\tDescription\n"
            08:28:33.926
stdout:~"SIGSEGV       Yes\tYes\tNo\t\tSegmentation fault\n"
            08:28:33.926
stdout:7^done
            08:28:33.926
stdout:(gdb)
            08:28:33.926
stdout:&"set unwindonsignal on\n"
            08:28:33.926
stdout:8^done
            08:28:33.926
stdout:(gdb)
            08:28:33.926
stdout:&"pwd\n"
            08:28:33.926
stdout:~"Working directory /home/esutton/projects/rtleda.\n"
            08:28:33.926
stdout:9^done
debug:PWD RESULT: /home/esutton/projects/rtleda
            08:28:33.945
stdout:(gdb)
            08:28:33.945
stdout:&"set width 0\n"
            08:28:33.945
stdout:10^done
            08:28:33.945
stdout:(gdb)
            08:28:33.945
stdout:&"set height 0\n"
            08:28:33.945
stdout:11^done
            08:28:33.945
stdout:(gdb)
status:Running requested...
            08:28:33.978
stdout:~"Using host libthread_db library \"/lib/libthread_db.so.1\".\n"
            08:28:33.978
stdout:12^done
            08:28:33.979
stdout:(gdb)
            08:28:33.979
stdout:13^done
            08:28:33.980
stdout:(gdb)
            08:28:33.980
stdout:&"set auto-solib-add off\n"
            08:28:33.980
stdout:14^done
            08:28:33.981
stdout:(gdb)
            08:28:33.981
stdout:&"info target\n"
            08:28:33.981
stdout:~"Symbols from \"/home/esutton/projects/rtleda/rtleda\".\n"
            08:28:33.981
stdout:~"Local exec file:\n"
            08:28:33.982
stdout:~"\t`/home/esutton/projects/rtleda/rtleda', file type elf32-i386.\n"
            08:28:33.982
stdout:~"\tEntry point: 0x80489f0\n"
            08:28:33.982
stdout:~"\t0x08048134 - 0x08048147 is .interp\n"
            08:28:33.982
stdout:~"\t0x08048148 - 0x08048168 is .note.ABI-tag\n"
            08:28:33.982
stdout:~"\t0x08048168 - 0x080481b4 is .gnu.hash\n"
            08:28:33.982
stdout:~"\t0x080481b4 - 0x08048414 is .dynsym\n"
            08:28:33.982
stdout:~"\t0x08048414 - 0x08048642 is .dynstr\n"
            08:28:33.982
stdout:~"\t0x08048642 - 0x0804868e is .gnu.version\n"
            08:28:33.982
stdout:~"\t0x08048690 - 0x08048720 is .gnu.version_r\n"
            08:28:33.982
stdout:~"\t0x08048720 - 0x08048740 is .rel.dyn\n"
            08:28:33.982
stdout:~"\t0x08048740 - 0x08048818 is .rel.plt\n"
            08:28:33.982
stdout:~"\t0x08048818 - 0x0804882f is .init\n"
            08:28:33.982
stdout:~"\t0x08048830 - 0x080489f0 is .plt\n"
            08:28:33.982
stdout:~"\t0x080489f0 - 0x08049a68 is .text\n"
            08:28:33.982
stdout:~"\t0x08049a68 - 0x08049a84 is .fini\n"
            08:28:33.982
stdout:~"\t0x08049a88 - 0x0804a168 is .rodata\n"
            08:28:33.982
stdout:~"\t0x0804a168 - 0x0804a1cc is .eh_frame_hdr\n"
            08:28:33.982
stdout:~"\t0x0804a1cc - 0x0804a330 is .eh_frame\n"
            08:28:33.982
stdout:~"\t0x0804b330 - 0x0804b338 is .ctors\n"
            08:28:33.982
stdout:~"\t0x0804b338 - 0x0804b340 is .dtors\n"
            08:28:33.982
stdout:~"\t0x0804b340 - 0x0804b344 is .jcr\n"
            08:28:33.982
stdout:~"\t0x0804b344 - 0x0804b45c is .dynamic\n"
            08:28:33.982
stdout:~"\t0x0804b45c - 0x0804b460 is .got\n"
            08:28:33.982
stdout:~"\t0x0804b460 - 0x0804b4d8 is .got.plt\n"
            08:28:33.983
stdout:~"\t0x0804b4d8 - 0x0804b504 is .data\n"
            08:28:33.983
stdout:~"\t0x0804b520 - 0x0804c584 is .bss\n"
            08:28:33.983
stdout:15^done
input:19tbreak *0x80489f0
input:20-exec-run
            08:28:33.987
stdout:(gdb)
            08:28:33.987
stdout:16^done,files=[{file="src/dwellbuffer.cpp",fullname="/home/esutton/projects/rtleda/src/dwellbuffer.cpp"},{file="src/dwellbuffer.cpp",fullname="/home/esutton/projects/rtleda/src/dwellbuffer.cpp"},{file="src/getch.c",fullname="/home/esutton/projects/rtleda/src/getch.c"},{file="src/getch.c",fullname="/home/esutton/projects/rtleda/src/getch.c"},{file="src/main.cpp",fullname="/home/esutton/projects/rtleda/src/main.cpp"},{file="src/dwellbuffer.h",fullname="/home/esutton/projects/rtleda/src/dwellbuffer.h"},{file="src/main.cpp",fullname="/home/esutton/projects/rtleda/src/main.cpp"}]
            08:28:33.990
stdout:(gdb)
            08:28:33.990
stdout:&"info shared\n"
            08:28:33.990
stdout:~"No shared libraries loaded at this time.\n"
            08:28:33.990
stdout:17^done
            08:28:33.990
stdout:(gdb)
            08:28:33.990
stdout:&"disassemble\n"
            08:28:33.990
stdout:&"No frame selected.\n"
            08:28:33.991
stdout:18^error,msg="No frame selected."
            08:28:33.991
stdout:(gdb)
            08:28:34.070
stdout:&"tbreak *0x80489f0\n"
            08:28:34.071
stdout:~"Breakpoint 1 at 0x80489f0\n"
            08:28:34.071
stdout:19^done
            08:28:34.071
stdout:(gdb)
            08:28:34.072
stdout:20^running
            08:28:34.072
stdout:(gdb)
status:Stopped.
status:Running requested...
            08:28:34.389
stdout:20*stopped,thread-id="0",frame={addr="0x080489f0",func="_start",args=[]}
input:21info proc
input:22-file-list-exec-source-files
input:23sharedlibrary libc
input:24sharedlibrary libdl
input:25call (void*)dlopen("/home/esutton/qtsdk-2009.02/qt/qtc-debugging-helper/libgdbmacros.so", 2)
input:26call (void*)__dlopen("/home/esutton/qtsdk-2009.02/qt/qtc-debugging-helper/libgdbmacros.so", 2)
input:27sharedlibrary .home.esutton.qtsdk-2009.02.qt.qtc-debugging-helper.libgdbmacros.so
input:28call (void*)qDumpObjectData440(1,28+1,0,0,0,0,0,0)
input:29p (char*)&qDumpOutBuffer
input:30set auto-solib-add on
input:31set stop-on-solib-events 0
input:32sharedlibrary .*
input:33info shared
input:34-exec-continue
            08:28:34.398
stdout:(gdb)
            08:28:34.472
stdout:&"info proc\n"
            08:28:34.472
stdout:~"process 5827\n"
            08:28:34.473
stdout:~"cmdline = '/home/esutton/projects/rtleda/rtleda'\n"
            08:28:34.473
stdout:~"cwd = '/home/esutton/projects/rtleda'\n"
            08:28:34.474
stdout:~"exe = '/home/esutton/projects/rtleda/rtleda'\n"
            08:28:34.474
stdout:21^done
debug:FOUND PID 5827
            08:28:34.477
stdout:(gdb)
            08:28:34.477
stdout:22^done,files=[{file="src/dwellbuffer.cpp",fullname="/home/esutton/projects/rtleda/src/dwellbuffer.cpp"},{file="src/dwellbuffer.cpp",fullname="/home/esutton/projects/rtleda/src/dwellbuffer.cpp"},{file="src/getch.c",fullname="/home/esutton/projects/rtleda/src/getch.c"},{file="src/getch.c",fullname="/home/esutton/projects/rtleda/src/getch.c"},{file="src/main.cpp",fullname="/home/esutton/projects/rtleda/src/main.cpp"},{file="src/dwellbuffer.h",fullname="/home/esutton/projects/rtleda/src/dwellbuffer.h"},{file="src/main.cpp",fullname="/home/esutton/projects/rtleda/src/main.cpp"}]
            08:28:34.478
stdout:(gdb)
            08:28:34.479
stdout:&"sharedlibrary libc\n"
            08:28:34.597
stdout:~"Loaded symbols for /lib/libc.so.6\n"
            08:28:34.600
stdout:23^done
            08:28:34.600
stdout:(gdb)
            08:28:34.603
stdout:&"sharedlibrary libdl\n"
            08:28:34.612
stdout:~"Loaded symbols for /lib/libdl.so.2\n"
            08:28:34.615
stdout:24^done
            08:28:34.616
stdout:(gdb)
            08:28:34.620
stdout:&"call (void*)dlopen(\"/home/esutton/qtsdk-2009.02/qt/qtc-debugging-helper/libgdbmacros.so\", 2)\n"
            08:28:34.627
stdout:&"No symbol \"dlopen\" in current context.\n"
status:Custom dumper setup: No symbol "dlopen" in current context.
            08:28:34.630
stdout:25^error,msg="No symbol \"dlopen\" in current context."
            08:28:34.633
stdout:(gdb)
            08:28:34.652
stdout:&"call (void*)__dlopen(\"/home/esutton/qtsdk-2009.02/qt/qtc-debugging-helper/libgdbmacros.so\", 2)\n"
            08:28:34.657
stdout:&"warning: Unable to restore previously selected frame.\n"
status:Debugging helpers not found.
            08:28:35.468
stdout:&"warning: Unable to restore previously selected frame.\n"
            08:28:35.468
stdout:~"$1 = (void *) 0x0\n"
            08:28:35.469
stdout:26^done
            08:28:35.469
stdout:(gdb)
            08:28:35.470
stdout:&"sharedlibrary .home.esutton.qtsdk-2009.02.qt.qtc-debugging-helper.libgdbmacros.so\n"
            08:28:35.470
stdout:~"No loaded shared libraries match the pattern `.home.esutton.qtsdk-2009.02.qt.qtc-debugging-helper.libgdbmacros.so'.\n"
            08:28:35.471
stdout:27^done
            08:28:35.471
stdout:(gdb)
            08:28:35.471
stdout:&"call (void*)qDumpObjectData440(1,28+1,0,0,0,0,0,0)\n"
            08:28:35.472
stdout:&"No symbol \"qDumpObjectData440\" in current context.\n"
            08:28:35.472
stdout:28^error,msg="No symbol \"qDumpObjectData440\" in current context."
            08:28:35.472
stdout:(gdb)
            08:28:35.472
stdout:&"p (char*)&qDumpOutBuffer\n"
            08:28:35.472
stdout:&"No symbol \"qDumpOutBuffer\" in current context.\n"
            08:28:35.472
stdout:29^error,msg="No symbol \"qDumpOutBuffer\" in current context."
            08:28:35.473
stdout:(gdb)
            08:28:35.473
stdout:&"set auto-solib-add on\n"
            08:28:35.473
stdout:30^done
            08:28:35.473
stdout:(gdb)
            08:28:35.473
stdout:&"set stop-on-solib-events 0\n"
            08:28:35.473
stdout:31^done
            08:28:35.473
stdout:(gdb)
            08:28:35.473
stdout:&"sharedlibrary .*\n"
            08:28:35.491
stdout:~"Loaded symbols for /lib/ld-linux.so.2\n"
            08:28:38.560
stdout:~"Loaded symbols for /home/esutton/qtsdk-2009.02/qt/lib/libQtCore.so.4\n"
            08:28:38.560
stdout:~"Loaded symbols for /lib/libgthread-2.0.so.0\n"
            08:28:38.561
stdout:~"Loaded symbols for /lib/librt.so.1\n"
            08:28:38.591
stdout:~"Loaded symbols for /lib/libglib-2.0.so.0\n"
            08:28:38.592
stdout:~"Symbols already loaded for /lib/libdl.so.2\n"
            08:28:38.621
stdout:~"[Thread debugging using libthread_db enabled]\n"
            08:28:38.621
stdout:~"[New Thread -1208064304 (LWP 5827)]\n"
            08:28:38.621
stdout:~"Loaded symbols for /lib/libpthread.so.0\n"
            08:28:38.744
stdout:~"Loaded symbols for /usr/lib/libstdc++.so.6\n"
status:Running...
status:Running...
            08:28:38.783
stdout:~"Loaded symbols for /lib/libm.so.6\n"
            08:28:38.783
stdout:~"Loaded symbols for /lib/libgcc_s.so.1\n"
            08:28:38.783
stdout:~"Symbols already loaded for /lib/libc.so.6\n"
            08:28:38.783
stdout:32^done
            08:28:38.783
stdout:(gdb)
            08:28:38.783
stdout:&"info shared\n"
            08:28:38.783
stdout:~"From        To          Syms Read   Shared Object Library\n"
            08:28:38.783
stdout:~"0x00a5a7f0  0x00a6fe8f  Yes         /lib/ld-linux.so.2\n"
            08:28:38.783
stdout:~"0x00c077e0  0x00d6fba4  Yes         /home/esutton/qtsdk-2009.02/qt/lib/libQtCore.so.4\n"
            08:28:38.783
stdout:~"0x00874f70  0x008766e4  Yes         /lib/libgthread-2.0.so.0\n"
            08:28:38.783
stdout:~"0x00111880  0x00115af4  Yes         /lib/librt.so.1\n"
            08:28:38.783
stdout:~"0x00125e40  0x00170594  Yes         /lib/libglib-2.0.so.0\n"
            08:28:38.783
stdout:~"0x001b7a50  0x001b8a84  Yes         /lib/libdl.so.2\n"
            08:28:38.783
stdout:~"0x001bf210  0x001c9d54  Yes         /lib/libpthread.so.0\n"
            08:28:38.783
stdout:~"0x006bbc50  0x00737284  Yes         /usr/lib/libstdc++.so.6\n"
            08:28:38.783
stdout:~"0x001d5410  0x001f0594  Yes         /lib/libm.so.6\n"
            08:28:38.783
stdout:~"0x001fa660  0x00201ee4  Yes         /lib/libgcc_s.so.1\n"
            08:28:38.783
stdout:~"0x0021abd0  0x00313a20  Yes         /lib/libc.so.6\n"
            08:28:38.783
stdout:33^done
            08:28:38.783
stdout:(gdb)
            08:28:38.783
stdout:34^running
            08:28:38.783
stdout:(gdb)
input:35-file-list-exec-source-files
input:36disassemble
input:37info shared
input:38-file-list-exec-source-files
input:39disassemble
input:40info shared

Thanks again for time and assistance!

-Ed

Andre'
_______________________________________________
Qt-creator mailing list
Qt-creator at trolltech.com
http://lists.trolltech.com/mailman/listinfo/qt-creator




More information about the Qt-creator-old mailing list