Last active
August 29, 2015 14:11
-
-
Save icholy/51e9893d3fbb3db0a102 to your computer and use it in GitHub Desktop.
This file contains 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 | |
# Examples: | |
# | |
# //break | |
# //break if foo == 5 | |
# | |
# Usage: | |
# | |
# $ ./gdb_break *.c > breakpoints.txt | |
# $ gdb -x breakpoints.txt --args main | |
# | |
grep //break $@ -RHn | while read line; do | |
local _bp_loc=$(echo $line | cut -d: -f-2) | |
local _bp_cond=$(echo $line | awk '{ split($0, a, "//break"); print a[2] }') | |
echo "break ${_bp_loc}${_bp_cond}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment