Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
debugging plugin
DoMeN:
Hi,
I'm implementing hw breakpoints in C::B and it would save me lots of time if someone could tell me:
- Which function of debugging plugin is the top function that is connected to C::B and where in C::B it is called.
- Allso I would need to know which function does the drawing of the breakpoint circles and where is the mouse event function that calls the draw circle function.
thanks
Domen
dje:
Hi !!
--- Quote ---- Allso I would need to know which function does the drawing of the breakpoint circles and where is the mouse event function that calls the draw circle function.
--- End quote ---
The cbEditor manages margin clicks events.
Let's have a look at :
void cbEditor::ToggleBreakpoint(int line, bool notifyDebugger)
and
void cbEditor::OnMarginClick(wxScintillaEvent& event)
in CodeBlocks\src\sdk\cbeditor.cpp
Dje
dmoore:
--- Quote from: DoMeN on December 07, 2006, 03:49:00 pm ---- Which function of debugging plugin is the top function that is connected to C::B and where in C::B it is called.
--- End quote ---
not sure what you mean by "top function". base class?
look at debuggergdb.h in the src/plugins/debuggergdb folder - debuggergdb is inherited from a cbdebuggerplugin class that contains virtual overrides for handling add/remove breakpoints and syncing with editor changes. handlers for user requests to start, stop, move to the next instruction are also handled by this class (albeit delegated to other classes to do the actual work). when the plugin is initialized, the plugin mgr will call onAttach, so you could do some initialization here.
The best advice I can give you is to read through the debugger plugin's code and the relevant sdk code starting from the relevant event handlers. right click "find implementation of..." works like a charm
--- Quote ---- Allso I would need to know which function does the drawing of the breakpoint circles and where is the mouse event function that calls the draw circle function.
--- End quote ---
good luck with this. As dje said, Breakpoint markings are handled by the cbEditor. You can get a handle to a particular editor window to pass it messages to add/remove breakpoints. AFAIK there is no way to customize the breakpoint tags without messing with the sdk, which you really don't want to do unless you do it in a sufficiently flexible and useful way that others would find it useful too. I think the big kahuna has plans to enhance the debugger portion of the sdk to make it a little more flexible. allowing for unique markers for different breakpoint types might be something you could request as part of this enhancement.
Joerg:
--- Quote from: DoMeN on December 07, 2006, 03:49:00 pm ---I'm implementing hw breakpoints in C::B and ...
--- End quote ---
Ah, thats interesting.
I still wonder if C::B works for embedded debugging.
I have some success with ARM7 cross-compiling -debugging
with Eclipse,WinARM, OpenOCD.
I think Eclipse with Embedded CDT doesn't know also
about the two hardware breakpoints limit of JTAG (ARM7).
You just get errors if you try to assign more.
I think this is the current behavior of C::B ,too?
Greets,
Joerg
DoMeN:
I just renamed break to hbreak and set a counter to prevent you from setting more HW breakpoints than the implementation allows and if you reach the maximum you have to clear a breakpoint to set a new one. I also had to change the output parsing a bit so that ti treats hbreak as a breakpoint. This works fine but I was told that we need HW and SW breakpoints and here I'm having some problems because they have to be different colors to destinguish between them and you have to be able to select which one of them you want to set.
EDIT: C::B doesnt support HW breakpoints: http://forums.codeblocks.org/index.php?topic=4642.0
Navigation
[0] Message Index
[#] Next page
Go to full version