diff options
author | Simon Marchi <simon.marchi@ericsson.com> | 2018-06-27 14:32:02 -0400 |
---|---|---|
committer | Simon Marchi <simon.marchi@ericsson.com> | 2018-06-27 14:32:02 -0400 |
commit | 141ec9f67f11a34bae5953b2923bb71fc74dd52f (patch) | |
tree | 7a79972e268c228f90e7964a0ce9362772653e63 | |
parent | 4c4e7ad46ed77f552e2624d2f711c0ce51714395 (diff) | |
download | gdb-141ec9f67f11a34bae5953b2923bb71fc74dd52f.zip gdb-141ec9f67f11a34bae5953b2923bb71fc74dd52f.tar.gz gdb-141ec9f67f11a34bae5953b2923bb71fc74dd52f.tar.bz2 |
Copy gdb-gdb.py to build dir
I have thought for a long time how nice it would be to have cool pretty
printers for GDB's internal types. Well, turns out there are few
already in gdb-gdb.py! Unfortunately, if you build GDB outside of the
source directory, that file never gets loaded. top-gdb will look for a
file called
../path/to/build/gdb/gdb-gdb.py
but that file is in the source directory at
../path/to/src/gdb/gdb-gdb.py
This patch makes it so we copy it to the build directory, just like we
do for gdb-gdb.gdb. With this, I can at least see the file getting
automatically loaded:
(top-gdb) info pretty-printer
global pretty-printers:
builtin
mpx_bound128
objfile /home/emaisin/build/binutils-gdb/gdb/gdb pretty-printers:
type_lookup_function
I noticed that running "make" didn't re-generate gdb-gdb.py from
gdb-gdb.py.in. That's because it's copied when running the configure
script and that's it. I added a rule in the Makefile for that (and for
gdb-gdb.gdb too) and added them as a dependency to the "all" target.
gdb/ChangeLog:
* gdb-gdb.py: Move to...
* gdb-gdb.py.in: ... here.
* configure.ac (AC_CONFIG_FILES): Add gdb-gdb.py.
* Makefile.in (all): Add gdb-gdb.gdb and gdb-gdb.py as
dependencies.
(distclean): Remove gdb-gdb.py when cleaning.
(gdb-gdb.py, gdb-gdb.gdb): New rules.
* configure: Re-generate.
-rw-r--r-- | gdb/ChangeLog | 11 | ||||
-rw-r--r-- | gdb/Makefile.in | 11 | ||||
-rwxr-xr-x | gdb/configure | 9 | ||||
-rw-r--r-- | gdb/configure.ac | 2 | ||||
-rw-r--r-- | gdb/gdb-gdb.py.in (renamed from gdb/gdb-gdb.py) | 0 |
5 files changed, 29 insertions, 4 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c791add..644aed8 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,14 @@ +2018-06-27 Simon Marchi <simon.marchi@ericsson.com> + + * gdb-gdb.py: Move to... + * gdb-gdb.py.in: ... here. + * configure.ac (AC_CONFIG_FILES): Add gdb-gdb.py. + * Makefile.in (all): Add gdb-gdb.gdb and gdb-gdb.py as + dependencies. + (distclean): Remove gdb-gdb.py when cleaning. + (gdb-gdb.py, gdb-gdb.gdb): New rules. + * configure: Re-generate. + 2018-06-27 Pedro Alves <palves@redhat.com> * proc-service.c (get_ps_regcache): New. diff --git a/gdb/Makefile.in b/gdb/Makefile.in index 354a636..5934cd6 100644 --- a/gdb/Makefile.in +++ b/gdb/Makefile.in @@ -1607,7 +1607,7 @@ generated_files = \ # Flags needed to compile Python code PYTHON_CFLAGS = @PYTHON_CFLAGS@ -all: gdb$(EXEEXT) $(CONFIG_ALL) +all: gdb$(EXEEXT) $(CONFIG_ALL) gdb-gdb.py gdb-gdb.gdb @$(MAKE) $(FLAGS_TO_PASS) DO=all "DODIRS=`echo $(SUBDIRS) | sed 's/testsuite//'`" subdir_do # Rule for compiling .c files in the top-level gdb directory. @@ -1983,7 +1983,8 @@ distclean: clean rm -f gdbserver/config.status gdbserver/config.log rm -f gdbserver/tm.h gdbserver/xm.h gdbserver/nm.h rm -f gdbserver/Makefile gdbserver/config.cache - rm -f nm.h config.status config.h stamp-h gdb-gdb.gdb jit-reader.h + rm -f nm.h config.status config.h stamp-h b jit-reader.h + rm -f gdb-gdb.py gdb-gdb.gdb rm -f y.output yacc.acts yacc.tmp y.tab.h rm -f config.log config.cache rm -f Makefile @@ -2060,6 +2061,12 @@ jit-reader.h: $(srcdir)/jit-reader.in gcore: $(srcdir)/gcore.in $(SHELL) config.status $@ +gdb-gdb.py: $(srcdir)/gdb-gdb.py.in + $(SHELL) config.status $@ + +gdb-gdb.gdb: $(srcdir)/gdb-gdb.gdb.in + $(SHELL) config.status $@ + config.h: stamp-h ; @true stamp-h: $(srcdir)/config.in config.status CONFIG_HEADERS=config.h:config.in \ diff --git a/gdb/configure b/gdb/configure index 24e8968..d3a3bbe 100755 --- a/gdb/configure +++ b/gdb/configure @@ -17789,7 +17789,7 @@ fi ac_config_files="$ac_config_files gcore" -ac_config_files="$ac_config_files Makefile gdb-gdb.gdb doc/Makefile data-directory/Makefile" +ac_config_files="$ac_config_files Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile" cat >confcache <<\_ACEOF @@ -18516,6 +18516,7 @@ do "gcore") CONFIG_FILES="$CONFIG_FILES gcore" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "gdb-gdb.gdb") CONFIG_FILES="$CONFIG_FILES gdb-gdb.gdb" ;; + "gdb-gdb.py") CONFIG_FILES="$CONFIG_FILES gdb-gdb.py" ;; "doc/Makefile") CONFIG_FILES="$CONFIG_FILES doc/Makefile" ;; "data-directory/Makefile") CONFIG_FILES="$CONFIG_FILES data-directory/Makefile" ;; @@ -19158,6 +19159,12 @@ xconfig.h:config.in) echo > stamp-h ;; esac ;; + "gdb-gdb.py":F) +case x$CONFIG_HEADERS in +xconfig.h:config.in) +echo > stamp-h ;; +esac + ;; "doc/Makefile":F) case x$CONFIG_HEADERS in xconfig.h:config.in) diff --git a/gdb/configure.ac b/gdb/configure.ac index aa22d1d..44b6c62 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -2305,7 +2305,7 @@ fi GDB_AC_TRANSFORM([gdb], [GDB_TRANSFORM_NAME]) GDB_AC_TRANSFORM([gcore], [GCORE_TRANSFORM_NAME]) AC_CONFIG_FILES([gcore], [chmod +x gcore]) -AC_CONFIG_FILES([Makefile gdb-gdb.gdb doc/Makefile data-directory/Makefile], +AC_CONFIG_FILES([Makefile gdb-gdb.gdb gdb-gdb.py doc/Makefile data-directory/Makefile], [ case x$CONFIG_HEADERS in xconfig.h:config.in) diff --git a/gdb/gdb-gdb.py b/gdb/gdb-gdb.py.in index b8bb1ad..b8bb1ad 100644 --- a/gdb/gdb-gdb.py +++ b/gdb/gdb-gdb.py.in |