Author Topic: how to modify the plugin debugger  (Read 9504 times)

Offline jibimily

  • Single posting newcomer
  • *
  • Posts: 6
how to modify the plugin debugger
« on: June 02, 2011, 11:09:45 am »
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 !
« Last Edit: June 02, 2011, 11:11:19 am by jibimily »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: how to modify the plugin debugger
« Reply #1 on: June 02, 2011, 11:17:46 am »
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!]

Offline jibimily

  • Single posting newcomer
  • *
  • Posts: 6
Re: how to modify the plugin debugger
« Reply #2 on: June 03, 2011, 05:10:31 am »
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.
« Last Edit: June 03, 2011, 06:58:03 am by jibimily »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: how to modify the plugin debugger
« Reply #3 on: June 03, 2011, 10:11:48 am »
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!]

Offline xunxun

  • Almost regular
  • **
  • Posts: 187
Re: how to modify the plugin debugger
« Reply #4 on: June 05, 2011, 10:31:27 am »
You should rebuild your plugin with the same cb sdk.
Regards,
xunxun

Offline jibimily

  • Single posting newcomer
  • *
  • Posts: 6
Re: how to modify the plugin debugger
« Reply #5 on: June 08, 2011, 10:39:40 am »
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?
« Last Edit: June 08, 2011, 10:41:49 am by jibimily »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: how to modify the plugin debugger
« Reply #6 on: June 08, 2011, 10:55:22 am »
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.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!]

Offline jibimily

  • Single posting newcomer
  • *
  • Posts: 6
Re: how to modify the plugin debugger
« Reply #7 on: June 09, 2011, 05:13:06 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: how to modify the plugin debugger
« Reply #8 on: June 09, 2011, 07:20:10 am »
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!]

Offline jibimily

  • Single posting newcomer
  • *
  • Posts: 6
Re: how to modify the plugin debugger
« Reply #9 on: June 09, 2011, 09:35:15 am »
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.
« Last Edit: June 09, 2011, 09:43:21 am by jibimily »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: how to modify the plugin debugger
« Reply #10 on: June 09, 2011, 10:24:04 am »
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!]

Offline jibimily

  • Single posting newcomer
  • *
  • Posts: 6
Re: how to modify the plugin debugger
« Reply #11 on: June 10, 2011, 03:58:42 am »
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,
« Last Edit: June 10, 2011, 04:03:35 am by jibimily »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
(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!]