Debugging stops when single step std::endl is hit.
Posted: Sun Oct 25, 2015 11:45 pm
Hello, I have a problem when debugging c++ code. The debugger crashes when I set a breakpoint before any line containing std::endl and then single stepping to that line. For example, if I set a breakpoint in line 5 of this code and then step to line 6, when I try to keep single stepping the debugger stops.
Code:
Information:
OS: Windows 10
Codelite Version: 9.0.1 (not self compiled)
Compiler: TDM-GCC For windows, GCC 5 series.
Debugger: GDB 7.9 MinGW-w64 64-bit Edition
Debugger Log
Tell me if I missed something, and thank you very much for your help.
Code:
Code: Select all
#include <iostream>
int main(int argc, char **argv)
{
std::string t = "Test";
std::cout << t << std::endl;
return 0;
}
OS: Windows 10
Codelite Version: 9.0.1 (not self compiled)
Compiler: TDM-GCC For windows, GCC 5 series.
Debugger: GDB 7.9 MinGW-w64 64-bit Edition
Debugger Log
Code: Select all
Using gdbinit file: C:\Users\Emilio\AppData\Local\Temp\codelite_gdbinit.txt
Current working dir: C:\Users\Emilio\Dropbox\Carrera\QuintoSemestre\Algoritmos\Codigo\ProblemaPractico2\endl
Launching gdb from : ./Debug
Starting debugger : C:/TDM-GCC-64/bin/gdb.exe --command="C:\Users\Emilio\AppData\Local\Temp\codelite_gdbinit.txt" --interpreter=mi "./endl"
DEBUG>>set new-console on
DEBUG>>set unwindonsignal on
DEBUG>>set breakpoint pending on
DEBUG>>set width 0
DEBUG>>set height 0
DEBUG>>set print elements 200
DEBUG>>python
DEBUG>>import sys
DEBUG>>sys.path.insert(0, 'C:\Users\Emilio\AppData\Roaming\codelite\gdb_printers')
DEBUG>>from libstdcxx.v6.printers import register_libstdcxx_printers
DEBUG>>register_libstdcxx_printers (None)
DEBUG>>from qt4 import register_qt4_printers
DEBUG>>register_qt4_printers (None)
DEBUG>>from wx import register_wx_printers
DEBUG>>register_wx_printers (None)
DEBUG>>from boost.printers import register_printer_gen
DEBUG>>register_printer_gen(None)
DEBUG>>end
DEBUG>>00000522-break-insert -f -t main
Debug session started successfully!
DEBUG>>00000523-exec-arguments
DEBUG>>00000524-exec-run
DEBUG>>=thread-group-added,id="i1"
=thread-group-added,id="i1"
DEBUG>>~"GNU gdb (GDB) 7.9.1\n"
GNU gdb (GDB) 7.9.1
DEBUG>>~"Copyright (C) 2015 Free Software Foundation, Inc.\n"
Copyright (C) 2015 Free Software Foundation, Inc.
DEBUG>>~"License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type \"show copying\"\nand \"show warranty\" for details.\n"
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\nThis is free software: you are free to change and redistribute it.\nThere is NO WARRANTY, to the extent permitted by law. Type "show copying"\nand "show warranty" for details.
DEBUG>>~"This GDB was configured as \"x86_64-w64-mingw32\".\nType \"show configuration\" for configuration details."
This GDB was configured as "x86_64-w64-mingw32".\nType "show configuration" for configuration details.
DEBUG>>~"\nFor bug reporting instructions, please see:\n"
\nFor bug reporting instructions, please see:
DEBUG>>~"<http://www.gnu.org/software/gdb/bugs/>.\n"
<http://www.gnu.org/software/gdb/bugs/>.
DEBUG>>~"Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.\n"
Find the GDB manual and other documentation resources online at:\n<http://www.gnu.org/software/gdb/documentation/>.
DEBUG>>~"For help, type \"help\".\n"
For help, type "help".
DEBUG>>~"Type \"apropos word\" to search for commands related to \"word\"...\n"
Type "apropos word" to search for commands related to "word"...
DEBUG>>~"Reading symbols from ./endl..."
Reading symbols from ./endl...
DEBUG>>~"done.\n"
done.
DEBUG>>&"Traceback (most recent call last):\n"
DEBUG>>&" File \"<string>\", line 5, in <module>\n"
DEBUG>>&" File \"C:\\Users\\Emilio\\AppData\\Roaming\\codelite\\gdb_printers\\libstdcxx\\v6\\printers.py\", line 1023, in register_libstdcxx_printers\n"
DEBUG>>&" gdb.printing.register_pretty_printer(obj, libstdcxx_printer)\n"
DEBUG>>&" File \"c:\\tdm-gcc-64\\gdb64\\share\\gdb/python\\gdb\\printing.py\", line 152, in register_pretty_printer\n"
DEBUG>>&" printer.name)\n"
DEBUG>>&"RuntimeError: pretty-printer already registered: libstdc++-v6\n"
DEBUG>>&"C:\\Users\\Emilio\\AppData\\Local\\Temp\\codelite_gdbinit.txt:17: Error in sourced command file:\n"
DEBUG>>&"Error while executing Python code.\n"
DEBUG>>&"set new-console on\n"
DEBUG>>=cmd-param-changed,param="new-console",value="on"
=cmd-param-changed,param="new-console",value="on"
DEBUG>>^done
DEBUG>>&"set unwindonsignal on\n"
DEBUG>>=cmd-param-changed,param="unwindonsignal",value="on"
=cmd-param-changed,param="unwindonsignal",value="on"
DEBUG>>^done
DEBUG>>&"set breakpoint pending on\n"
DEBUG>>=cmd-param-changed,param="breakpoint pending",value="on"
=cmd-param-changed,param="breakpoint pending",value="on"
DEBUG>>^done
DEBUG>>&"set width 0\n"
DEBUG>>=cmd-param-changed,param="width",value="4294967295"
=cmd-param-changed,param="width",value="4294967295"
DEBUG>>^done
DEBUG>>&"set height 0\n"
DEBUG>>^done
DEBUG>>&"set print elements 200\n"
DEBUG>>^done
DEBUG>>&"python\n"
DEBUG>>&"Traceback (most recent call last):\n"
DEBUG>>&" File \"<string>\", line 4, in <module>\n"
DEBUG>>&" File \"C:\\Users\\Emilio\\AppData\\Roaming\\codelite\\gdb_printers\\libstdcxx\\v6\\printers.py\", line 1023, in register_libstdcxx_printers\n"
DEBUG>>&" gdb.printing.register_pretty_printer(obj, libstdcxx_printer)\n"
DEBUG>>&" File \"c:\\tdm-gcc-64\\gdb64\\share\\gdb/python\\gdb\\printing.py\", line 152, in register_pretty_printer\n"
DEBUG>>&" printer.name)\n"
DEBUG>>&"RuntimeError: pretty-printer already registered: libstdc++-v6\n"
DEBUG>>&"Error while executing Python code.\n"
DEBUG>>^error,msg="Error while executing Python code."
^error,msg="Error while executing Python code."
DEBUG>>00000522^done,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="0",original-location="main"}
Storing internal breakpoint ID=1
DEBUG>>00000523^done
>> Debuggee process ID: 103768
DEBUG>>=thread-group-started,id="i1",pid="103768"
=thread-group-started,id="i1",pid="103768"
DEBUG>>=thread-created,id="1",group-id="i1"
=thread-created,id="1",group-id="i1"
DEBUG>>~"[New Thread 103768.0x1a374]\n"
[New Thread 103768.0x1a374]
DEBUG>>00000524^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>=library-loaded,id="C:\\WINDOWS\\SYSTEM32\\ntdll.dll",target-name="C:\\WINDOWS\\SYSTEM32\\ntdll.dll",host-name="C:\\WINDOWS\\SYSTEM32\\ntdll.dll",symbols-loaded="0",thread-group="i1"
=library-loaded,id="C:\\WINDOWS\\SYSTEM32\\ntdll.dll",target-name="C:\\WINDOWS\\SYSTEM32\\ntdll.dll",host-name="C:\\WINDOWS\\SYSTEM32\\ntdll.dll",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="C:\\WINDOWS\\system32\\kernel32.dll",target-name="C:\\WINDOWS\\system32\\kernel32.dll",host-name="C:\\WINDOWS\\system32\\kernel32.dll",symbols-loaded="0",thread-group="i1"
=library-loaded,id="C:\\WINDOWS\\system32\\kernel32.dll",target-name="C:\\WINDOWS\\system32\\kernel32.dll",host-name="C:\\WINDOWS\\system32\\kernel32.dll",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="C:\\WINDOWS\\system32\\KernelBase.dll",target-name="C:\\WINDOWS\\system32\\KernelBase.dll",host-name="C:\\WINDOWS\\system32\\KernelBase.dll",symbols-loaded="0",thread-group="i1"
=library-loaded,id="C:\\WINDOWS\\system32\\KernelBase.dll",target-name="C:\\WINDOWS\\system32\\KernelBase.dll",host-name="C:\\WINDOWS\\system32\\KernelBase.dll",symbols-loaded="0",thread-group="i1"
DEBUG>>=library-loaded,id="C:\\WINDOWS\\system32\\msvcrt.dll",target-name="C:\\WINDOWS\\system32\\msvcrt.dll",host-name="C:\\WINDOWS\\system32\\msvcrt.dll",symbols-loaded="0",thread-group="i1"
=library-loaded,id="C:\\WINDOWS\\system32\\msvcrt.dll",target-name="C:\\WINDOWS\\system32\\msvcrt.dll",host-name="C:\\WINDOWS\\system32\\msvcrt.dll",symbols-loaded="0",thread-group="i1"
DEBUG>>=thread-created,id="2",group-id="i1"
=thread-created,id="2",group-id="i1"
DEBUG>>~"[New Thread 103768.0x1a2e4]\n"
[New Thread 103768.0x1a2e4]
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="1",original-location="main"}
=breakpoint-modified,bkpt={number="1",type="breakpoint",disp="del",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="1",original-location="main"}
DEBUG>>~"\nTemporary breakpoint "
\nTemporary breakpoint
DEBUG>>~"1, main (argc=1, argv=0x2d14c0) at C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5\n"
1, main (argc=1, argv=0x2d14c0) at C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5
DEBUG>>~"5\t\tstd::string t = \"Test\";\n"
5\t\tstd::string t = "Test";
DEBUG>>*stopped,reason="breakpoint-hit",disp="del",bkptno="1",frame={addr="0x00000000004015ca",func="main",args=[{name="argc",value="1"},{name="argv",value="0x2d14c0"}],file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5"},thread-id="1",stopped-threads="all"
Internal breakpoint was hit (id=1), Applying user breakpoints and continuing
DEBUG>>00000525-break-insert -f "\"C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5\""
DEBUG>>00000526-file-list-exec-source-file
DEBUG>>00000527-break-list
DEBUG>>=breakpoint-deleted,id="1"
=breakpoint-deleted,id="1"
DEBUG>>00000525^done,bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="0",original-location="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5"}
Found the breakpoint ID!
Storing debugger breakpoint Id=2
Successfully set breakpoint 2 at: C:\Users\Emilio\Dropbox\Carrera\QuintoSemestre\Algoritmos\Codigo\ProblemaPractico2\endl\main.cpp:5
DEBUG>>00000526^done,line="5",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",macro-info="0"
DEBUG>>00000527^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="0",original-location="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5"}]}
DEBUG>>00000528-exec-next
DEBUG>>00000528^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>*stopped,reason="end-stepping-range",frame={addr="0x00000000004015fc",func="main",args=[{name="argc",value="1"},{name="argv",value="0x2d14c0"}],file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="6"},thread-id="1",stopped-threads="all"
DEBUG>>00000529-file-list-exec-source-file
DEBUG>>00000530-break-list
DEBUG>>00000529^done,line="6",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",macro-info="0"
DEBUG>>00000530^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="0",original-location="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5"}]}
DEBUG>>00000531-exec-next
DEBUG>>00000531^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>*stopped,reason="end-stepping-range",frame={addr="0x000000000046c9d0",func="std::ostream::operator<<(std::ostream& (*)(std::ostream&))",args=[]},thread-id="1",stopped-threads="all"
DEBUG>>00000532-file-list-exec-source-file
DEBUG>>00000533-break-list
DEBUG>>00000532^done,line="6",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",macro-info="0"
DEBUG>>00000533^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="0",original-location="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5"}]}
DEBUG>>00000534-exec-next
DEBUG>>~"Single stepping until exit from function _ZNSolsEPFRSoS_E,\nwhich has no line number information.\n"
Single stepping until exit from function _ZNSolsEPFRSoS_E,\nwhich has no line number information.
DEBUG>>00000534^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>*stopped,reason="end-stepping-range",frame={addr="0x00000000004a0540",func="std::basic_ostream<char, std::char_traits<char> >& std::endl<char, std::char_traits<char> >(std::basic_ostream<char, std::char_traits<char> >&)",args=[]},thread-id="1",stopped-threads="all"
DEBUG>>00000535-file-list-exec-source-file
DEBUG>>00000536-break-list
DEBUG>>00000535^done,line="6",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",macro-info="0"
DEBUG>>00000536^done,BreakpointTable={nr_rows="1",nr_cols="6",hdr=[{width="7",alignment="-1",col_name="number",colhdr="Num"},{width="14",alignment="-1",col_name="type",colhdr="Type"},{width="4",alignment="-1",col_name="disp",colhdr="Disp"},{width="3",alignment="-1",col_name="enabled",colhdr="Enb"},{width="18",alignment="-1",col_name="addr",colhdr="Address"},{width="40",alignment="2",col_name="what",colhdr="What"}],body=[bkpt={number="2",type="breakpoint",disp="keep",enabled="y",addr="0x00000000004015ca",func="main(int, char**)",file="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp",fullname="C:\\Users\\Emilio\\Dropbox\\Carrera\\QuintoSemestre\\Algoritmos\\Codigo\\ProblemaPractico2\\endl\\main.cpp",line="5",thread-groups=["i1"],times="0",original-location="C:/Users/Emilio/Dropbox/Carrera/QuintoSemestre/Algoritmos/Codigo/ProblemaPractico2/endl/main.cpp:5"}]}
DEBUG>>00000537-exec-next
DEBUG>>~"Single stepping until exit from function _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_,\nwhich has no line number information.\n"
Single stepping until exit from function _ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_,\nwhich has no line number information.
DEBUG>>00000537^running
Continuing...
DEBUG>>*running,thread-id="all"
*running,thread-id="all"
DEBUG>>00000538-exec-next
DEBUG>>00000539-exec-next
DEBUG>>00000540-exec-next