Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[cdt-dev] Debugging awkwardness

I'm trying to debug a program I'm working on, but as of yet, I haven't
been able to get debugging working.

For information, I'm running Debian unstable, and have experienced these
problems running the current CDT release (1.1.0), and the latest
snapshot release of CDT (1.2.50), so I do not believe this is a
malfunction in the CDT (or else there would be plenty of bug reports
regarding it). I am also doubtful that it is the project itself, because
I have attempted the same thing with creating a new project to test.
Knowing this, I am forced to believe that it is a problem in my
configuration.

I have built the program using debugging symbols (gcc -ggdb).

In my debug configuration, I have the correct project and application
specified, and have left the working directory as the default. No
options are being passed to the application (nor are any expected). I am
specifying no environment variables, and once again, none are expected.
My debugger of choice is the GDB Debugger, and I am launching the
program in the debugger, rather than attempting to attach the debugger
to a running process. I have a breakpoint set at main(), and have also
specified the "Stop at main() on startup" option. The location of the
GDB debugger is specified as /usr/bin/gdb (and it exists there).

For source locations, I have left it at the default of the project
directory. My source files are located in ${workspace}/src, but I have
also tried this by specifying the absolute location of the source
directory as an additional source location. Lastly, I have left the
settings on the "Common" tab at their defaults.

When I attempt to debug, it appears to be launching the process. Shortly
after, all of the threads terminate as is specified in the Debug box.
GDB has the text "(Breakpoint hit)" at the end, leading me to believe
that it's merely suspended waiting for me to step through, but I am
fairly confident that this is not the case, due to the debug output.

Here is the debug output from Eclipse:

