User forums > Using Code::Blocks

Possible bug.

(1/2) > >>

Max:
Dear *.*

I am observing the following bug.

 In the Tools menu I created a tool to run an external executable. I am using the parameter

${PROJECT_NAME}.rcs

Basically I run an RCS application that needs the name of the RCS archive as argument. My RCS archive is the project
name followed by .rcs.

OK now the bug.

1) Open Codeblocks
2) open an existing  project, say Project1
3) run the tool. Everything is correct, OK.
4) Close the Project1
5) Open another existing project, say NewProject
6) run the tool.... now the exe starts but using the old Project1 RCS database (Project1.rcs)

It seems that ${PROJECT_NAME} is pointing to the previous projects.


Please, before opening a bug, I would like to have a confirmation of this bug. I am using the 7th Feb nightly build.

Thanx

Max

duncanka:
Partially confirmed on rev1906 (see below).

I've also found that if the project name is changed in memory, and even if the project file is then saved, the macro does not register the change.  However, the bug is not consistent, and I haven't been able to find rhyme or reason to when it gets the macro right or wrong.  Usually, it works if I close and re-open the project file, but sometimes it even works right away.

While we're on this subject, why are so few macros available in the Tools dialog?  I, for one, would really like to have at least EXE_OUTPUT available, as well as TARGET_NAME, OUTPUT_PATH, and maybe similar output-related macros that are currently available to the advanced compiler options.  (Obviously these would have to be adapted slightly, but at least target-specific options such as target output and output path should be implemented IMHO.)

thomas:
This bug to appeared about 6-8 out of 50 times I tried. I don't know why, though, it is hard to reproduce.
One things seems certain: It only ever occurs if you close a project and open another. Closing a project while another is already open or changing the active project always works fine.


--- Quote from: duncanka on February 10, 2006, 09:51:26 pm ---While we're on this subject, why are so few macros available in the Tools dialog?
--- End quote ---
That is not the case. All variables are available everywhere. You can use the same variables in "Tools" as you can use in a project.
However, not all variables are defined at all times (so they evaluate to empty sometimes). For example, TARGET_NAME and TARGET_OUTPUT_DIR only make sense while a build is running. At all other times, it is not possible to unambiguously define what "the" target is.

killerbot:

--- Quote ---However, not all variables are defined at all times (so they evaluate to empty sometimes). For example, TARGET_NAME and TARGET_OUTPUT_DIR only make sense while a build is running. At all other times, it is not possible to unambiguously define what "the" target is.
--- End quote ---

Target name is known, I think, since it is visible in the target drop down list in the build bar, and ... we are not actually building at that time ...
The output dir of a target is a setting of the cbp ?? no ? so it's available.

thomas:
That menu is only ever used for selecting a single target (in place of "All") when pressing the "Rebuild" button, so the MacrosManager doesn't really know about it ;)

Navigation

[0] Message Index

[#] Next page

Go to full version