adapt gdb pretty-printers to libmerged

Change-Id: I80236f3c69abe713ddfa8111e8ff76f83954def4
This commit is contained in:
Peter Foley 2013-04-13 17:11:26 -04:00
parent fd3a23ce33
commit ffe09728cb
3 changed files with 34 additions and 13 deletions

View file

@ -28,11 +28,16 @@
$(eval $(call gb_Package_Package,solenv_gdb,$(call gb_CustomTarget_get_workdir,solenv/gdb)))
$(eval $(call gb_Package_add_files,solenv_gdb,lib,\
$(call gb_Library_get_runtime_filename,cppu).3-gdb.py \
$(call gb_Library_get_runtime_filename,sal).3-gdb.py \
$(if $(MERGELIBS), \
$(if $(filter ALL,$(MERGELIBS)), \
$(call gb_Library_get_runtime_filename,urelibs)-gdb.py, \
$(call gb_Library_get_runtime_filename,cppu).3-gdb.py \
$(call gb_Library_get_runtime_filename,sal).3-gdb.py \
$(call gb_Library_get_runtime_filename,sw)-gdb.py \
) \
$(call gb_Library_get_runtime_filename,merged)-gdb.py, \
$(call gb_Library_get_runtime_filename,svl)-gdb.py \
$(call gb_Library_get_runtime_filename,sw)-gdb.py \
$(call gb_Library_get_runtime_filename,tl)-gdb.py \
$(call gb_Library_get_runtime_filename,tl)-gdb.py) \
))
$(eval $(call gb_Package_use_custom_target,solenv_gdb,solenv/gdb))

View file

@ -84,6 +84,7 @@ make_autoload() {
local dir="${DESTDIR}${autoloaddir}"
${flat} || dir="${dir}/$2"
local lib="${dir}/$3"
local merged="$4"
if ! ${flat}; then
local resolved="$(readlink "${DESTDIR}${installdir}/$2/$3")"
@ -103,8 +104,13 @@ make_autoload() {
fi
else
[[ -f ${lib}-gdb.py ]] && rm -f "${lib}-gdb.py"
sed -e "s!%PYTHONDIR%!${pythondir}!" -e "s!%MODULE%!libreoffice.$1!" \
"${GDBDIR}/autoload.template" > "${lib}-gdb.py"
if [[ -n "${merged}" ]]; then
sed -e "s!%PYTHONDIR%!${pythondir}!" -e "s!%MODULES%!${*:5}!" \
"${GDBDIR}/autoload.template" > "${lib}-gdb.py"
else
sed -e "s!%PYTHONDIR%!${pythondir}!" -e "s!%MODULES%!$1!" \
"${GDBDIR}/autoload.template" > "${lib}-gdb.py"
fi
fi
}
@ -168,10 +174,18 @@ if [[ ${DESTDIR}${pythondir} != ${GDBDIR} ]]; then
cp -pr "${GDBDIR}/libreoffice" "${DESTDIR}${pythondir}"
fi
make_autoload cppu ure-link/lib libuno_cppu."$DYLIB".3
make_autoload sal ure-link/lib libuno_sal."$DYLIB".3
make_autoload svl program libsvllo."$DYLIB"
make_autoload sw program libswlo."$DYLIB"
make_autoload tl program libtllo."$DYLIB"
if [[ -n "${MERGELIBS}" ]]; then
make_autoload merged program libmergedlo."$DYLIB" merge svl tl `[[ ${MERGELIBS} == "ALL" ]] && echo sw`
if [[ ${MERGELIBS} == "ALL" ]]; then
make_autoload urelibs ure-link/lib liburelibs."$DYLIB" merge cppu sal
else
make_autoload cppu ure-link/lib libuno_cppu."$DYLIB".3
make_autoload sal ure-link/lib libuno_sal."$DYLIB".3
make_autoload sw program libswlo."$DYLIB"
fi
else
make_autoload svl program libsvllo."$DYLIB"
make_autoload tl program libtllo."$DYLIB"
fi
# vim:set shiftwidth=4 softtabstop=4 expandtab:

View file

@ -27,6 +27,7 @@
import os.path
import sys
import importlib
import gdb
@ -36,8 +37,9 @@ if gdb.current_objfile():
if pythondir not in sys.path:
sys.path.insert(0, pythondir)
from %MODULE% import register_pretty_printers
register_pretty_printers(gdb.current_objfile())
for mod in str.split("%MODULES%"):
module=importlib.import_module("libreoffice."+mod)
module.register_pretty_printers(gdb.current_objfile())
try:
import boost