Skip to content
Snippets Groups Projects
Commit e2c442a7 authored by Martin Stjernholm's avatar Martin Stjernholm
Browse files

Pass on the argument value of the magic --gdb arg to gdb. Useful to

start pike in gdb and run it right away with pike --gdb=r ...

Rev: bin/pike.in:1.9
parent e2aa75c2
No related branches found
No related tags found
No related merge requests found
#!/bin/sh #!/bin/sh
# Runs Pike directly from the build directory. # Runs Pike directly from the build directory.
#
# If the first argument is --gdb, Pike will be loaded inside a gdb
# session with the remaining arguments. If --gdb has a value, e.g.
# --gdb=run, the value will be passed as a command to be executed
# initially by gdb.
BUILDDIR="BUILDDIR" BUILDDIR="BUILDDIR"
...@@ -8,7 +13,8 @@ if test $BUILDDIR = BUILDDIR; then ...@@ -8,7 +13,8 @@ if test $BUILDDIR = BUILDDIR; then
exit 1 exit 1
fi fi
if test x"$1" = x--gdb; then if expr x"$1" : 'x--gdb' >/dev/null; then
gdbarg=`expr "$1" : '--gdb=\(.*\)'`
shift shift
args="set args '-m$BUILDDIR/master.pike'" args="set args '-m$BUILDDIR/master.pike'"
for arg do for arg do
...@@ -22,6 +28,9 @@ EOF` ...@@ -22,6 +28,9 @@ EOF`
cp .gdbinit.orig .gdbinit cp .gdbinit.orig .gdbinit
fi fi
echo $args >> .gdbinit echo $args >> .gdbinit
if test x"$gdbarg" != x; then
echo "$gdbarg" >> .gdbinit
fi
gdb "$BUILDDIR/pike" gdb "$BUILDDIR/pike"
rm .gdbinit rm .gdbinit
test -f .gdbinit.orig && mv .gdbinit.orig .gdbinit test -f .gdbinit.orig && mv .gdbinit.orig .gdbinit
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment