Author Topic: Debugging with C::B  (Read 5761 times)

qwerty

  • Guest
Debugging with C::B
« on: February 12, 2007, 03:18:12 am »
Hi,

Please help a newbe. I am not just a newbe C::B user, but also relatively new to programming - being a die hard hardware guy who eventually realized some need for occasional coding. So, have a mercy, don’t lash me out to hard.

I have used C::B 1.0rc2 for few weeks initially, and tonight moved to the nightly build Feb. 11 2007 – wx2.6.3 (Windows, Unicode), which appeared to be a huge step forward.
Though, I have a problem debugging my code which I didn’t have on the 1.0rc2. When I set a break point, and start the debugger, nothing really happens. It doesn’t even open a console widow (my code is a console application).
Debugger messages:
Building to ensure sources are up-to-date
Build succeeded
Selecting target: default
Adding source dir: C:\mypath\mycodedirectory_v1.0.0\
Adding source dir: C:\mypath\mycodedirectory_v1.0.0\
Adding file: exe_folder\mycode_v1.0.0.exe
Starting debugger: done
Registered new type: wxString
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints

I suspect some sort of installation problem, but don’t know where to look.
Appreciate your help. Thanks,

qwerty

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Debugging with C::B
« Reply #1 on: February 12, 2007, 02:06:59 pm »
   //-- Please Provide more information
   Would you state your CodeBlocks and compiler version, and your Operating System.
   Also state  your wxWidgets version if you're using one.

If you're running linux, the debugger does not yet provided a console for a console application. There is a patch pending for this however. Maybe it'll be applied sometime soon.

For the time being, you can use a program called "cgdb" to debug your linux console app. If you're running ubuntu, synaptic will install it for you.
Else google it.

qwerty

  • Guest
Re: Debugging with C::B
« Reply #2 on: February 12, 2007, 05:55:37 pm »
OS: Widows XP
C::B: CB_20070211_rev3592_win32
wxWidgets: wxmsw26u_gcc_cb_wx2.6.3p2 patched with
                wxmsw26u_gcc_cb_wx2.6.3p2AndCbPatch_version3
Compiler: MinGW GCC 3.4.5 manually installed
Debugger: gdb-6.3-2

Thanks,

qwerty

Offline Pecan

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 2778
Re: Debugging with C::B
« Reply #3 on: February 12, 2007, 06:48:54 pm »
OS: Widows XP
C::B: CB_20070211_rev3592_win32
wxWidgets: wxmsw26u_gcc_cb_wx2.6.3p2 patched with
                wxmsw26u_gcc_cb_wx2.6.3p2AndCbPatch_version3
Compiler: MinGW GCC 3.4.5 manually installed
Debugger: gdb-6.3-2

Thanks,

qwerty

Would you look at the following, try it, and tell us where it fails for you.

   //-- Debugging
    Debugging with CodeBlocks

http://www.sci.brooklyn.cuny.edu/~goetz/codeblocks/codeblocks-instructions.pdf

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Debugging with C::B
« Reply #4 on: February 12, 2007, 06:56:03 pm »
In brief, it works. I see the Console.

Using C::B Rev 3589, Win XP SP2, GCC-3.4.5, GDB-6.3. I'm posting a log. The program has 3 variables. 2 stores some predefined values and 3rd one stores sum of others.

Quote
Building to ensure sources are up-to-date
Build succeeded
Selecting target: Debug
Adding source dir: C:\Projects\Test\
Adding source dir: C:\Projects\Test\
Adding file: .\Test.exe
Starting debugger: done
Registered new type: STL String
Registered new type: STL Vector
Setting breakpoints
Debugger name and version: GNU gdb 6.3
At C:/Projects/Test/main.cpp:8
Continuing...
At C:/Projects/Test/main.cpp:9
Continuing...
At C:/Projects/Test/main.cpp:11
Continuing...
At C:/Projects/Test/main.cpp:12
Continuing...
Program exited normally.
Debugger finished with status 0

It's a simple Console app.  :)
Be a part of the solution, not a part of the problem.

qwerty

  • Guest
Re: Debugging with C::B
« Reply #5 on: February 13, 2007, 03:05:50 am »
I have my issue solved by removing MinGW completely and re-installing it again. However this time I used a self install file that I downloaded from here: "http://www.sci.brooklyn.cuny.edu/%7Egoetz/codeblocks/".
Apparently the problem was with the gdb.exe. The file that I got from "http://wiki.codeblocks.org/index.php?title=MinGW_installation#GCC_3.4.5_manual_install" was smaller size of 4,118KB comparing with the current size of 8,665KB. I am not 100% sure that was the root cause since I re-installed the whole MinGW, but it looks like that to me. Comparing my initial debug messages with those posted above by Biplab I didn’t see debugger name and version line. That led me to re-installing the MinGW.

Thanks for help.

BTW The GDB v.6.6 is available for download from "http://sourceware.org/gdb/" . Does it make sense to move from the current v.6.3 to the latest v.6.6?

Thanks,

qwerty

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Debugging with C::B
« Reply #6 on: February 13, 2007, 03:24:28 am »
BTW The GDB v.6.6 is available for download from "http://sourceware.org/gdb/" .
You'll only be able to download the source code; it needs to be specially configured and compiled for MinGW.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

qwerty

  • Guest
Re: Debugging with C::B
« Reply #7 on: February 13, 2007, 03:32:41 am »
Thanks,

qwerty

Offline Biplab

  • Developer
  • Lives here!
  • *****
  • Posts: 1874
    • Biplab's Blog
Re: Debugging with C::B
« Reply #8 on: February 13, 2007, 05:53:06 am »
BTW The GDB v.6.6 is available for download from "http://sourceware.org/gdb/" .
You'll only be able to download the source code; it needs to be specially configured and compiled for MinGW.

Can MinGW builds be compiled from Linux?? MSYS is pretty slow in Windows compared to shell in Linux in the same PC I'm using. Don't know the reason.  :)
Be a part of the solution, not a part of the problem.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: Debugging with C::B
« Reply #9 on: February 13, 2007, 03:08:42 pm »
Can MinGW builds be compiled from Linux??
I presume so, but I've never tried. You'd probably need to build a cross-compiling GCC and then use that to build the Windows native version.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)