Hi, yesterday, I have found a new way to support the gdb debugging in cb. Here is the brief introduction.
GDB with Python supportIf we add another python wxStuff support, note that the original file is:
wxStuff support python scriptIf you use wxWidgets 2.8.x version, you need to change this py file to some thin like:
class wxStringPrinter:
def __init__(self, val):
self.val = val
def to_string(self):
return self.val['m_pchData'].string()
#return '"' + self.val['m_impl']['_M_dataplus']['_M_p'].string() + '"'
def display_hint(self):
return 'string'
Note that, if you use 2.9.x version of wxWidgets, you can use the original py script. More details can be found in:
wxBlog: Pretty printing wxStuff in gdbTo load both the stl_print and wx_print python scirpt, I create a my.gdb file, like:
python
import sys
sys.path.insert(0, 'C:\stl_python')
from libstdcxx.v6.printers import register_libstdcxx_printers
register_libstdcxx_printers (None)
execfile("f:/cb/wx_print.py")
end
Then, I suggest that you don't need the gdb.script to register several types, so, it is saft to comment them, because python scirpt works better!!!
Open the file like F:\cb\cb_ccbranch\src\output\share\CodeBlocks\scripts\gdb_types.script
Then, comment the file like:
// Registers new types with driver
function RegisterTypes(driver)
{
// signature:
// driver.RegisterType(type_name, regex, eval_func, parse_func);
// wxString
// driver.RegisterType(
// _T("wxString"),
// _T("[^[:alnum:]_]*wxString[^[:alnum:]_]*"),
// _T("Evaluate_wxString"),
// _T("Parse_wxString")
// );
// STL String
// driver.RegisterType(
// _T("STL String"),
// _T("[^[:alnum:]_]*string[^[:alnum:]_]*"),
// _T("Evaluate_StlString"),
// _T("Parse_StlString")
// );
// STL Vector
// driver.RegisterType(
// _T("STL Vector"),
// _T("[^[:alnum:]_]*vector<.*"),
// _T("Evaluate_StlVector"),
// _T("Parse_StlVector")
// );
Log(_T("Registering types for the debugger."));
}
And finally, you need to add the gdb scirpt file in the debugger starting command, like:

That's all, you can enjoying debugging!!!
