User forums > Using Code::Blocks

Passing command line arguments to target when debugging

(1/2) > >>

dushara:
Hi all,

I'm using Code::Blocks 8.02 for Windoze with CDB as the debugger. I can't work out how to pass command line arguments to the target application when debugging.

Project -> Set Program Arguments... work only if I run the application. However, when debugging the app, the arguments aren't passed to the target.

Any ideas?

Thanks
Dushara

jomeggs:

--- Quote from: dushara on January 29, 2009, 06:15:18 am ---I'm using Code::Blocks 8.02 for Windoze with CDB as the debugger...

--- End quote ---

Hi, it would be better to give the release number of CB, plase check out the about box. For me it's svn 5382 and it works fine with program arguments in debug mode.

There is another important checkbox to be found in Project -> Set Program Arguments named "This target provides the project's mains executable". Mark the Debug-target above and check the checkbox.

Jenna:

--- Quote from: jomeggs on January 29, 2009, 10:18:59 pm ---
--- Quote from: dushara on January 29, 2009, 06:15:18 am ---I'm using Code::Blocks 8.02 for Windoze with CDB as the debugger...

--- End quote ---
Hi, it would be better to give the release number of CB, plase check out the about box. For me it's svn 5382 and it works fine with program arguments in debug mode.

--- End quote ---

C::B 8.02 is enough.
If I remember right,  it's revision 4919. But it has no svn-revision number included, because it's an official release-version.

dushara:
Hi thanks for your help...


--- Quote from: jomeggs on January 29, 2009, 10:18:59 pm ---There is another important checkbox to be found in Project -> Set Program Arguments named "This target provides the project's mains executable". Mark the Debug-target above and check the checkbox.

--- End quote ---

I've done this already but not luck. Here's part of the output in the Debugger tab:


--------------------------------------->8-----------------------------------------
Starting debugger:
done
Setting breakpoints
quit:
Microsoft (R) Windows Debugger Version 6.10.0003.233 X86
Copyright (c) Microsoft Corporation. All rights reserved.
CommandLine: ../bin/Debug/test-compound.exe
Symbol search path is: C:/code/ccover/tests/test-compound/;C:/code/ccover/
Executable search path is:
---------------------------------------8<-----------------------------------------


Note the line containing the tag "CommandLine" it should contain an argument "--test wip"

Could this be a bug? (The linux version - with GDB - works ok).

Thanks again
dushara

blocker:
This post is several years old now, but, I guess I got the solution for CodeBlocks 20.03.

I'm not a professional developer but I reviewed the source code for versions 10.05 and 20.03; the issue is that "cdb_driver" does not pass arguments; see the attached screenshot.

Regards.

Navigation

[0] Message Index

[#] Next page

Go to full version