Author Topic: debug codeblocks source code  (Read 7245 times)

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
debug codeblocks source code
« on: September 29, 2008, 07:30:37 am »
I got new codeblocks source code.
I build all is success,but it had no debug setting of defualt project.
I don't know how to start trace souce code.

Can I debug codeblocks source code from vs2005 or codeblocks?

thx
« Last Edit: September 29, 2008, 07:45:20 am by mmkider »

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: debug codeblocks source code
« Reply #1 on: September 29, 2008, 09:18:48 am »
Can I debug codeblocks source code from vs2005 or codeblocks?
Use C::B with GDB to debug C::B.

As a side not: C::B is not related to VC2005. You cannot use VC2005 for any development for C::B
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
Re: debug codeblocks source code
« Reply #2 on: September 29, 2008, 09:28:32 am »
I download source code of codeblocks from svn and see no debug Setting for CodeBlocks.cbp.
 
I set breakpoints and trigger start button on Codeblocks, I got info " Debugger finished with status 1".

So I don't know how to start trace source code.


thx your answer.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: debug codeblocks source code
« Reply #3 on: September 29, 2008, 09:32:05 am »
I download source code of codeblocks from svn and see no debug Setting for CodeBlocks.cbp.
C::b is generally compiled with debugging symbols (you may want to verify in the compiler options after you loaded the CBP file).
 
I set breakpoints and trigger start button on Codeblocks, I got info " Debugger finished with status 1".
Are you sure you are using a recent GDB? Notice that older ones do not work properly. I for myself use v6.6.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
Re: debug codeblocks source code
« Reply #4 on: September 29, 2008, 02:20:45 pm »
haha  :D

Thx your respond.
The original gdb of my computer is 6.8 version.
I downgrade gdb is 6.6 version ,it's fun.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: debug codeblocks source code
« Reply #5 on: September 29, 2008, 02:30:04 pm »
The original gdb of my computer is 6.8 version.
To my knowledge this version of GDB cannot debug into wxWidgets code. So the downgrade is correct if you want to debug wxWidgets applications.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline mmkider

  • Almost regular
  • **
  • Posts: 150
Re: debug codeblocks source code
« Reply #6 on: September 30, 2008, 02:37:00 pm »
I build target  code-completion and  have set Host application to "devel\codeblocks.exe"

but I got follow list

"No source file named D:/CodeBlocks_sc/src/plugins/codecompletion/codecompletion.cpp.
Breakpoint 2 ("D:/CodeBlocks_sc/src/plugins/codecompletion/codecompletion.cpp:1666) pending."

How to add codecompletion.dll info into gdb?

thx  :D

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: debug codeblocks source code
« Reply #7 on: September 30, 2008, 03:02:57 pm »
The source code location and breakpoint will be resolved _after_ the dll is loaded by CB. The plugin must be in the location CB expects to load it; ie, ...trunk/src/plugins or .../trunk/src/plugins/contribs/plugin_name .

Even though I get the "No source file named" message, the breakpoint still breaks in my plugin.

Code
Building to ensure sources are up-to-date
Build succeeded
Selecting target:
default
Adding source dir: C:\Usr\Proj\cbBeta\trunk\src\plugins\contrib\dragscroll\
Adding source dir: C:\Usr\Proj\cbBeta\trunk\src\plugins\contrib\dragscroll\
Adding file: ..\..\..\devel\codeblocks.exe
Starting debugger:
done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.3
No source file named C:/Usr/Proj/cbBeta/trunk/src/plugins/contrib/dragscroll/dragscroll.cpp.
Breakpoint 1 ("C:/Usr/Proj/cbBeta/trunk/src/plugins/contrib/dragscroll/dragscroll.cpp:112) pending.
Child process PID: 3608
Pending breakpoint ""C:/Usr/Proj/cbBeta/trunk/src/plugins/contrib/dragscroll/dragscroll.cpp:112" resolved
At c:/Usr/Proj/cbBeta/trunk/src/plugins/contrib/dragscroll/dragscroll.cpp:112