Skip to content

Set default width for funciton name columns#3598

Open
PremadeS wants to merge 5 commits intorizinorg:devfrom
PremadeS:function-name-elision
Open

Set default width for funciton name columns#3598
PremadeS wants to merge 5 commits intorizinorg:devfrom
PremadeS:function-name-elision

Conversation

@PremadeS
Copy link
Copy Markdown
Collaborator

@PremadeS PremadeS commented Apr 1, 2026

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've updated the documentation with the relevant information (if needed)
  • I've used AI tools to generate fully or partially these code changes and I'm sure the changes are not copyrighted by somebody else.

Detailed description

  • Truncates the end of function names by setting a default width for function name columns on startup

  • The truncation and default width can be changed in Edit->Preferences->Interface->functions

  • Currently affects Functions and Backtrace widget. Only affects Functions widget when its in Horizontal mode. Since vertical/nested mode only has the name column, it seems reasonable not to truncate it

  • This PR also cleans the logic for BacktraceWidget to follow the model/view architecture while moving the rizin querying logic from backtrace widget to CutterCore

  • For interface related options since there will most likely be a lot more in the future it's better to create a single signal per category so there aren't 100 signals for 100 different options. I mentioned it here because this PR refactors the signals added in Improve inefficient screen space usage #3580 to follow this approach

As much as I would like to handle elision differently such as preserving the function name instead of long mangled arguments lists, it just makes the function name more difficult to understand. Not to mention making a generic function that does elision for binaries written in different languages (C++, rust, java...) is not trivial. Maybe that's why tools like IDA follow the same approach of limiting the function name columns width

Test plan (required)

  • Open cutter
    • using binary which contains long function names
    • or add a function with a long name through the console then do View->Refresh
  • Observe that the function name column in functions widget is set to a specific width (400 by default) to prevent the next columns from being pushed into oblivion
  • Set a breakpoint on that long named function
  • Start debug and continue till the break point is hit
  • Observe Backtrace widget follows the same width as functions widget
  • Go to Edit->Preferences->Interface
  • Try changing the width and checking/unchecking the "Limit function name column width to" option
  • Observe the width for function name columns for both widget changes
  • Try setting the width to 9999, observe the column should resize to contents if the set width is greater than contents width
  • Hover on the option in preferences to see the tooltip

Gif
fcn-name-truncate
Since only the column width is changed and not the displayed text, searching in quick filter should work fine

Closing issues

#1904

@PremadeS PremadeS marked this pull request as draft April 1, 2026 05:23
@PremadeS PremadeS force-pushed the function-name-elision branch from 680278e to bfe46c3 Compare April 7, 2026 08:48
@PremadeS PremadeS force-pushed the function-name-elision branch from bfe46c3 to f554a39 Compare April 19, 2026 11:04
@PremadeS PremadeS changed the title Elide parameters to prevent long function names Set default width for funciton name columns Apr 20, 2026
@PremadeS PremadeS marked this pull request as ready for review April 20, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant