Files
assembly/x86_64/debug.sh
2019-03-11 19:00:28 +01:00

15 lines
302 B
Bash

#!/bin/bash
if [ -z "$1" ]; then
echo "Provide the program to debug as first argument"
exit 1
fi
if [ ! -x "$1" ]; then
echo "$1 is not an executable file"
exit 1
fi
breakPoint="$(readelf -h $1 | egrep -i "entry" | egrep -o "0x[a-f0-9]+")"
gdbtui -q -ex "layout asm" -ex "break *$breakPoint" $1