Author Topic: configure file to debug codecompletion plugin  (Read 31920 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: configure file to debug codecompletion plugin
« Reply #15 on: July 22, 2010, 04:39:52 pm »
By the way, there are some gdb command to show how long the gdb command will response. ( this can measure the wxString showing delay problem several months ago I posted  :D)

Maintenance Commands - Debugging with GDB

Here is the debugger log:
Quote
>>>>>>cb_gdb:
> maint time
"maintenance time" takes a numeric argument.
>>>>>>cb_gdb:
> maint time 1
Command execution time: 0.000000
>>>>>>cb_gdb:
> next
E:\code\cb\cc_branch\src\src\main.cpp:479:24053:beg:0x416c17
Command execution time: 0.000000
>>>>>>cb_gdb:
> next
[New Thread 2780.0xa04]
[New Thread 2780.0xbb4]
E:\code\cb\cc_branch\src\src\main.cpp:482:24131:beg:0x416c4b
Command execution time: 0.140000
>>>>>>cb_gdb:
> break "E:/code/cb/cc_branch/src/plugins/codecompletion/parser/parserthread.cpp:472"
No source file named E:/code/cb/cc_branch/src/plugins/codecompletion/parser/parserthread.cpp.
Breakpoint 2 ("E:/code/cb/cc_branch/src/plugins/codecompletion/parser/parserthread.cpp:472) pending.
Command execution time: 4.453000
>>>>>>cb_gdb:
> break "E:/code/cb/cc_branch/src/plugins/codecompletion/parser/parserthread.cpp:474"
No source file named E:/code/cb/cc_branch/src/plugins/codecompletion/parser/parserthread.cpp.
Breakpoint 3 ("E:/code/cb/cc_branch/src/plugins/codecompletion/parser/parserthread.cpp:474) pending.
Command execution time: 3.875000
>>>>>>cb_gdb:

It will take several seconds to let gdb to set a pending breakpoint... too slow... :(

Edit: which means after a new dll is loaded, gdb need to check if a pending breakpoint can be convert to a normal breakpoint, but it seems one check need about 4 seconds, So, if we have 30 dll to loade, the checking time should be 4*30= 120 seconds..... Oh my God!!
« Last Edit: July 22, 2010, 04:44:04 pm by ollydbg »
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: configure file to debug codecompletion plugin
« Reply #16 on: July 24, 2010, 01:00:41 pm »

1, copy the  E:\code\cb\cc_branch\src\devel\share\CodeBlocks\plugins\codecompletion.dll to
                  E:\code\cb\cc_branch\src\output\share\CodeBlocks\plugins
   so that the debug information can be reserved.

We even don't need to manually copy the dll file, we can just set the path of the generated dll file.

You need to change the "devel" to "output".

Than, every thing works fine!  :D

If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6035
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: configure file to debug codecompletion plugin
« Reply #17 on: November 06, 2011, 10:21:29 am »
I find when debugging CB devel with CB output that loading is extreemly slow when a breakpoint is set.
So, instead of a breakpoint, I place an "asm("int3")" statement at the point I want to begin debugging. CB then loads within 4-10 seconds.
When the int 3 is hit, I then set more breakpoints.
Sorry for bump the old thread.
Hi, All and Pecan.
There are good news on this issue, the gdb guys supply a patch to fix this issue.
See my comments here:
http://sourceware.org/ml/gdb-patches/2011-11/msg00141.html

I have test this patch, and found that CB/gdb start up extremely fast with pending breakpoints under WinXP. This will make debugging plugins much faster and more happy.  :D :D
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13406
    • Travis build status
Re: configure file to debug codecompletion plugin
« Reply #18 on: November 06, 2011, 10:27:50 am »
Hm, this sounds great, I hope it is not windows only.
My app at work has even more shared libraries than C::B and when I set breakpoint somewhere it takes more than a minute to start it, which is very annoying
« Last Edit: November 06, 2011, 10:38:07 am by 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!]