Author Topic: Passing command line arguments to target when debugging  (Read 38638 times)

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Passing command line arguments to target when debugging
« on: January 29, 2009, 06:15:18 am »
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

Offline jomeggs

  • Multiple posting newcomer
  • *
  • Posts: 92
Re: Passing command line arguments to target when debugging
« Reply #1 on: January 29, 2009, 10:18:59 pm »
I'm using Code::Blocks 8.02 for Windoze with CDB as the debugger...

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.

Offline jens

  • Administrator
  • Lives here!
  • *****
  • Posts: 7253
    • Jens' unofficial debian-repository for the Code::Blocks - IDE
Re: Passing command line arguments to target when debugging
« Reply #2 on: January 29, 2009, 10:29:50 pm »
I'm using Code::Blocks 8.02 for Windoze with CDB as the debugger...
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.

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.

Offline dushara

  • Multiple posting newcomer
  • *
  • Posts: 29
Re: Passing command line arguments to target when debugging
« Reply #3 on: January 30, 2009, 01:47:57 am »
Hi thanks for your help...

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.

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