Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix quit confirmation during debuggin session. #3916

Merged
merged 5 commits into from
Oct 23, 2023

Conversation

vanshjangir
Copy link
Contributor

@vanshjangir vanshjangir commented Oct 12, 2023

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 documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

In librz/main/rizin.c , when in debugger session the program ask for quit confirmation independent of scr.confirmquit true or false.
So the quit confirmation when in debug session is removed, and the code for debug session is pasted below the general quit confirm message, Now if user wants to quit then only program will ask to kill the process otherwise the program will just continue

Test plan

...

Closing issues

Closes #3818

@github-actions github-actions bot added the rizin label Oct 12, 2023
Copy link
Member

@ret2libc ret2libc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What if we move the if (debug) code below the

			if (rz_config_get_i(r->config, "scr.confirmquit")) {
				if (!rz_cons_yesno('n', "Do you want to quit? (Y/n)")) {
					continue;
				}
			}

?

It would need some adjustments, but I think it would make more sense. There's some duplicated code here.

if (rz_config_get_i(r->config, "dbg.exitkills") &&
rz_debug_can_kill(r->dbg) &&
rz_cons_yesno('y', "Do you want to kill the process? (Y/n)")) {
rz_config_set_i(r->config, "scr.confirmquit", false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is not needed anymore?!

Copy link
Contributor Author

@vanshjangir vanshjangir Oct 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I understood, here is my approach

What I have done here is
if scr.confirmquit is true, then the program will ask for quit confirmation and continue if n is returned.
if y is returned then the program will ask for to kill the process is and will not continue to the loop in any case.

@ret2libc ret2libc marked this pull request as ready for review October 13, 2023 07:26
librz/main/rizin.c Outdated Show resolved Hide resolved
@8dcc
Copy link

8dcc commented Oct 13, 2023

(Closes #3818)

@ret2libc
Copy link
Member

IMO the PR is in good shape. @wargio ?

@wargio wargio changed the title quitconfirm in debug session solved Fix quit confirmation during debuggin session. Oct 23, 2023
@wargio wargio merged commit a15bd02 into rizinorg:dev Oct 23, 2023
44 checks passed
@wargio
Copy link
Member

wargio commented Oct 23, 2023

Thank you <3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Asking for quit confirmation twice when debugging remotely
5 participants