-
Notifications
You must be signed in to change notification settings - Fork 849
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
Running setup.sh on installed Pwndbg should be more clear #1394
Comments
@disconnect3d Could I take this? |
@Cycatz Hi, sure. |
@disconnect3d I have an idea: we can mark the region of the configs added by the setup script, such as Thus we can remove the config between the comments when user want to overwrite, and it also avoids some false positives when simply grepping "pwndbg" in |
@Cycatz We can do so, but will it actually improve anything? I mean, the user could still put anything in between that and may want to have those preserved on another pwndbg install :/ |
You're right, the user could still put anything in between the tags. My concern is that the condition Anyway, it's up to you to decide if the potential benefits are worth the effort of implementing this feature. |
Shall we then look for 'pwndbg/gdbinit.py' and then fallback to gdbinit.py? |
Yes, I think that's a good idea! |
Here is my rough implementation: # Check for the presence of the initializer line in the user's ~/.gdbinit file
if grep -q "pwndbg/gdbinit.py" ~/.gdbinit; then
# Ask the user if they want to proceed and override the initializer line
read -p "An initializer line was found in your ~/.gdbinit file. Do you want to proceed and override it? (y/n) " answer
# If the user does not want to proceed, exit the script
if [ "$answer" != "y" ]; then
exit 0
fi
fi
# Install all necessary dependencies
# Check for the presence of the initializer line in the user's ~/.gdbinit file again
if grep -q "pwndbg/gdbinit.py" ~/.gdbinit; then
# If so, comment it out
sed -i '/pwndbg\/gdbinit.py/ s/^/# /' ~/.gdbinit
fi
# Now we can append the line sourcing pwndbg's gdbinit script
echo "source $PWD/gdbinit.py" >> ~/.gdbinit
|
@Cycatz Can you just send this as a pull request? :) |
Sure! I will clean the file up and issue a PR in these two days. |
Fixed in #1620 |
@disconnect3d anything left to be done here or can this be closed? |
I think we are good to close it. Thanks again! |
We have this at the end of our setup.sh:
pwndbg/setup.sh
Lines 157 to 160 in f01f932
This can be confusing for users when they try to install Pwndbg for the second time but they haven't cleared the ~/.gdbinit file.
I guess we should:
source <gdbinit.py>
in~/.gdbinit
as the very first thing in setup.shsource ...
line to~/.gdbinit
at the end of setup.shThe text was updated successfully, but these errors were encountered: