add hack-gdbinit Makefile target

This target adds the needed "source" line to your ~/.gdbinit so that
this extension will always be available.
This commit is contained in:
Tom Tromey
2013-06-12 09:17:33 -06:00
parent 2667cb0617
commit 199f50ff72
2 changed files with 10 additions and 1 deletions

View File

@@ -9,3 +9,10 @@ gui/fix_signals.so: gui/fix-signals.c
clean:
-rm SourceMe.py gui/fix_signals.so
hack-gdbinit:
if test -f $$HOME/.gdbinit && `grep -q SourceMe $$HOME/.gdbinit`; then \
:; \
else \
echo "source `pwd`/SourceMe.py" >> $$HOME/.gdbinit; \
fi

4
README
View File

@@ -25,7 +25,9 @@ On Fedora I think this suffices:
sudo yum install gdb python-devel gtksourceview3 pygobject3
After you install this, type "make". Now, start gdb and source the
"SourceMe.py" file. This sets everything up.
"SourceMe.py" file. This sets everything up. If you want it to
always be available, you can use "make hack-gdbinit", which will add
the appropriate "source" line to your ~/.gdbinit.
This adds a new "gui" command to gdb. Currently the only subcommand
is "gui source", which pops up a source window. The source window