News:

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

Main Menu

debug codeblocks source code

Started by mmkider, September 29, 2008, 07:30:37 AM

Previous topic - Next topic

mmkider

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

MortenMacFly

Quote from: mmkider on September 29, 2008, 07:30:37 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mmkider

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.

MortenMacFly

Quote from: mmkider on September 29, 2008, 09:28:32 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).

Quote from: mmkider on September 29, 2008, 09:28:32 AM
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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mmkider

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.

MortenMacFly

Quote from: mmkider on September 29, 2008, 02:20:45 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: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

mmkider

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

Pecan

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.


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