Feature request: Extend Go To Address (by template value) to allow calculations

Hi,

The Go To Address context menu option is incredibly helpful.

In my example, I have a structure which records offsets in the rest of the file. However those offsets are a) relative to some other value and b) divided by 32.

To turn the recorded offsets into actual locations within the file I have to do L = 32 * o + i;

I can do this in a comment, to see the value, but then cannot use the Go To Address shortcut.

Perhaps a value=_function_ attribute could be implemented?

There are a few different options here. One is to use a custom <read> function for the variable which changes the value displayed in the Value column. You can transform the address inside that function and the Goto Address will use the transformed value. If you want to be able to see both the old address and the transformed address, you could create a secondary ‘local’ variable for each variable you want transformed and then you would use Goto Address on the secondary variable. If you want to do this, you need to right-click on the Template Results and choose ‘Show Local Variables’. Another way would be to make a separate script that would do the transformation, although it may be some work to figure out which variable is selected. This script could be added to the right-click menu. If you are interested in any of these options we can give you some more details.

Graeme
SweetScape Software

Ah! I’d already tried the local variable approach - but didn’t know about the “Show Local Variables” option. And I’d seen but hadn’t put it together with what I wanted to do.

As always, you’re way ahead of me!

Thanks!