[issue30159] gdb autoloading python-gdb.py

2017-08-22 Thread Antoine Pitrou

Changes by Antoine Pitrou :


--
nosy: +dmalcolm

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30159] gdb autoloading python-gdb.py

2017-08-20 Thread Дилян Палаузов

Дилян Палаузов added the comment:

Alternatively install $(INSTSONAME)-gdb.py into ${LIBDIR} .  ldconfig will 
complain, when called, but this is how gcc and libisl, glib do it .

This is in anycase better than the current approach, as it lets gdb 
automatically load the -gdb.py file.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30159] gdb autoloading python-gdb.py

2017-05-10 Thread STINNER Victor

Changes by STINNER Victor :


--
nosy: +haypo

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30159] gdb autoloading python-gdb.py

2017-05-06 Thread Дилян Палаузов

Changes by Дилян Палаузов :


--
components: +Build

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30159] gdb autoloading python-gdb.py

2017-05-06 Thread Дилян Палаузов

Дилян Палаузов added the comment:

This is what I mean.  I asked at 
https://sourceware.org/bugzilla/show_bug.cgi?id=21465 how configure.ac is 
supposed to be tweaked.

diff --git a/Makefile.pre.in b/Makefile.pre.in
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -1093,6 +1093,8 @@ $(DESTSHARED):
 
 # Install the interpreter with $(VERSION) affixed
 # This goes into $(exec_prefix)
+datadir=@datadir@
+GDB_AUTO_LOAD_SCRIPTS_DIRECTORY=@GDB_AUTO_LOAD_SCRIPTS_DIRECTORY@
 altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
@for i in $(BINDIR) $(LIBDIR); \
do \
@@ -1118,6 +1120,11 @@ altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@
$(INSTALL_SHARED) $(DLLLIBRARY) $(DESTDIR)$(BINDIR); \
else \
$(INSTALL_SHARED) $(LDLIBRARY) 
$(DESTDIR)$(LIBDIR)/$(INSTSONAME); \
+   if test ! -d 
$(DESTDIR)$(GDB_AUTO_LOAD_SCRIPTS_DIRECTORY); then \
+   echo "Creating directory 
$(GDB_AUTO_LOAD_SCRIPTS_DIRECTORY)"; \
+   $(INSTALL) -d -m $(DIRMODE) 
$(DESTDIR)$(GDB_AUTO_LOAD_SCRIPTS_DIRECTORY)/$(LIBDIR); \
+   fi; \
+   $(INSTALL_SCRIPT) Tools/gdb/libpython.py 
$(DESTDIR)$(GDB_AUTO_LOAD_SCRIPTS_DIRECTORY)/$(LIBDIR)/$(INSTSONAME)-gdb.py; \
if test $(LDLIBRARY) != $(INSTSONAME); then \
(cd $(DESTDIR)$(LIBDIR); $(LN) -sf 
$(INSTSONAME) $(LDLIBRARY)) \
fi \
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -5422,6 +5422,14 @@ if test "$have_getrandom" = yes; then
   [Define to 1 if the getrandom() function is available])
 fi
 
+AC_CHECK_PROG(gdb, gdb, found)
+if test $gdb = found; then
+  GDB_AUTO_LOAD_SCRIPTS_DIRECTORY=$(gdb -q -ex "show data-directory" -ex "show 
auto-load scripts-directory" -ex quit |sed "1d;2{N;s/\n//g; 
s/.*\"\(.*\)\".*:\(.*\)./\1 \2/}; /\$datadir/ {s/\(.*\) 
\$datadir\(.*\)/\1\2/;q}; s/.* \(.\)/\1/")
+else
+  GDB_AUTO_LOAD_SCRIPTS_DIRECTORY='${datadir}/gdb/auto-load'
+fi
+AC_SUBST(GDB_AUTO_LOAD_SCRIPTS_DIRECTORY)
+
 # generate output files
 AC_CONFIG_FILES(Makefile.pre Modules/Setup.config Misc/python.pc 
Misc/python-config.sh)
 AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue30159] gdb autoloading python-gdb.py

2017-04-25 Thread Дилян Палаузов

New submission from Дилян Палаузов:

Please install python-gdb.py in 
$(datarootdir)/gdb/auto-load/$(libdir)/libpython3.5m.so.1.0-gdb.py during "make 
install", so that programs linked towards libpython3.5m.so.1.0 will auto-load 
the -gdb.py script, when debugged.

Likewise for the other gdb versions.

An alternative to achieve the same effect is to put python-gdb.py in a 
.debug_gdb_scripts section 
(https://sourceware.org/gdb/onlinedocs/gdb/dotdebug_005fgdb_005fscripts-section.html#dotdebug_005fgdb_005fscripts-section),
 but I don't know if $(strip) removes it.

--
messages: 292260
nosy: dilyan.palauzov
priority: normal
severity: normal
status: open
title: gdb autoloading python-gdb.py

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com