NationalSecurityAgency / ghidra

Ghidra is a software reverse engineering (SRE) framework
https://www.nsa.gov/ghidra
Apache License 2.0
50.44k stars 5.77k forks source link

Configuration Option for "Def-use" Highlighting #2824

Open chezwicker opened 3 years ago

chezwicker commented 3 years ago

Is your feature request related to a problem? Please describe.

I very often need the "Def-use" highlighting, and it's frustrating that I have to go through a context menu to get it. I'm also not quite sure why it's called highlighting in the context of Ghidra (seeing as that's described as "a more permanent variation of a selection") even though it goes away once I click somewhere else.

There also doesn't seem to be a key binding to at least allow using a single key-press to achieve the same.

Describe the solution you'd like

I'd like to have a configuration option about which "marking" (suggested alternative term to avoid ambiguity) style should be applied when clicking on a variable / parameter.

Describe alternatives you've considered

A possible alternative - and probably a good addition even if the above is implemented - would be to offer a key binding for the "marking" style to use.

Additional context

The same feature would actually be appreciated in the "Listing" component!

dragonmacher commented 3 years ago

All actions (non-mouse based actions) in Ghidra can be provided a key binding of your choosing, either from the options or from the action itself. In this case, show the pullright for Highlight->Def-use, hovering over it with your mouse, and then press F4. This will show a dialog that allows you to set the key binding for the hovered action.

Regarding the action names used in the Listing vs the Decompiler, well, these things have evolved over the years. They certainly could be more consistent.

It seems to correctly address this overall issue we would need to provide options to allow users to control each type of highlight that is available, including: enablement, mouse click type and key binding. Currently, any of the actions that take place on mouse clicking (whether middle-click, left-click or right-click) cannot be assigned to a key binding.

chezwicker commented 3 years ago

Thank you for the feedback - your suggestion definitely gives me my workaround, that's a big help!

chezwicker commented 3 years ago

P.S. might be an idea to also mark the variable declaration and above all to enable showing uses when clicking on the declaration. Please let me know if you'd like to see a separate issue for this.