Cutter: Add settings to control analysis verbosity

Created on 2 Jun 2020  路  7Comments  路  Source: rizinorg/cutter

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

Currently, if Cutter (r2) faces an analysis issue, there is no good way for the user to know what happened. For example, when trying to define a function at some address, I couldn't understand why it fails. Only when enabled e anal.verbose I saw that it fails because it can't set functions on non-executable sections.

Describe the solution you'd like

Add an option to the preferences widget to enable verbose analysis (anal.verbose)

Enhancement good first issue

Most helpful comment

Hi everyone,
I'm sharing with you a first version of the "Analysis" section. Since this is my first contribution to Cutter, I think it's a good idea to first share the code before creating the PR. If you think that it makes sense, I can then create the PR for a proper code review. Of course, if you prefer that I create the PR directly, this is perfectly fine with me.

You'll be able to see the changes with respect to master here.

Some considerations I have taken into account:

  1. To keep it simple, for now I narrowed down the selected options at https://hackmd.io/@Megabeets/H1jBD3Hxv/edit to only those that have boolean values. When I have some feedback on the current code, I can add the remaining options, in this or subsequent PRs.
  2. In general, I tried to keep the code as simple as possible and modify existing files as little as possible. For example, I chose to use the Core()->getConfigb method directly instead of Config()->getConfig to avoid having to modify this one.
  3. Similarly, I decided to use the already existing AnalTask to handle the analysis. As a consequence, the title of the async task dialog is "Initial Analysis" and you can see the message "Loading the file...", which is not quite accurate:
    screenshot
    However, I thought it was OK, for now at least.
  4. The selected options are not maintained between two different sessions. However, if you think it's worth it, I can add it, as well as a "Restore defaults" button (just as in the Disassembly section).
  5. I chose the icon cog_light.svg, since it seemed that a cog is a good representation for "Analysis" and it was already there. Let me know if that's OK, or what other icon would you think fits better. Also, I took into account that for the light theme the color of the icon changes, so added the corresponding image too.

Let me know your thoughts on it! Thanks!

All 7 comments

@ITAYC0HEN shouldn't this be in analysis options dialog too during open file? Also, where should it be added in preferences exactly as I don't see any analysis specific section?

Hey :) It can be on Initial Analysis dialog, but it will create a lot of verbose and msgs during the analysis so I won't encourage users to use it.

Regarding the section, I'd add a new Analysis section for this.

Something like this issue can also be part of this section: https://github.com/radareorg/cutter/issues/875

Probably, more options from e??~anal can be there as well (options that are relevant to change after the initial analysis). But this stuff can be decided later on :)

I'd like to work on this issue. Do you have more suggestions for other analysis options besides anal.verbose?

This is a good question :)
I opened this for a list in which we can select the options we like to put in there
https://hackmd.io/@Megabeets/H1jBD3Hxv/edit

Hi everyone,
I'm sharing with you a first version of the "Analysis" section. Since this is my first contribution to Cutter, I think it's a good idea to first share the code before creating the PR. If you think that it makes sense, I can then create the PR for a proper code review. Of course, if you prefer that I create the PR directly, this is perfectly fine with me.

You'll be able to see the changes with respect to master here.

Some considerations I have taken into account:

  1. To keep it simple, for now I narrowed down the selected options at https://hackmd.io/@Megabeets/H1jBD3Hxv/edit to only those that have boolean values. When I have some feedback on the current code, I can add the remaining options, in this or subsequent PRs.
  2. In general, I tried to keep the code as simple as possible and modify existing files as little as possible. For example, I chose to use the Core()->getConfigb method directly instead of Config()->getConfig to avoid having to modify this one.
  3. Similarly, I decided to use the already existing AnalTask to handle the analysis. As a consequence, the title of the async task dialog is "Initial Analysis" and you can see the message "Loading the file...", which is not quite accurate:
    screenshot
    However, I thought it was OK, for now at least.
  4. The selected options are not maintained between two different sessions. However, if you think it's worth it, I can add it, as well as a "Restore defaults" button (just as in the Disassembly section).
  5. I chose the icon cog_light.svg, since it seemed that a cog is a good representation for "Analysis" and it was already there. Let me know if that's OK, or what other icon would you think fits better. Also, I took into account that for the light theme the color of the icon changes, so added the corresponding image too.

Let me know your thoughts on it! Thanks!

Hey yo @ocastejon! Great comment, very thorough :+1:
I would love to seed it as a PR and then we can comment on some of the things you mentioned.

Using the Analysis Task for the inital analysis is a wise decision, but it will have to get some tweaks (as you mentioned, the logs aren't correct).
The icon is quite fine :) Can't think of any better one from the top of my head

Hi @ITAYC0HEN! Thank you! I just created the pull request #2332. Looking forward to your feedback! :)

Was this page helpful?
0 / 5 - 0 ratings