Author Topic: Possible bug.  (Read 4887 times)

Max

  • Guest
Possible bug.
« on: February 10, 2006, 11:01:25 am »
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


Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Possible bug.
« Reply #1 on: February 10, 2006, 09:51:26 pm »
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.)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Possible bug.
« Reply #2 on: February 10, 2006, 09:59:29 pm »
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.

While we're on this subject, why are so few macros available in the Tools dialog?
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.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Possible bug.
« Reply #3 on: February 10, 2006, 10:10:18 pm »
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.

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.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Possible bug.
« Reply #4 on: February 10, 2006, 10:27:30 pm »
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 ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: Possible bug.
« Reply #5 on: February 10, 2006, 10:31:37 pm »
can we insert this info (on target change for example) into the macrosmanager ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Possible bug.
« Reply #6 on: February 10, 2006, 11:11:18 pm »
At the risk of screwing up everything again... yes. Of course we can, there is nothing you can't add as a variable ;)

On the other hand, you always have to judge whether it makes sense and whether the amount of work (and the risk of breaking something) is worth it. If you like, go ahead (but if you break it, you'll fix it :lol:).
To me personally, it is a quite useless addition, but there is a significant risk of messing up something (I know what I am talking of, I already spent a week on fixing stuff I broke in MacrosManager once).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."