Home » Language IDEs » C / C++ IDE (CDT) » GDB crashing when started from CDT(GDB failing to launch)
GDB crashing when started from CDT [message #521054] |
Tue, 16 March 2010 10:51 |
Oliver Hall Messages: 6 Registered: March 2010 |
Junior Member |
|
|
Hi,
Please excuse this if it's so painfully obvious that I should be ashamed of myself! I've been searching the web and this forum but can't find anyone with the same problem as I have.
The symptom:
I have a C++ multithreaded project - nothing very flash (I've really only just started). Other than using a 3rd party library (upnp), itis standard C++ - nothing fancy, no extra Eclipse plugins. It compiles without warnings or errors. If I run the exe under a Cygwin console, it works fine. If I run the exe under command line gdb at the console it runs fine (though I have no idea how to use "nude" gdb . I've not tinkered with any debug settings (i.e. using the default DSF-GDB mode), and I'm running a Debug build(!)
However - if I try to debug from within Eclipse, on the first attempt, the exe will launch (I don't get asked to change perspective - which seems odd) and when I look in the Debug perspective, I see my exe, with 3 child processes (gdb/mi, gdb and my executable). gdb/mi has a little "cog" icon next to it,the other two show the green "play" icon.
What's odd is, my breakpoint (start of main) hasn't been hit (which I guess is why the perspective hasn't changed), and none of the processes allow me to see where they are or step through the code. There's no output I can see to give me any idea where things have gone wrong.
If I then try to terminate the processes, I get Termination failed after a timeout.
Now... if I try to Debug again, the process tree appears and then terminates immediately and I wind up with a stackdump from gdb (attached below).
I'm sure I'm doing something stupid - but can anyone shed any light on where I might be going wrong or where I could look to find the error?
I should mention - I built the default "Hello World" CDT app and it works perfectly! Very frustrating.
Please help!
Ol
Environment:
Windows Vista 32-bit
Cygwin (CYGWIN_NT-6.0 1.7.1)
Eclipse IDE for C++ developers package (build 20100209-1602)
(built with Eclipse 3.5.2, CDT 6.0.2)
GDB 6.8.0.200803280-cvs (cygwin-special)
--- gdb.exe.stackdump
Exception: STATUS_ACCESS_VIOLATION at eip=75D6EDBC
eax=00007FFB ebx=00000000 ecx=021A001C edx=008D0146 esi=00000000 edi=7FFDEC00
ebp=0022BA84 esp=0022B7AC program=C:\Tools\Cygwin\bin\gdb.exe, pid 4260, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame Function Args
0022BA84 75D6EDBC (7FFDEC00, 00000000, 0022BAC4, 00000000)
0022BD18 75D5899D (006D9950, 0022BD60, 10581F50, 6106EBD4)
0022C1E8 00461CC6 (00000000, 00000000, 106371D0, 00000000)
0022C238 004136CB (00461C50, 00000000, 0064D968, 00000006)
0022C2C8 004637F2 (0022C348, FFFFFFFF, 00000000, 00000000)
0022C3A8 00429CC2 (00000000, 00000000, 00000060, 75D7AEB6)
0022C3C8 004628CB (000001DC, 0022C400, 00000000, 00000000)
0022C708 004632A0 (10525570, 1063E938, 10510228, 00000000)
0022C738 00413C8B (00000000, 00000000, 00000000, 00000000)
0022C778 00402519 (10639EAC, 00000000, 1063E340, 0040C69B)
0022C7C8 00516404 (00000000, 00000000, 00000000, 00000024)
0022C848 00515D37 (1051F0A0, 0022C8B0, 10582320, 00000000)
0022C878 00413482 (0022C8A0, 1051F0A0, 00515C50, 0022C8B0)
0022C8C8 00515A0E (10578470, 00000001, 0022C8F8, 004363BA)
0022C8D8 0049E729 (10578470, 00000000, 0022C8A0, 0022C880)
0022C8F8 004363BA (00000000, 00000000, 0022C918, 00435D95)
End of stack trace (more stack frames may be present)
|
|
| | | |
Re: GDB crashing when started from CDT [message #521126 is a reply to message #521124] |
Tue, 16 March 2010 14:25 |
Oliver Hall Messages: 6 Registered: March 2010 |
Junior Member |
|
|
Hi Marc,
I see!
Here's the output, but to my untrained eye, I'm not sure what migth be wrong here. I'd read somewhere that the missing .gdbinit isn't anything to worry about?
198,817 1source .gdbinit
198,820 &"source .gdbinit\n"
198,851 &".gdbinit: No such file or directory.\n"
198,852 1^error,msg=".gdbinit: No such file or directory."
198,858 (gdb)
198,864 2-file-exec-and-symbols F:/Ultamation/software/Eclipse/ControlPoint/Debug/ControlPoi nt.exe
199,780 2^done
199,780 (gdb)
199,787 3-environment-cd F:/Ultamation/software/Eclipse/ControlPoint
199,791 3^done
199,791 (gdb)
199,796 4-gdb-set auto-solib-add on
199,797 4^done
199,797 (gdb)
199,815 5-environment-directory F:/Ultamation/software/Eclipse/ControlPoint F:/Ultamation/software/E\
clipse/ControlPoint/.settings F:/Ultamation/software/Eclipse/ControlPoint/Debug F:/Ultamation/softwa\
re/Eclipse/ControlPoint/Debug/outputmanager F:/Ultamation/software/Eclipse/ControlPoint/Release F:/U\
ltamation/software/Eclipse/ControlPoint/outputmanager
199,827 5^done,source-path=" F:/Ultamation/software/Eclipse/ControlPoint:F:/Ultamation/so ftware/Eclip\
se/ControlPoint/.settings:F:/Ultamation/software/Eclipse/Con trolPoint/Debug:F:/Ultamation/software/E\
clipse/ControlPoint/Debug/outputmanager:F:/Ultamation/softwa re/Eclipse/ControlPoint/Release:F:/Ultam\
ation/software/Eclipse/ControlPoint/outputmanager:$cdir:$cwd "
199,828 (gdb)
199,856 6-break-insert main.cpp:80
199,902 6^done,bkpt={number="1",type="breakpoint",disp="keep",enabled= "y",addr="0x00402558",func="ma\
in",file="../main.cpp",fullname=" /cygdrive/f/Ultamation/software/Eclipse/ControlPoint/main.cp p ",line\
="80",times="0"}
199,913 (gdb)
199,985 7-break-insert -t main
199,997 7^done,bkpt={number="2",type="breakpoint",disp="del",enabled= "y",addr="0x0040256e",func="mai\
n",file="../main.cpp",fullname=" /cygdrive/f/Ultamation/software/Eclipse/ControlPoint/main.cp p ",line=\
"80",times="0"}
199,998 (gdb)
200,000 8-exec-run
200,001 8^running
200,002 (gdb)
200,059 ~"[New thread 1016.0x1df8]\n"
That's it... and a terminated process
|
|
| |
Re: GDB crashing when started from CDT [message #521170 is a reply to message #521162] |
Tue, 16 March 2010 16:08 |
Oliver Hall Messages: 6 Registered: March 2010 |
Junior Member |
|
|
Hi Marc,
One step further
As per your instructions, I typed in each of the gdb trace console commands into gdb started at the command line (with the options you gave) and the results are identical... until I get to step 8.
I've clipped the intial stuff as it's the same as the CDT instance, but the "8-exec-run" line starts the program and successfully halts on the breakpoint at main.
7-break-insert -t main
7^done,bkpt={number="2",type="breakpoint",disp="del",enabled= "y",addr="0x0040259
2",func="main",file="../main.cpp",fullname="/cygdrive/f/Ultamation/software/Ecli
pse/ControlPoint/main.cpp",line="80",times="0"}
(gdb)
8-exec-run
8^running
(gdb)
~"[New thread 6060.0x141c]\n"
~"[New thread 6060.0x17ec]\n"
8*stopped,reason="breakpoint-hit",bkptno="1",thread-id="1 ",frame={addr="0x004025
7c",func="main",args=[],file="../main.cpp",fullname="/cygdrive/f/Ultamation/soft
ware/Eclipse/ControlPoint/main.cpp",line="80"}
(gdb)
If I type continue here, gdb resumes and the whole thing runs as expected. Now I'm more confused than ever!
Edit: I should point out, there was a breakpoint defined just before step 7, with address 0x004025, and I had to "continue" twice to resume properly.
[Updated on: Tue, 16 March 2010 16:13] Report message to a moderator
|
|
| | | | |
Goto Forum:
Current Time: Tue Apr 23 10:33:42 GMT 2024
Powered by FUDForum. Page generated in 0.04005 seconds
|