From 199f50ff7265995adce135dafbf71bed2573fe4f Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Wed, 12 Jun 2013 09:17:33 -0600 Subject: [PATCH] add hack-gdbinit Makefile target This target adds the needed "source" line to your ~/.gdbinit so that this extension will always be available. --- Makefile | 7 +++++++ README | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 6aafa22..10e5dd7 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/README b/README index 28e6e05..625ef2a 100644 --- a/README +++ b/README @@ -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