ghidra
ghidra copied to clipboard
align comments with code in decompiler
Add a configuration option for the decompiler to align comments with code instead of using the fixed indentation setting. See #575 for the original feature request.
Just tested merging master with this and it still works as expected. Screenshots attached.
Current_Release is the behavior in 10.1.3.
Pull_Request is the behavior after running a merging master into this Pull Request and building it.
Any E.T.A. on when/if this will be merged to release?
Force-pushing a merge of this with the current master
branch, based on feedback I've received on other pulls where this is preferred and fueled by wild optimism that it might get looked at soon.
Does your current patch work on top of master? I assume you also need changes to ElementIds: https://github.com/jobermayr/ghidra-staging/blob/master/3472-align-comments-with-code-in-decompiler.patch
Hint: My version of ElementIds doesn't apply cleanly on top of master because I applied 1938 a few patches before.
Thanks a ton for the heads-up on that, I didn't realize the mechanics of decompiler options were re-worked in such an extensive manner. It had indeed broken since the last check someone voluntarily performed.
The new ordinal-style numbering of elements combined with the sequential manner in which they've been assigned makes it virtually impossible to create a new ElementId in a clean manner. The new option is now jammed lamely at the end, but there's no way to insert it with the other options without making the numbers jump in a non-nonsensical way. Shifting the ordinals of every other element seems even less desirable. I've chosen one of the two equally ugly options I see, and await feedback from the Ghidra team on preferred alternate courses of action.
In the meantime, I tested this locally and it seems to work as expected, and the new tests pass once more.