# HG changeset patch # User John W. Eaton # Date 1267117359 18000 # Node ID 9126d71f53aaaa90ef0b51c6bcce9d80fffc16d3 # Parent ec05728ce7f087a9e2f9f323f0814b25873714f1 add gdbinit file to sources diff -r ec05728ce7f0 -r 9126d71f53aa ChangeLog --- a/ChangeLog Thu Feb 25 14:45:32 2010 +0100 +++ b/ChangeLog Thu Feb 25 12:02:39 2010 -0500 @@ -1,3 +1,10 @@ +2010-02-25 John W. Eaton + + * gdbinit: New file. + * Makefile.am (EXTRA_DIST): Add it to the list. + (all-local): Depend on .gdbinit. + (.gdbinit): New rule. + 2010-02-22 John W. Eaton * boostrap: Update from gnulib/build-aux/bootstrap. diff -r ec05728ce7f0 -r 9126d71f53aa Makefile.am --- a/Makefile.am Thu Feb 25 14:45:32 2010 +0100 +++ b/Makefile.am Thu Feb 25 12:02:39 2010 -0500 @@ -52,6 +52,7 @@ ROADMAP \ SENDING-PATCHES \ autogen.sh \ + gdbinit \ missing \ mk-opts.pl \ mkinstalldirs \ @@ -102,7 +103,7 @@ nodist_octinclude_HEADERS = config.h -all-local: $(bin_SCRIPTS) $(INFO_FILES) +all-local: $(bin_SCRIPTS) $(INFO_FILES) .gdbinit @echo "" @echo "Octave successfully built. Now choose from the following:" @echo "" @@ -154,6 +155,13 @@ @$(do_subst_script_vals) chmod a+rx "$@" +.gdbinit: gdbinit + if [ -f .gdbinit ]; then \ + echo "refusing to overwrite .gdbinit with newer version from $<" 1>&2; \ + else \ + cp $< $@; \ + fi + BUGS INSTALL.OCTAVE: $(MAKE) -C doc ../$@ .PHONY: BUGS INSTALL.OCTAVE diff -r ec05728ce7f0 -r 9126d71f53aa gdbinit --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/gdbinit Thu Feb 25 12:02:39 2010 -0500 @@ -0,0 +1,48 @@ +## Helpful macros for debugging Octave. + +## Display a dim-vector object. + +define display-dims + echo ndims: \ + output $arg0.rep[-1] + echo \ndims: \ + output *$arg0.rep@$arg0.rep[-1] + echo \n + dont-repeat +end + +## Display a dense array object. + +define display-dense-array + echo array object: \ + output $arg0 + echo \ndimensions:\n + display-dims $arg0.dimensions + echo \nrep = \ + output *$arg0.rep + echo \nrep.data = \ + output *$arg0.rep.data@$arg0.rep.len + echo \n + dont-repeat +end + +## Display a sparse array object. + +define display-sparse-array + echo sparse object: \ + output $arg0 + echo \ndimensions.rep[0] = \ + display-dims $arg0.dimensions + echo \ndimensions.rep[1] = \ + output $arg0.dimensions.rep[1] + echo \nrep = \ + output *$arg0.rep + echo \nrep.d = \ + output *$arg0.rep.d@$arg0.rep.nzmx + echo \nrep.r = \ + output *$arg0.rep.r@$arg0.rep.nzmx + echo \nrep.c = \ + output *$arg0.rep.c@($arg0.rep.ncols+1) + echo \n + dont-repeat +end