User forums > Using Code::Blocks

small bug in Rename symbols command

(1/1)

frithjofh:
Hello everybody,

I think there is a small bug in the "Rename symbol" command. If the name of a class (or any other symbol, but that is a little less likely) is the same as the name of the header file, than the include directives of that header file get changed when you use the command to change the class name. I did the test with a class name I wanted to change to begin with a capital letter and the execution of the command changed the file name in the include directives accordingly. Reproducible and always.

Another related bug which I can't reproduce always (it seems to happen intermittently) is that when changing the class name to begin with a capital letter it gets changed alright, but the change is not done in the second mentioning of the class in it's constructors. The original code:


--- Code: ---surface::surface() {}
--- End code ---

gets changed to


--- Code: ---Surface::surface() {}
--- End code ---

Regards and greetings from Asturias

frithjofh

ollydbg:
thanks for the bug report!!!

first issue:

--- Quote ---I think there is a small bug in the "Rename symbol" command. If the name of a class (or any other symbol, but that is a little less likely) is the same as the name of the header file, than the include directives of that header file get changed when you use the command to change the class name. I did the test with a class name I wanted to change to begin with a capital letter and the execution of the command changed the file name in the include directives accordingly. Reproducible and always.

--- End quote ---
Ok, from the internal algorithm I know, I think it is definitely a bug. For example:

--- Code: ---#include "Apple.h"
#include <Apple.h>
class Apple
{
};
Apple a;

--- End code ---
Rename "Apple" to "Orange" will change four occurrences in the code snippet.
This can be simply filter out a preprocessor line. Note "Rename" feature is not 100% correct unless we do a full parsing and walk on the AST (like a compiler did). Currently implementation is very limited.

Issue 2:
Maybe we can add a special case of handling constructors renaming. I don't know much about the reason. :D, hope i will get some time to look into it.

PS:
My current interest was doing a quex based parser, see:
http://code.google.com/p/quexparser/
and
http://code.google.com/p/quexparser/source/browse/trunk/parser.cbp
 :)




Navigation

[0] Message Index

Go to full version