User forums > Using Code::Blocks

A way to see wxString of wxWidgets 2.9.2 with gdb ?

(1/2) > >>

Feneck91:
Hello.

Since I began to work with wxWidgets 2.9.2 I cannot see wxString with the gdb debugger, it was working with wxWidgets 2.8.x but wxString code has changed and the gdb_types.script is not working with this new wxString code.

I have tryed to modify gdb_types.script but for the moment, I cannot found a way to make it work.
Any idea ?

ollydbg:
The best way should use a python enabled gdb, and use the pretty printer for wxString script.
Note the wx pretty printer should be available from:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/misc/gdb/print.py

see below as a reference:
http://code.google.com/p/qp-gcc/wiki/GDB
http://wxwidgets.blogspot.com/2009/01/pretty-printing-wxstuff-in-gdb.html

also, As I know, pcx's 4.6.1 mingw has the latest gdb
http://code.google.com/p/pcxprj/downloads/list

Feneck91:
It's seems to be a litle bit more complex that I could read.
The video http://people.redhat.com/ebachalo/video/archer-pretty-printing-no-audio.swf is no more avalaible.
In downloaded file stdcxx_and_wx_pythonscript.7z, when I decompress, in wx folder I can see libwx\v28\: is this files are really working with wxWidgets 2.9 ?
I use gdb 7.2, should I use C:\MinGW\bin\gdb.exe or C:\MinGW\bin\gdb-python27.exe as debugger ?
gdb-python27.exe cannot be run because python dll is missing, so I have download and install python-2.7.2.msi here,  gdb-python27.exe could now be run.
In settings/compiler and debugger/debugger settings I put 2 lines :

--- Quote ---source C:\MinGW\bin\stl.gdb
source C:\MinGW\bin\wx.gdb
--- End quote ---

Where should I put the file print.py ?

Will test and try to make it work. Will edit this message each time I'll make a step to explain exactly what I need to do to make it work.

ollydbg:

--- Quote from: Feneck91 on July 27, 2011, 03:30:09 pm ---In downloaded file stdcxx_and_wx_pythonscript.7z, when I decompress, in wx folder I can see libwx\v28\: is this files are really working with wxWidgets 2.9 ?

--- End quote ---
I have never used wx 2.9, so I can't say much, as I said before, you need the wx python script from the wx trunk:
http://svn.wxwidgets.org/viewvc/wx/wxWidgets/trunk/misc/gdb/print.py
I suggest you can just put the contents of the print.py to PathToYourMinGw\bin\libwx\v28\printers.py

the last change is just use pcx's new 4.6.1 packages. and put the code:


--- Code: ---source $(TARGET_COMPILER_DIR)bin\stl.gdb
source $(TARGET_COMPILER_DIR)bin\wx.gdb
--- End code ---
in your c::b's debugger's initial command edit control.

Feneck91:
When I load gdb-python27.exe in place of gdb.exe (in toolchain executable) it seems to change some things.
One example : on breakpoint in "bool wxXmlResource::Load(const wxString& filemask_)"

--- Code: ---bool wxXmlResource::Load(const wxString& filemask_)
{
    wxString filemask = ConvertFileNameToURL(filemask_);

    bool allOK = true;

#if wxUSE_FILESYSTEM
    wxFileSystem fsys;
#   define wxXmlFindFirst  fsys.FindFirst(filemask, wxFILE)
#   define wxXmlFindNext   fsys.FindNext()
#else
#   define wxXmlFindFirst  wxFindFirstFile(filemask, wxFILE)
#   define wxXmlFindNext   wxFindNextFile()
#endif
    wxString fnd = wxXmlFindFirst;
    if ( fnd.empty() )
    {
        wxLogError(_("Cannot load resources from '%s'."), filemask);
        return false;
    }
--- End code ---
With tooltip on filemask_ indicate "m_impl = L<error reading variable>"
Tooltip on filemask indicate "No symbol "wxStringData" in current context"
Two wxString that not indicate the same thing, strange.
In debugger (add watch) filemask_ indicate : Attemps to take contents of a non-pointer value.
In debugger (add watch) filemask indicate : "" and it is not true.
 If I run GDB in place of gdb-python27.exe, the tooltip of filemask_ indicate the expand of all the class.

For the moment, it don't work !  :(
I'm sure some other developpers have already test and make debug with wxWidgets 2.9.x under gdb/CodeBlocks, or I am alone in the earth ?

print.py is automatically loaded ? Strange, I don't understand how it is loaded.

Navigation

[0] Message Index

[#] Next page

Go to full version