[1,063,948,037,256] &".gdbinit: No such file or directory.\n"
[1,063,948,037,269] (gdb)
[1,063,948,037,288] 1-gdb-set confirm off
[1,063,948,037,307] 1^done
[1,063,948,037,311] 2-gdb-set width 0
[1,063,948,037,349] (gdb)
[1,063,948,037,350] 2^done
[1,063,948,037,350] 3-gdb-set height 0
[1,063,948,037,351] (gdb)
[1,063,948,037,371] 3^done
[1,063,948,037,372] 4 info remote-process
[1,063,948,037,373] (gdb)
[1,063,948,037,393] &"info remote-process\n"
[1,063,948,037,393] &"Command can only be used when connected to the
remote target.\n"
[1,063,948,037,394] 4^error,msg="Command can only be used when connected
to the remote target."
[1,063,948,037,465] (gdb)
[1,063,948,037,849] 5-gdb-set auto-solib-add on
[1,063,948,037,850] 5^done
[1,063,948,037,850] (gdb)
[1,063,948,037,850] 6-gdb-set stop-on-solib-events 0
[1,063,948,037,870] 6^done
[1,063,948,037,871] (gdb)
[1,063,948,037,876] 7-environment-cd
/home/stephen/Documents/Programs/Uniracers
[1,063,948,037,915] 7^done
[1,063,948,037,916] (gdb)
[1,063,948,038,363] 8 info threads
[1,063,948,038,364] &"info threads\n"
[1,063,948,038,364] &"No registers.\n"
[1,063,948,038,365] 8^error,msg="No registers."
[1,063,948,038,384] (gdb)
[1,063,948,038,390] 9-break-insert main.c:19
[1,063,948,038,429]
9^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048a\
24",func="main",file="src/main.c",line="19",times="0"}
[1,063,948,038,430] (gdb)
[1,063,948,038,440] 10-break-condition 1
[1,063,948,038,477] 10^done
[1,063,948,038,478] (gdb)
[1,063,948,038,478] 11-break-after 1 0
[1,063,948,038,479] 11^done
[1,063,948,038,479] (gdb)
[1,063,948,038,501] 12-data-list-register-names
[1,063,948,038,502]
12^done,register-names=["eax","ecx","edx","ebx","esp","ebp","esi","edi","eip","e\
flags","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"]
[1,063,948,038,504] (gdb)
[1,063,948,038,687] 13-break-insert -t main
[1,063,948,038,688]
13^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x08048a\
34",func="main",file="src/main.c",line="23",times="0"}
[1,063,948,038,688] (gdb)
[1,063,948,038,709] 14-exec-run
[1,063,948,038,711] 14^running
[1,063,948,038,711] (gdb)
[1,063,948,038,825] ~"[New Thread 16384 (LWP 3730)]\n"
[1,063,948,039,139] ~"[Switching to Thread 16384 (LWP 3730)]\n"
[1,063,948,039,141]
14*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x08048\
a24",func="main",args=[{name="argc",value="134515236"},{name="argv",value="0x1"}],file="src/main.c",\
line="20"}
[1,063,948,039,146] 15 info program
[1,063,948,039,147] (gdb)
[1,063,948,039,183] &"info program\n"
[1,063,948,039,184] ~"\tUsing the running image of child Thread 16384
(LWP 3730).\n"
[1,063,948,039,185] ~"Program stopped at 0x8048a24.\n"
[1,063,948,039,204] ~"It stopped at breakpoint 1.\n"
[1,063,948,039,205] ~"Type \"info stack\" or \"info registers\" for more
information.\n"
[1,063,948,039,236] 15^done
[1,063,948,039,237] 16 info threads
[1,063,948,039,237] (gdb)
[1,063,948,039,238] &"info threads\n"
[1,063,948,039,240] ~"* 1 Thread 16384 (LWP 3730)  "
[1,063,948,039,241]
16^done,frame={func="main",args=[{name="argc",value="134515236"},{name="argv",va\
lue="0x1"}],file="src/main.c",line="20"}
[1,063,948,039,252] 17-stack-info-depth
[1,063,948,039,253] (gdb)
[1,063,948,039,253] 17^done,depth="1"
[1,063,948,039,254] 18-stack-list-frames 0 0
[1,063,948,039,255] (gdb)
[1,063,948,039,255]
18^done,stack=[frame={level="0",addr="0x08048a24",func="main",file="src/main.c",\
line="20"}]
[1,063,948,039,256] 19-stack-list-frames 0 0
[1,063,948,039,257] (gdb)
[1,063,948,039,257]
19^done,stack=[frame={level="0",addr="0x08048a24",func="main",file="src/main.c",\
line="20"}]
[1,063,948,039,259] 20-data-list-changed-registers
[1,063,948,039,259] (gdb)
[1,063,948,097,423] &".gdbinit: No such file or directory.\n"
[1,063,948,097,423] (gdb)
[1,063,948,097,457] 22-gdb-set confirm off
[1,063,948,097,458] 22^done
[1,063,948,097,458] 23-gdb-set width 0
[1,063,948,097,477] (gdb)
[1,063,948,097,478] 23^done
[1,063,948,097,478] 24-gdb-set height 0
[1,063,948,097,497] (gdb)
[1,063,948,097,497] 24^done
[1,063,948,097,498] 25 info remote-process
[1,063,948,097,498] (gdb)
[1,063,948,097,519] &"info remote-process\n"
[1,063,948,097,538] &"Command can only be used when connected to the
remote target.\n"
[1,063,948,097,538] 25^error,msg="Command can only be used when
connected to the remote target."
[1,063,948,097,539] 26-gdb-set auto-solib-add on
[1,063,948,097,558] (gdb)
[1,063,948,097,559] 26^done
[1,063,948,097,559] 27-gdb-set stop-on-solib-events 0
[1,063,948,097,571] (gdb)
[1,063,948,097,572] 27^done
[1,063,948,097,573] 28-environment-cd
/home/stephen/Documents/Programs/Uniracers[1,063,948,097,585] (gdb)
[1,063,948,097,587] 28^done
[1,063,948,097,588] (gdb)
[1,063,948,098,101] 29 info threads
[1,063,948,098,117] &"info threads\n"
[1,063,948,098,117] &"No registers.\n"
[1,063,948,098,118] 29^error,msg="No registers."
[1,063,948,098,118] (gdb)
[1,063,948,098,161] 30-break-insert main.c:19
[1,063,948,098,164]
30^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x08048\
a24",func="main",file="src/main.c",line="19",times="0"}
[1,063,948,098,166] (gdb)
[1,063,948,098,167] 31-break-condition 1
[1,063,948,098,204] 31^done
[1,063,948,098,204] (gdb)
[1,063,948,098,204] 32-break-after 1 0
[1,063,948,098,205] 32^done
[1,063,948,098,205] (gdb)
[1,063,948,098,206] 33-data-list-register-names
[1,063,948,098,226]
33^done,register-names=["eax","ecx","edx","ebx","esp","ebp","esi","edi","eip","e\
flags","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"]
[1,063,948,098,229] (gdb)
[1,063,948,098,364] 34-break-insert -t main
[1,063,948,098,365]
34^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x08048a\
34",func="main",file="src/main.c",line="23",times="0"}
[1,063,948,098,365] 35-exec-run
[1,063,948,098,366] (gdb)
[1,063,948,098,384] 35^running
[1,063,948,098,385] (gdb)
[1,063,948,098,536] ~"[New Thread 16384 (LWP 3750)]\n"
[1,063,948,098,640] ~"[Switching to Thread 16384 (LWP 3750)]\n"
[1,063,948,098,641]
35*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1",frame={addr="0x08048\
a24",func="main",args=[{name="argc",value="134515236"},{name="argv",value="0x1"}],file="src/main.c",\
line="20"}
[1,063,948,098,642] (gdb)
[1,063,948,098,642] 36 info program
[1,063,948,098,680] &"info program\n"
[1,063,948,098,681] ~"\tUsing the running image of child Thread 16384
(LWP 3750).\n"
[1,063,948,098,681] ~"Program stopped at 0x8048a24.\n"
[1,063,948,098,702] ~"It stopped at breakpoint 1.\n"
[1,063,948,098,703] ~"Type \"info stack\" or \"info registers\" for more
information.\n"
[1,063,948,098,704] 36^done
[1,063,948,098,704] (gdb)
[1,063,948,098,707] 37 info threads
[1,063,948,098,745] &"info threads\n"
[1,063,948,098,747] ~"* 1 Thread 16384 (LWP 3750)  "
[1,063,948,098,776]
37^done,frame={func="main",args=[{name="argc",value="134515236"},{name="argv",va\
lue="0x1"}],file="src/main.c",line="20"}
[1,063,948,098,776] (gdb)
[1,063,948,098,776] 38-stack-info-depth
[1,063,948,098,777] 38^done,depth="1"
[1,063,948,098,777] (gdb)
[1,063,948,098,777] 39-stack-list-frames 0 0
[1,063,948,098,778]
39^done,stack=[frame={level="0",addr="0x08048a24",func="main",file="src/main.c",\
line="20"}]
[1,063,948,098,778] (gdb)
[1,063,948,098,779] 40-stack-list-frames 0 0
[1,063,948,098,779]
40^done,stack=[frame={level="0",addr="0x08048a24",func="main",file="src/main.c",\
line="20"}]
[1,063,948,098,779] (gdb)
[1,063,948,098,780] 41-data-list-changed-registers

I'm sure this is something simple, but I can't for the life of me figure
out what is causing my problems. Does anyone have a way to fix this? All
help would be greatly appreciated.

-- 
Stephen Touset <stephen@xxxxxxxxxx>

Attachment: signature.asc
Description: This is a digitally signed message part


Back to the top