News:

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

Main Menu

Set program's arguments don't work with vs2015 build tools & CDB

Started by eqychan, March 13, 2022, 11:23:53 AM

Previous topic - Next topic

eqychan

I made a program (simple console app ywfxvs.exe) in C++. I set the arguments in Project -> set program's arguments and fill the program arguments edit box with "1018" (without quotes), but it don't work. when I debug the program, argc is still 1, and argv[1] is "".
Am I doing a mistake somewhere ? Thanks.

My environment: Windows 7 32bit; Codeblocks 20.03; Visual studio build tools 2015; debugger: CDB (windows kits 8.1)

BlueHazzard

Make sure you have selected the right "target" in the programs argurments dialog and when you run your application (the drop down menu near the run button)

eqychan

Thanks for your reply, I did select the right and same "target" when debug the application.
And now I found that when I use GDB as the debugger or run the program without debugging, it works fine. but when i change the debugger to CDB and press F8 to debug my program, again i cannot see the arguments in my program.  Any problems with my CDB parameter settings?(My debugger setting showing in the attatchment)

BlueHazzard

A sry, my fault, i did not realize that you are talking about debugging.

Please enable full debug log in Settings->Debugger->Common->Full Debug log

Then start your debugger, and post the output of the "Debugger" tab in the log view at the bottom in code tags here (use the # in the new post editor of the forum)

thank you!

Miguel Gimenez

From cdb_driver.cpp:81 and cdb_driver.cpp:97
// FIXME (obfuscated#): Implement user arguments
so looks like CDB ignores user arguments ATM.

Miguel Gimenez

I have just commited a patch to fix this, I can not test it because I do not have CDB, but the change is straightforward:

+    if (!userArguments.empty())
+        cmd << ' ' << userArguments;


eqychan

Thanks for your replay, I applied your patch and rebuilt Codeblocks form source, now it works pretty fine. thanks ;D

Miguel Gimenez