Author Topic: special handling of the macro replacement ""?  (Read 160 times)

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6143
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
special handling of the macro replacement ""?
« on: Today at 06:43:08 am »
Hi, when I'm using the gd_on's unified workspace/code::blocks cbp files, I see something strange.

See here: it looks like GCC works OK, but GDB failed to find the dll(setting wrong PATH)

Re: crash when I try to open a wxsmith file under C::B against wx 3.3.1

If a variable a has a filed name b, and its value is
Code
""
, and if we have
Code
AAA$(#a.b)
, we will finally get
Code
AAA""

The current implementation treats an empty string "" as a valid value and performs the replacement, resulting in
Code
AAA""
instead of the expected
Code
AAA
.

I'd like to see your options on this issue.

Thanks.
If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline AndrewCot

  • Plugin developer
  • Lives here!
  • ****
  • Posts: 681
Re: special handling of the macro replacement ""?
« Reply #1 on: Today at 09:21:14 am »
Make sure you get approval by MortenMacFlybefore making any changes. Check out the SF tickets for posts on macro and hopefully you will fins the ticket and have a read before you spend time on this as you may end up wasting your time.
BTW I agree with you.

Offline ollydbg

  • Developer
  • Lives here!
  • *****
  • Posts: 6143
  • OpenCV and Robotics
    • Chinese OpenCV forum moderator
Re: special handling of the macro replacement ""?
« Reply #2 on: Today at 09:33:30 am »
Make sure you get approval by MortenMacFlybefore making any changes. Check out the SF tickets for posts on macro and hopefully you will fins the ticket and have a read before you spend time on this as you may end up wasting your time.
BTW I agree with you.

Hi, AndrewCot,  long time no see.
I think it is a good direction.
Maybe there are similar topics in the sourceforge tickets.
So I will search for that.

To switch between the debug version of wx library,  using the unified workspace or cbp project is much easier.  We don't need to replace or editor each cbp files.


If some piece of memory should be reused, turn them to variables (or const variables).
If some piece of operations should be reused, turn them to functions.
If they happened together, then turn them to classes.

Offline gd_on

  • Lives here!
  • ****
  • Posts: 838
Re: special handling of the macro replacement ""?
« Reply #3 on: Today at 05:54:21 pm »
To add some informations:
In standard cbp files, there is an environment variable defined as:
Code
<Variable name="WX_CFG" value="" />
When it is used in standard cbp files, as:
Code
<Add directory="$(#wx33_64.lib)/gcc_dll$(WX_CFG)
there are no problems.

In my unified workspace/cbp files, I define a wxwidgets path as, in my case, C:\wxWidgets-3.3.1 as the base, and in a user-defined field, I have created a wx_cfg variable. If I set this variable with nothing (an empty field), the variable is eliminated after a click on the save button. It's why, as in standard cbp files, I tried to set an empty string by "". Apparently, this is the problem described by ollydbg when I use a variable as:
Code
<Add directory="$(#WXWIDGETS)/lib/gcc_dll$(#WXWIDGETS.WX_CFG)
Windows 11 64 bits (25H2), svn C::B (last version or almost!), wxWidgets 3.3.1, Msys2 Compilers 15.2.0, 64 bits (seh, posix : gcc, g++ and gfortran in C:\msys64\mingw64) or 32 bits (dwarf2, posix  in C:\msys64\mingw32).