Author Topic: debugging and stepping into code question  (Read 3052 times)

Offline adviner

  • Single posting newcomer
  • *
  • Posts: 3
debugging and stepping into code question
« on: February 25, 2007, 03:24:47 am »
Hi All,
  I'm using nightly build code blocks on windows xp.  I'm using gtkmm for windows.  The problem i have is stepping to the code or stopping it at a breakpoint on the class constructor.  Example:

Main code:

int main(int argc, char *argv[])
{


    Gtk::Main kit(argc, argv);
    Glib::RefPtr<Gnome::Glade::Xml> refXML = Gnome::Glade::Xml::create("C:\\CDeveloper\\Projects\\FinancialMatters\\Bin\\FinancialMatters.glade");

    FinancialMatters financialMatters(refXML);
    kit.run();
..
}

I can stop at the line FinancialMatters but when i try to step into the constructor i get the header refptr.h.  So i though i with a breakpoint on the FinancialMatters constructor i just select debug/continue but it never gets to it

FinancialMatters::FinancialMatters(Glib::RefPtr<Gnome::Glade::Xml> ref_xml)
{
    try
    {
        _Properties = new Properties();
    }
    catch(...)
    {
    }
}

I even put a breakpoint in the initialization of the Properties() class but it never hits it.  That is all my application does nothing more.  I'm just trying to get to the point where i can step into the code when debugging.

Is there something wrong with the way i'm debugging? 

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2286
Re: debugging and stepping into code question
« Reply #1 on: February 25, 2007, 04:32:12 am »
   //-- Debugging
    Debugging with CodeBlocks

Offline adviner

  • Single posting newcomer
  • *
  • Posts: 3
Re: debugging and stepping into code question
« Reply #2 on: February 25, 2007, 06:40:58 am »
Thanks Pecan,
  I actually found this site earlier.  The problem is not being able to debug b/c i can do it fine.  The problem is stepping into the FinancialMatters constructor doesnt seem to work with the examples from my original post.

Thanks

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2286
Re: debugging and stepping into code question
« Reply #3 on: February 25, 2007, 02:20:40 pm »
As the example states: gdb cannot honor a break in a constructor/destructor.
It cannot tell which of the many constructors (there are many ctor/dtors with the same name, virtual etc) the user will step into or place a break.

Please re-read the work-around at the bottom of the wiki article.
« Last Edit: February 25, 2007, 02:22:54 pm by Pecan »

Offline adviner

  • Single posting newcomer
  • *
  • Posts: 3
Re: debugging and stepping into code question
« Reply #4 on: February 25, 2007, 07:14:50 pm »
I appreciate that.  I totally missed that part of the constructor.

Thanks again for the quick response.