Created
November 27, 2024 17:26
-
-
Save pollend/fd5cd55ce696fd2cf8a6e74660678676 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Get the process name as an argument | |
process_name="wf_steam.x86_64" | |
# Loop until the process is found | |
while true; do | |
# Use pgrep to find the PID of the process | |
pid=$(pgrep -f "$process_name") | |
# Check if the process was found | |
if [ -n "$pid" ]; then | |
echo "PID of $process_name is $pid" | |
# Attach gdb to the process | |
gdb -p "$pid" | |
# Exit the loop after gdb detaches | |
break | |
else | |
echo "Process $process_name not found, retrying..." | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment