diff options
author | Peter Foley <pefoley2@verizon.net> | 2013-04-13 17:11:26 -0400 |
---|---|---|
committer | Peter Foley <pefoley2@verizon.net> | 2013-04-13 20:17:44 -0400 |
commit | ffe09728cb829016dbbe24ffc5ed10cfc15cfd5c (patch) | |
tree | 135ebc2fc15ab4d69bfa76f6b6daed612c38278f /solenv | |
parent | fd3a23ce33bdec454273ba2bb3ea307b8420bcc0 (diff) |
adapt gdb pretty-printers to libmerged
Change-Id: I80236f3c69abe713ddfa8111e8ff76f83954def4
Diffstat (limited to 'solenv')
-rw-r--r-- | solenv/Package_gdb.mk | 13 | ||||
-rwxr-xr-x | solenv/bin/install-gdb-printers | 28 | ||||
-rw-r--r-- | solenv/gdb/autoload.template | 6 |
3 files changed, 34 insertions, 13 deletions
diff --git a/solenv/Package_gdb.mk b/solenv/Package_gdb.mk index 946bc0734c71..1f2f5b8dd4b4 100644 --- a/solenv/Package_gdb.mk +++ b/solenv/Package_gdb.mk @@ -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)) diff --git a/solenv/bin/install-gdb-printers b/solenv/bin/install-gdb-printers index c478929796fc..9f94d10f2718 100755 --- a/solenv/bin/install-gdb-printers +++ b/solenv/bin/install-gdb-printers @@ -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: diff --git a/solenv/gdb/autoload.template b/solenv/gdb/autoload.template index 2dbfa0ab13fd..f6d5e7a7a4a1 100644 --- a/solenv/gdb/autoload.template +++ b/solenv/gdb/autoload.template @@ -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 |