Ghidra: Variable rename doesn't work

Created on 14 Mar 2019  路  5Comments  路  Source: NationalSecurityAgency/ghidra

Describe the bug
Hi, I have tried to change a variable name in a small binary,
but it does not change the name from all equal variables.
Its create a new variable declaration, see screen capture.
Sorry for my bad English.

To Reproduce
Steps to reproduce the behavior:
screencapture

Expected behavior
Change all equal variable names

Attachments
main.zip

Environment (please complete the following information):

  • OS: Kali 2019.1a (VMware Workstetion Pro on Windows N 10 Pro 64bit)
  • Java Version: 11.0.3
  • Ghidra Version: 9.0
Bug

Most helpful comment

any news about this issue? I have similair bug: when renaming local var, I don't see it has been renamed. But I get the "duplicate error" when trying to rename again

All 5 comments

The renaming of a variable in the decompiler can be problematic at times. If you introduce a variable that the decompiler has at the beginning of it's analysis versus a variable it creates as part of data flow analysis, you can end up with differing variables. The variable merging algorithm can be affected by the initial information of the variable rename.

In your case, I believe the decompiler is correct but not an optimal re-use of the variable. The variable assigned from the ror8 could be considered as another variable in Static Single Assignment.

What happens if you rename uvar2 to be ror8Value?

it comes error message "Duplicate name"

Duplicate name was not expected.

Can you post the debug Decompiler .xml file?

Yes, where can I find the file?

any news about this issue? I have similair bug: when renaming local var, I don't see it has been renamed. But I get the "duplicate error" when trying to rename again

Was this page helpful?
0 / 5 - 0 ratings

Related issues

awsaba picture awsaba  路  3Comments

marcushall42 picture marcushall42  路  3Comments

rrivera1849 picture rrivera1849  路  3Comments

forkoz picture forkoz  路  3Comments

gemini00 picture gemini00  路  3Comments