Author Topic: Debugger  (Read 4476 times)

Offline sorinev

  • Multiple posting newcomer
  • *
  • Posts: 61
Debugger
« on: January 27, 2016, 05:18:41 pm »
Windows 10 x64
Code::Blocks svn 10416
wxWidgets 2.8.12 for Code::Blocks itself; 3.0.2 static for actual projects

I have a wxWidgets 3.0.2 project. wxWidgets is statically built for both release and debug with appropriate information set up for build options. I'm using a wxStyledTextCtrl to build a tabbed text editor style application. I noticed when opening files around 100MB, wxStyledTextCtrl couldn't handle it. So I've tried using wxStyledTextCtrl's allocate method to increase the allocation (I actually can't figure out how to find out what its default allocation size is).

The program crashes, but I can't really see why. So I'm trying to debug it but when it gets to the point of doing wxStyledTextCtrl's AddTextRaw(), the yellow marker for the current line won't move. I press F7 to go to the next line, but nothing happens. When I look at the actual debug menu, all of the debug position-movement options are grayed out except Break Debugger and Stop Debugger - and even when choosing those, nothing happens. In task manager, gdb is bouncing around between 14%-15% CPU usage (8 core) and the memory is bouncing wildly; it'll go from 270MB -> 309MB -> 256MB -> 339MB -> 272MB -> 290MB -> 360MB etc. from one second to the next. After about 10 minutes, the status still hasn't changed. The Code::Blocks debug log window doesn't show anything after the Child process PID line.

I'm not sure if this is just a quirk with large allocations in wxWidgets' wxStyledTextCtrl while debugging, or if gdb is having a problem.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger
« Reply #1 on: January 27, 2016, 09:33:45 pm »
Sounds like a gdb problem.
Have you enabled the full log for the debugger?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sorinev

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: Debugger
« Reply #2 on: January 27, 2016, 10:01:12 pm »
Checking the box at Settings -> Debugger... -> 'Full (Debug) log' produces this. gdb is doing its crazy memory/cpu thing in the background, but the log is just sitting here with nothing more than this the whole time:

Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\wxWidgets-3.0.2\src
Adding source dir: C:\wxWidgets-3.0.2\include\wx
Adding source dir: C:\Users\me\Documents\Projects\LogSearch\
Adding source dir: C:\Users\me\Documents\Projects\LogSearch\
Adding file: C:\Users\me\Documents\Projects\LogSearch\bin\Debug\LogSearch.exe
Changing directory to: C:/Users/me/Documents/Projects/LogSearch/.
Set variable: PATH=.;C:\wxWidgets-3.0.2\lib\gcc_lib\;C:\boost_1_59_0\stage\lib;C:\wxWidgets-3.0.2\lib\gcc_lib;C:\MinGW\bin;C:\MinGW;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files\Dell\DW WLAN Card;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Skype\Phone;C:\zip-2.3-3-bin\bin;C:\Program Files\TortoiseSVN\bin;C:\apache-maven-3.3.3\bin;C:\apache-ant-1.9.6\bin;C:\axis2-1.5.1\bin

[debug]Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/me/Documents/Projects/LogSearch/bin/Debug/LogSearch.exe
[debug]Working dir : C:\Users\me\Documents\Projects\LogSearch

Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/me/Documents/Projects/LogSearch/bin/Debug/LogSearch.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from C:\Users\me\Documents\Projects\LogSearch\bin\Debug\LogSearch.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.6.1
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.6.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\cb_nightly\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/wxWidgets-3.0.2/src
[debug]Source directories searched: C:/wxWidgets-3.0.2/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory C:/wxWidgets-3.0.2/include/wx
[debug]Source directories searched: C:/wxWidgets-3.0.2/include/wx;C:/wxWidgets-3.0.2/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/me/Documents/Projects/LogSearch/
[debug]Source directories searched: C:/Users/me/Documents/Projects/LogSearch;C:/wxWidgets-3.0.2/include/wx;C:/wxWidgets-3.0.2/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:/Users/me/Documents/Projects/LogSearch/bin/Debug/LogSearch.exe

Child process PID: 7112

[debug][New Thread 7112.0x2028]
[debug][New Thread 7112.0x3418]
[debug][New Thread 7112.0x1cd8]
[debug][New Thread 7112.0x3998]
[debug][New Thread 7112.0x3e38]
[debug][New Thread 7112.0x3b20]
[debug][New Thread 7112.0x3ee4]
[debug][New Thread 7112.0x1b94]
[debug][New Thread 7112.0x4124]
[debug][New Thread 7112.0x3c10]
[debug][New Thread 7112.0x164]
[debug][New Thread 7112.0x2310]
[debug][New Thread 7112.0x4b8]
[debug][New Thread 7112.0x1dc0]
[debug][New Thread 7112.0x3948]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger
« Reply #3 on: January 27, 2016, 11:48:13 pm »
In this log the debugger has never stopped at a breakpoint. Is this the case?
Do you have a callstack of the crash?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sorinev

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: Debugger
« Reply #4 on: January 28, 2016, 12:22:30 am »
In this log the debugger has never stopped at a breakpoint. Is this the case?

For the first one, yes.

Here is a log where I point a break point. It doesn't matter though since the only options that aren't grayed out are Break Debugger and Stop Debugger.

Code
Active debugger config: GDB/CDB debugger:Default
Building to ensure sources are up-to-date
Selecting target:
Debug
Adding source dir: C:\wxWidgets-3.0.2\src
Adding source dir: C:\wxWidgets-3.0.2\include\wx
Adding source dir: C:\Users\me\Documents\Projects\LogSearch\
Adding source dir: C:\Users\me\Documents\Projects\LogSearch\
Adding file: C:\Users\me\Documents\Projects\LogSearch\bin\Debug\LogSearch.exe
Changing directory to: C:/Users/me/Documents/Projects/LogSearch/.
Set variable: PATH=.;C:\wxWidgets-3.0.2\lib\gcc_lib\;C:\boost_1_59_0\stage\lib;C:\wxWidgets-3.0.2\lib\gcc_lib;C:\MinGW\bin;C:\MinGW;C:\TDM-GCC-32\bin;C:\TDM-GCC-32;C:\Program Files\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files (x86)\Common Files\Microsoft Shared\Microsoft Online Services;C:\Program Files\Dell\DW WLAN Card;C:\Program Files (x86)\Intel\iCLS Client;C:\Program Files\Intel\iCLS Client;C:\Windows\System32;C:\Windows;C:\Windows\System32\wbem;C:\Windows\System32\WindowsPowerShell\v1.0;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\WIDCOMM\Bluetooth Software;C:\Program Files\WIDCOMM\Bluetooth Software\syswow64;C:\Program Files\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn;C:\Program Files\Microsoft SQL Server\110\Tools\Binn;C:\Program Files (x86)\Microsoft SQL Server\110\Tools\Binn\ManagementStudio;C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\PrivateAssemblies;C:\Program Files (x86)\Microsoft SQL Server\110\DTS\Binn;C:\Program Files (x86)\Skype\Phone;C:\zip-2.3-3-bin\bin;C:\Program Files\TortoiseSVN\bin;C:\apache-maven-3.3.3\bin;C:\apache-ant-1.9.6\bin;C:\axis2-1.5.1\bin

[debug]Command-line: C:\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/me/Documents/Projects/LogSearch/bin/Debug/LogSearch.exe
[debug]Working dir : C:\Users\me\Documents\Projects\LogSearch

Starting debugger: C:\MinGW\bin\gdb.exe -nx -fullname -quiet  -args C:/Users/me/Documents/Projects/LogSearch/bin/Debug/LogSearch.exe
done

[debug]> set prompt >>>>>>cb_gdb:

Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

[debug]Reading symbols from C:\Users\me\Documents\Projects\LogSearch\bin\Debug\LogSearch.exe...
[debug]done.
[debug](gdb) >>>>>>cb_gdb:
[debug]> show version
[debug]GNU gdb (GDB) 7.6.1
[debug]Copyright (C) 2013 Free Software Foundation, Inc.
[debug]License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
[debug]This is free software: you are free to change and redistribute it.
[debug]There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
[debug]and "show warranty" for details.
[debug]This GDB was configured as "mingw32".
[debug]For bug reporting instructions, please see:
[debug]<http://www.gnu.org/software/gdb/bugs/>.
[debug]>>>>>>cb_gdb:
[debug]> set confirm off

Debugger name and version: GNU gdb (GDB) 7.6.1

[debug]>>>>>>cb_gdb:
[debug]> set width 0
[debug]>>>>>>cb_gdb:
[debug]> set height 0
[debug]>>>>>>cb_gdb:
[debug]> set breakpoint pending on
[debug]>>>>>>cb_gdb:
[debug]> set print asm-demangle on
[debug]>>>>>>cb_gdb:
[debug]> set unwindonsignal on
[debug]>>>>>>cb_gdb:
[debug]> set print elements 0
[debug]>>>>>>cb_gdb:
[debug]> set new-console on
[debug]>>>>>>cb_gdb:
[debug]> set disassembly-flavor att
[debug]>>>>>>cb_gdb:
[debug]> catch throw
[debug]Catchpoint 1 (throw)
[debug]>>>>>>cb_gdb:
[debug]> source C:\cb_nightly\share\codeblocks/scripts/stl-views-1.0.3.gdb
[debug]>>>>>>cb_gdb:
[debug]> directory C:/wxWidgets-3.0.2/src
[debug]Source directories searched: C:/wxWidgets-3.0.2/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory C:/wxWidgets-3.0.2/include/wx
[debug]Source directories searched: C:/wxWidgets-3.0.2/include/wx;C:/wxWidgets-3.0.2/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> directory C:/Users/me/Documents/Projects/LogSearch/
[debug]Source directories searched: C:/Users/me/Documents/Projects/LogSearch;C:/wxWidgets-3.0.2/include/wx;C:/wxWidgets-3.0.2/src;$cdir;$cwd
[debug]>>>>>>cb_gdb:
[debug]> break "C:/Users/me/Documents/Projects/LogSearch/LogSearchTab.cpp:353"
[debug]Breakpoint 2 at 0x40a3fd: file C:\Users\me\Documents\Projects\LogSearch\LogSearchTab.cpp, line 353.
[debug]>>>>>>cb_gdb:
[debug]> run
[debug]Starting program: C:/Users/me/Documents/Projects/LogSearch/bin/Debug/LogSearch.exe

Child process PID: 15540

[debug][New Thread 15540.0x2374]
[debug][New Thread 15540.0x534]
[debug][New Thread 15540.0x40dc]
[debug][New Thread 15540.0x2a54]
[debug][New Thread 15540.0x3df0]
[debug][New Thread 15540.0x1c38]
[debug][New Thread 15540.0x33e8]
[debug][New Thread 15540.0x1064]
[debug][New Thread 15540.0x1f98]
[debug][New Thread 15540.0x4204]
[debug][New Thread 15540.0x42e8]
[debug][New Thread 15540.0x3f38]
[debug][New Thread 15540.0x3d38]
[debug][New Thread 15540.0x40d8]
[debug][New Thread 15540.0x334c]
[debug][New Thread 15540.0x4214]
[debug]Breakpoint 2, LogSearchTab::OpenFile (this=0xa069ad8, filename=...) at C:\Users\me\Documents\Projects\LogSearch\LogSearchTab.cpp:353
[debug]C:\Users\me\Documents\Projects\LogSearch\LogSearchTab.cpp:353:13305:beg:0x40a3fd
[debug]>>>>>>cb_gdb:

At C:\Users\me\Documents\Projects\LogSearch\LogSearchTab.cpp:353

[debug]> info locals
[debug]file = {
[debug]  m_volume = {
[debug]    static npos = 4294967295,
[debug]    m_impl = {
[debug]      static npos = 4294967295,
[debug]      _M_dataplus = {
[debug]        <std::allocator<wchar_t>> = {
[debug]          <__gnu_cxx::new_allocator<wchar_t>> = {<No data fields>}, <No data fields>},
[debug]        members of std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Alloc_hider:
[debug]        _M_p = 0xa0819d4 L"C"
[debug]      }
[debug]    },
[debug]    m_convertedToChar = {
[debug]      m_str = 0x0,
[debug]      m_len = 0
[debug]    }
[debug]  },
[debug]  m_dirs = {
[debug]    m_nSize = 16,
[debug]    m_nCount = 5,
[debug]    m_pItems = 0xa07d3d4,
[debug]    m_autoSort = false
[debug]  },
[debug]  m_name = {
[debug]    static npos = 4294967295,
[debug]    m_impl = {
[debug]      static npos = 4294967295,
[debug]      _M_dataplus = {
[debug]        <std::allocator<wchar_t>> = {
[debug]          <__gnu_cxx::new_allocator<wchar_t>> = {<No data fields>}, <No data fields>},
[debug]        members of std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Alloc_hider:
[debug]        _M_p = 0xa0886f4 L"server.log.2015-12-15"
[debug]      }
[debug]    },
[debug]    m_convertedToChar = {
[debug]      m_str = 0x0,
[debug]      m_len = 168180656
[debug]    }
[debug]  },
[debug]  m_ext = {
[debug]    static npos = 4294967295,
[debug]    m_impl = {
[debug]      static npos = 4294967295,
[debug]      _M_dataplus = {
[debug]        <std::allocator<wchar_t>> = {
[debug]          <__gnu_cxx::new_allocator<wchar_t>> = {<No data fields>}, <No data fields>},
[debug]        members of std::basic_string<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> >::_Alloc_hider:
[debug]        _M_p = 0xa07cc94 L"log"
[debug]      }
[debug]    },
[debug]    m_convertedToChar = {
[debug]      m_str = 0x0,
[debug]      m_len = 2749444
[debug]    }
[debug]  },
[debug]  m_relative = false,
[debug]  m_hasExt = true,
[debug]  m_dontFollowLinks = false
[debug]}
[debug]size = 156054864

Do you have a callstack of the crash?

Getting a callstack is exactly what I was trying to do so that I could see why I can't load large files (50MB works, 100MB crashes), since it does crash in release mode. It also crashes in debug mode when I run it (as in ctrl+F10). In both build modes, it crashes with just a generic windows "this stopped working" message box. In debug mode though (F8), it never crashes. It just stops working basically, with the aforementioned gdb behavior.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: Debugger
« Reply #5 on: January 28, 2016, 09:26:45 am »
Disable locals and function arguments and it should fix the problem.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline sorinev

  • Multiple posting newcomer
  • *
  • Posts: 61
Re: Debugger
« Reply #6 on: January 29, 2016, 04:42:22 pm »
There was no difference. I guess it'd be better to simply ask over on the wxWidgets forums how I can get a wxStyledTextCtrl to open files bigger than ~100ish MB. The debugger and debugging functionality otherwise work fine in other circumstances.