Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » gdb terminates, debugging not working(Weird output from gdb traces, would like to know how to run from console)
gdb terminates, debugging not working [message #1778411] Thu, 14 December 2017 03:52
Thomas Kelly is currently offline Thomas KellyFriend
Messages: 1
Registered: December 2017
Junior Member
First post, new to most of this for PC. I usually work with hardware debuggers for embedded devices like the STM32 which I've gotten to work in Eclipse and other IDEs. This project is on my PC running Win10 64bit.

I've been following this tutorial (even though it seems to be old!) with success writing, building, and running using the 32bit MinGW.

(can't post link due to this being my first post, it's the first Google link if you search for
"How To Install Eclipse CDT 8.2 and Get Started"
and it's the 4th step, a program that incorrectly finds factorial of 20)


I want to debug with gdb. Everything seems to be set up OK but it terminates shortly after starting. I have the portion of the gdb trace that I think is causing the problem, and also the full trace at the end of the post.


161,471 24-break-insert -f C:\\Users\\asdf\\Desktop\\ctest2\\debugtst\\src\\debugtst.cpp:4
161,483 24^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00401476",func="m\
ain()",file="..\\src\\debugtst.cpp",fullname="C:\\Users\\asdf\\Desktop\\ctest2\\debugtst\\src\\debug\
tst.cpp",line="4",thread-groups=["i1"],times="0",original-location="C:\\\\Users\\\\asdf\\\\Desktop\\\
\\ctest2\\\\debugtst\\\\src\\\\debugtst.cpp:4"}
161,484 (gdb) 
161,488 25-break-insert -t -f main
161,494 25^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00401476",func="ma\
in()",file="..\\src\\debugtst.cpp",fullname="C:\\Users\\asdf\\Desktop\\ctest2\\debugtst\\src\\debugt\
st.cpp",line="5",thread-groups=["i1"],times="0",original-location="main"}


What's up with the double and triple \? It's so weird that it is very hard to search for on google, and I've never seen any gdb trace with anything like it.

I'm tired and my head hurts. If you have a quick tutorial on running it from the console to make sure it isn't Eclipse I'd be happy to try that.

Thanks for reading here is the full trace.

161,259 2-gdb-version
161,260 ~"GNU gdb (GDB) 7.6.1\n"
161,261 ~"Copyright (C) 2013 Free Software Foundation, Inc.\n"
161,261 ~"License GPLv3+: GNU GPL version 3 or later <not allowed due to first post>\nThis is fre\
e software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitt\
ed by law.  Type \"show copying\"\nand \"show warranty\" for details.\n"
161,261 ~"This GDB was configured as \"mingw32\".\nFor bug reporting instructions, please see:\n"
161,261 ~"not allowed due to first post"
161,261 2^done
161,261 (gdb) 
161,262 3-environment-cd C:/Users/asdf/Desktop/ctest2/debugtst
161,265 4-list-thread-groups
161,271 3^done
161,271 (gdb) 
161,271 4^done,groups=[{id="i1",type="process"}]
161,271 (gdb) 
161,272 5-gdb-set breakpoint pending on
161,281 5^done
161,281 (gdb) 
161,282 6-gdb-set detach-on-fork on
161,291 6^done
161,291 (gdb) 
161,292 7-enable-pretty-printing
161,301 7^done
161,301 (gdb) 
161,302 8-gdb-set python print-stack none
161,311 8^done
161,311 (gdb) 
161,312 9-gdb-set print object on
161,321 9^done
161,321 (gdb) 
161,322 10-gdb-set print sevenbit-strings on
161,331 10^done
161,331 (gdb) 
161,332 11-gdb-set host-charset UTF-8
161,341 11^done
161,341 (gdb) 
161,342 12-gdb-set target-charset WINDOWS-1252
161,352 12^done
161,352 (gdb) 
161,353 13-gdb-set target-wide-charset UTF-16
161,362 13^done
161,363 (gdb) 
161,363 14source .gdbinit
161,373 &"source .gdbinit\n"
161,373 &".gdbinit: No such file or directory.\n"
161,373 14^error,msg=".gdbinit: No such file or directory."
161,373 (gdb) 
161,374 15-gdb-set target-async off
161,384 15^done
161,384 (gdb) 
161,384 16-gdb-set auto-solib-add on
161,394 16^done
161,394 (gdb) 
161,397 17-file-exec-and-symbols --thread-group i1 C:/Users/asdf/Desktop/ctest2/debugtst/Debug/debug\
tst.exe
161,407 17^done
161,407 (gdb) 
161,407 18-gdb-show --thread-group i1 language
161,417 18^done,value="auto"
161,417 (gdb) 
161,417 19-gdb-set --thread-group i1 language c
161,427 19^done
161,427 (gdb) 
161,428 20-interpreter-exec --thread-group i1 console "p/x (char)-1"
161,438 ~"$1 = 0xff\n"
161,438 20^done
161,438 (gdb) 
161,439 21-data-evaluate-expression --thread-group i1 "sizeof (void*)"
161,448 21^done,value="4"
161,449 (gdb) 
161,449 22-gdb-set --thread-group i1 language auto
161,458 22^done
161,458 (gdb) 
161,459 23-interpreter-exec --thread-group i1 console "show endian"
161,469 ~"The target endianness is set automatically (currently little endian)\n"
161,469 23^done
161,469 (gdb) 
161,471 24-break-insert -f C:\\Users\\asdf\\Desktop\\ctest2\\debugtst\\src\\debugtst.cpp:4
161,483 24^done,bkpt={number="1",type="breakpoint",disp="keep",enabled="y",addr="0x00401476",func="m\
ain()",file="..\\src\\debugtst.cpp",fullname="C:\\Users\\asdf\\Desktop\\ctest2\\debugtst\\src\\debug\
tst.cpp",line="4",thread-groups=["i1"],times="0",original-location="C:\\\\Users\\\\asdf\\\\Desktop\\\
\\ctest2\\\\debugtst\\\\src\\\\debugtst.cpp:4"}
161,484 (gdb) 
161,488 25-break-insert -t -f main
161,494 25^done,bkpt={number="2",type="breakpoint",disp="del",enabled="y",addr="0x00401476",func="ma\
in()",file="..\\src\\debugtst.cpp",fullname="C:\\Users\\asdf\\Desktop\\ctest2\\debugtst\\src\\debugt\
st.cpp",line="5",thread-groups=["i1"],times="0",original-location="main"}
161,494 (gdb) 
161,495 26-exec-run --thread-group i1
161,548 =thread-group-started,id="i1",pid="9624"
161,562 =thread-created,id="1",group-id="i1"
161,570 ~"[New Thread 9624.0x1394]\n"
161,572 26^running
161,572 *running,thread-id="all"
161,572 (gdb) 
161,595 =thread-created,id="2",group-id="i1"
161,595 ~"[New Thread 9624.0x2b54]\n"
161,596 *running,thread-id="all"
161,597 =thread-created,id="3",group-id="i1"
161,597 ~"[New Thread 9624.0x1a58]\n"
161,597 *running,thread-id="all"
161,597 =thread-exited,id="2",group-id="i1"
161,598 =thread-exited,id="3",group-id="i1"
161,600 =thread-exited,id="1",group-id="i1"
161,600 =thread-group-exited,id="i1"
161,601 26^error,msg="During startup program exited with code 0xc0000135."
161,601 (gdb) 
161,616 27thread
161,623 &"thread\n"
161,623 &"No thread selected\n"
161,624 27^error,msg="No thread selected"
161,624 (gdb) 
161,647 28-list-thread-groups
161,647 29-list-thread-groups
161,658 28^done,groups=[{id="i1",type="process",executable="C:/Users/asdf/Desktop/ctest2/debugtst/De\
bug/debugtst.exe"}]
161,659 (gdb) 
161,659 29^done,groups=[{id="i1",type="process",executable="C:/Users/asdf/Desktop/ctest2/debugtst/De\
bug/debugtst.exe"}]
161,659 (gdb) 
161,662 30-list-thread-groups i1
161,676 30^done,threads=[]
161,676 (gdb) 
162,101 31-gdb-exit
162,103 31^exit
Previous Topic:YACQ YET ANOTHER CROSSCOMPILER QUESTIONs
Next Topic:Bug reporting ?
Goto Forum:
  


Current Time: Wed Apr 24 15:56:40 GMT 2024

Powered by FUDForum. Page generated in 0.02867 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top