Code::Blocks

User forums => Using Code::Blocks => Topic started by: wmaple on November 18, 2008, 08:35:43 am

Title: How to debug program without creating a project
Post by: wmaple on November 18, 2008, 08:35:43 am

Hello,

   I have installed CodeBlock on my system, finding a problem with debugger. Within a project, I can start the debugger successfully; but without creating a project, namely coding a single source file, there is no way to start the debugger. Need any further setting or other something to do?  Thanks.
Title: Re: How to debug program without creating a project
Post by: thomas on November 18, 2008, 01:23:28 pm
There is no support for debugging a single file in Code::Blocks. You can still start gdb from a commandline of course.
Title: Re: How to debug program without creating a project
Post by: wmaple on November 20, 2008, 08:10:47 am

Is there any way I can give the developers some suggestion concerning debugging single source file?
I think many students will appreciate it.
 
Title: Re: How to debug program without creating a project
Post by: CuteAlien on November 20, 2008, 02:44:49 pm
I usually use printfs (or cout) and gdb for single source files. But being able to compile&debug single sourcefiles in C::B without creating a project for that would indeed be a nifty feature.
Title: Re: How to debug program without creating a project
Post by: dk on June 24, 2009, 04:12:26 pm
I am teaching high school students, and we make a lot of short and simple one-file programs.

Often the process of debugging one program requires just a couple of minutes, and creating project for debugging such programs need a lot of time.

So I also want to have a single-file debugging feature.


Title: Re: How to debug program without creating a project
Post by: MortenMacFly on June 24, 2009, 04:16:47 pm
So I also want to have a single-file debugging feature.
This is not as easy as you would think.

Why don't you use the "default workspace" feature of C::B that opens a default workspace on startup of C::B. This could already include a dummy (empty / one file) project. Very easy and debugging is possible from scratch.
Title: Re: How to debug program without creating a project
Post by: dk on June 24, 2009, 04:32:32 pm
Why don't you use the "default workspace" feature of C::B that opens a default workspace on startup of C::B. This could already include a dummy (empty / one file) project. Very easy and debugging is possible from scratch.

And every time we want to start new task, we should remove old source file from the project and add new file with the new task? It isn't so easy too...

Title: Re: How to debug program without creating a project
Post by: MortenMacFly on June 24, 2009, 04:48:33 pm
It isn't so easy too...
Well - remove file (shortcut) + Drag&Drop. Alternativaly a script can do it for you.

Anyways: I'm afraid debugging a single file will not be supported any time soon.
Title: Re: How to debug program without creating a project
Post by: dk on June 24, 2009, 04:55:07 pm
Well - remove file (shortcut) + Drag&Drop.

It is easy to say, but it isn't easy for young pupil to remember this actions.
Because in the most cases they don't need debugging, and they don't need the project at all.

Title: Re: How to debug program without creating a project
Post by: Ceniza on June 25, 2009, 07:56:00 am
Now that would be a gorgeous way to make the single-file-without-project functionality be really nice. However, it looks like I am the only developer supporting the idea to provide better... er... support for that. Morten, on the other hand, is actually suggesting to remove it altogether (he doesn't use it, so he doesn't care). Too bad I haven't been in the mood to do much lately (counting in months now), and the last few days I have been sick :(

Isn't really there any other developer who thinks the single file functionality should be improved?

I would also like to remind you of an old post where I suggested to have a mechanism to define compiler/linker options that could then be selected as global, for single file compilation or for projects. It would be something like the options sets (or whatever they are called) in Delphi 2009, just way better. I think it would be another nice addition that also happens to improve the single file functionality.

Yiannis: In a scale from 8 to 35 (8 being extremely easy, 35 being hardly possible), how would you rate modifying the debugger plugin to support that?