Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Plugins development => Topic started by: dmoore on April 22, 2013, 03:53:08 am

Title: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: dmoore on April 22, 2013, 03:53:08 am
Having some problems with breakpoints in my python debugger plugin. I can add them with a right click in the margin. But if I click the margin again to toggle it off nothing happens (The DeleteBreakpoint method of the python debugger plugin doesn't get called). I can open the breakpoint dialog and remove the dialogs that way, but the editor doesn't update the change (I can force an update of the editor by switching the active debugger). Any idea what might be the problem here?  Suspect I have registered either the plugin or the breakpoints incorrectly...

SVN is here (http://developer.berlios.de/svn/?group_id=7745) or browse the code  here (http://svn.berlios.de/wsvn/cbilplugin/trunk/PythonDebugger/?#a5f9c838514349797f0b0b1317bc01c4a) specifically this file (http://svn.berlios.de/wsvn/cbilplugin/trunk/PythonDebugger/PyDebugger.cpp). The best way to see what is going on is to install the plugin and test it out adding/removing breakpoints on a python script.
Title: Re: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: dmoore on April 22, 2013, 06:33:11 pm
d'oh! fixed in my SVN (http://svn.berlios.de/wsvn/cbilplugin?manualorder=1&op=comp&compare%5B0%5D=%2Ftrunk&compare_rev%5B0%5D=413&compare%5B1%5D=%2Ftrunk&compare_rev%5B1%5D=414&comparesubmit=Compare+Paths)
Title: Re: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: oBFusCATed on April 22, 2013, 06:43:06 pm
Hm, I should have posted a comment, but I don't see it, have I? :(
Title: Re: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: dmoore on April 22, 2013, 08:42:03 pm
I didn't see anything. ??? Anyway, problem solved by debugging C::B  from C::B with GDB :)
Title: Re: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: oBFusCATed on April 22, 2013, 08:55:27 pm
Yeah, because I was too sleepy to post this:
Quote
Change:
bool IsVisibleInEditor()const  {return false;}
to
bool IsVisibleInEditor()const  {return true;}

You should return false only if the breakpoint is temporary.

Also I don't think you need this code in AddBreakpoint:
Code
    for (BPList::iterator itr=m_bplist.begin(); itr!=m_bplist.end(); ++itr)
    {
        if((*itr)->GetLocation()==file && (*itr)->GetLine()==line)
            return cb::shared_ptr<cbBreakpoint>();
    }
Title: Re: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: dmoore on April 22, 2013, 09:11:07 pm
Also I don't think you need this code in AddBreakpoint:
Code
    for (BPList::iterator itr=m_bplist.begin(); itr!=m_bplist.end(); ++itr)
    {
        if((*itr)->GetLocation()==file && (*itr)->GetLine()==line)
            return cb::shared_ptr<cbBreakpoint>();
    }

paranoia (wasn't sure if it was possible to ask to add a breakpoint already added). I will remove. Thanks for looking!
Title: Re: For oBFusCATed... breakpoint issue when with python debugger plugin
Post by: oBFusCATed on April 22, 2013, 09:36:29 pm
paranoia (wasn't sure if it was possible to ask to add a breakpoint already added). I will remove. Thanks for looking!
If it happens, then it is a bug upstream...