News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

how to modify the plugin debugger

Started by jibimily, June 02, 2011, 11:09:45 AM

Previous topic - Next topic

jibimily

I do not know how to modify the exsiting plugin in windows platform
Now,I setup the codeblock-mingw binary on windows in D:/CodeBlock, then donwload the source code and wxwidgets.
for example:I modify the plugin


debuggergdb.cpp:
void DebuggerGDB::Step()
{
   cbMessageBox(_("This is my first Plugin test program"), _("Info"), wxICON_QUESTION);
   RunCommand(CMD_STEPIN);
}

then complie the CodeBlocks.cbp in source code, then copy the devel/libcodeblocks.a and libwxscintilla.a to D:/CodeBlock
and copy src:"share\CodeBlocks\plugins\debugger.dll" to "D:\CodeBlocks\share\CodeBlocks\plugins", repalce it

then restart CodeBlocks, the Message
"One or more plugins were not loaded.this usually happens when a plugin is built for a differnt vsersion of the Code:Blocks SDK.Check the application log for more info.List of failed plugins:debugger.dll"


I really do not konw how to development plugin in windows,please help me !

oBFusCATed

1. Download the source of C::B
2. Build the source using C::B
3. Execute src/update.bat
4. Hit F9 or F8 in C::B

That's it.

p.s. What do you want to modify in the debugger? Do you know that we've made many modifications to the debugger in the wxpropgrid_debugger branch? Have you tried it.\
p.p.s. Please use code tags and no bold.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jibimily

#2
Thank you for your reply.
Now I can successfully build a new plugin project and insert it to my C::B

But I want to modify the debugger for remote debugging. Then use it for Embedded Development and debugging.
I means that the "debugger plugin" do not use the local gdb,only send and receive message from remote machine. the real progam is running on remote machine.

I just start to learn to use C::B and would like to add new function for this software.
I have not known about the wxpropgrid_debugger branch,could you give me more information.


And another problem is:Every time I modify the code of debugger, I have to rebuild the whole C::B project and cost much time.  Is there an  method of picking up the debugger module to rebuild.

oBFusCATed

Here is the branch: http://svn.berlios.de/wsvn/codeblocks/branches/wxpropgrid_debugger/?#ab1bb068457ecc925a5b07fe41a91d401
Download it using a svn client.

1. C::B supports remote debugging, look in project -> properties -> debugger. For proper working remote debugging you'll need the debugger's branch (you can use a nightly, too)
2. Hm, don't know what is broken at your place, for me the code is rebuild correctly and it is very fast.
    Maybe you need to check the modification time of the sources of C::B, they should not be in the future!


(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

xunxun

You should rebuild your plugin with the same cb sdk.
Regards,
xunxun

jibimily

#5
thank you.
I tried the remote debug ,but the remote debug has some problem. The gdbserver running on remote machine shows :

Remote debugging from host 192.168.1.190
readchar: Got EOF
Remote side has terminated connection.  GDBserver will reopen the connection.


Then I have seen the source code of debuggergdb of C::B 10.05. But it's not easy to understand. I found that All of the operations will set string to m_Cmd and execute CurrentCommand()->Action(). But I do not found where the "Action()"  is.

May I know that if there have any code structure graph or interpretation for the code?

oBFusCATed

Does remote debugging works, when you use command line gdb?
Also try a debugger's branch nightly, there the remote debugging was improved a bit.
Here is a link for the latest version for that branch: http://forums.next.codeblocks.org/index.php/topic,14470.0.html
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jibimily

It can works when I use gdb command line with mingw out of CB.
could you explain the "wxString m_Cmd" in class DebuggerCmd. I found every operation would put a special string to m_Cmd, could you show me the pattern or format of m_Cmd that how it works.

oBFusCATed

m_Cmd stores the raw gdb command that needs to be executed, simple as that...
Read the gdb docs for more details.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jibimily

#9
okey.Thanks very much for your help.
Now I more clearly known the code. I think I can join the plugin developer to contributie my idea soon after.

there is a small problem:
for example,when i click the step button, the execution flow of the code is :

DebuggerGDB::OnStep(),
DebuggerGDB::Step(),
DebuggerGDB::RunCommand(),
GDB_driver::Step(),
DebuggerDriver::QueueCommand(),
DebuggerDriver::RunQueue(),
DebuggerCmd:Action()


is it right?
but I do not find where the triquetrous flag on GUI changed, which is the same as the bookmark indicating the current debug running line.For example, I click "Next Line" button, it will indicate the next line. IF I click the "Continue" button, it will go to the next breakpoint line.

oBFusCATed

I don't know what problem do you want to fix, but at the moment you're wasting your time looking at the code in trunk or 10.05.
The code related to the debugger is highly modified and improved in the debuggers branch (have you tried the nightly?).
No patches or changes against trunk will be accepted!

So don't waste your time. I've warned you!
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

jibimily

#11
I only learn how to develop plugin in CB. But actually I do not find any introduction information. So I would like to look at the exsiting code. And there are many questions. So I do not think it waste time!

And then I have used nightly. Yes, it has some difference. But have not find where to download the source code,

oBFusCATed

(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]