r5 - 28 Mar 2007 - 13:20:31 - DanSteinickeYou are here: OSAF >  Journal Web  >  ContributorNotes > DanSteinicke > DanSteinicke200703241

Debugging using MSVC

make sure you have gettext and gettext-devel installed in your cygwin http://wiki.osafoundation.org/bin/view/Projects/BuildingGettext

open cygwin

Start out by checking out internal, external, wx,

  • internal and external can be gotten with:
    • svn checkout svn+ssh://svn.osafoundation.org/svn/chandler/trunk full
  • then cd into full and
  • wx can be gotten with:
    • svn+ssh://svn.osafoundation.org/svn/wx wx

cd to full/external:

make sure BUILD_ROOT is set up

  • cd full/external
  • export BUILD_ROOT=`pwd` (yes, external is part of the BUILD_ROOT var)

make compilers
make env
make realclean

make DEBUG=1 to-python

This will build you a fresh copy of python. Now suppose you just want to make some incremental changes to the C++ files in wxWidgets and run/debug them in Chandler.

cd to full/wx/trunk
make DEBUG=1

Open ./wx/trunk/build/msw/wx_osaf.sln in Visual Studio. Build "DLL Unicode Debug" in the IDE. The first build always builds everything for some reason I don't understand. However, if you change a file and build again only the affected piece gets rebuilt and the build is quick.

When you're ready to run in Chandler open cygwin and cd to osaf/internal/wx and type

make DEBUG=1 installDLLs;make DEBUG=1 snap;make DEBUG=1 drop

I don't have directory internals/wx I ask bear and he suggests doing: make DEBUG=1 build binaries install in external/wx

Running Chandler debug now uses the widgets dlls build by Visual Studio. If you run Wing and put a breakpoint somewhere, when it stops you can go back to Visual Studio and choose Debug menu, Processes. Choose python_d.exe in the list and click attach. Now you can set a breakpoint in Visual Studio. Continue in Wing and you'll stop at your breakpoint in Visual Studio.

Turn around time for changing a file, building and debugging is very reasonable.

Caveats: the OSAF makefile doesn't handle dependencies to .i files and neither does clean or realclean, so if you make a change to a .i file, or if you update your .i files you need delete the dependencies. If you want to be safe you should delete everything under internal/wx/wxPython/src/msw (or gtk or mac) and any msw|gtk|mac dirs under wx/wxPython/contrib, as well as files in wx/wxPython/wx (but not subdirs)

Also if you make changes to a .i file and need to SWIG, you'll need to run the OSAF makefile since the Visual Studio project files won't build them.

Andi's suggestion:

  • "make DEBUG=1" in internal and external
followed by
  • "make DEBUG=1 binaries drops" in internal and external
Edit | WYSIWYG | Attach | Printable | Raw View | Backlinks: Web, All Webs | History: r5 < r4 < r3 < r2 < r1 | More topic actions
 
Open Source Applications Foundation
Except where otherwise noted, this site and its content are licensed by OSAF under an Creative Commons License, Attribution Only 3.0.
See list of page contributors for attributions.