From fb76a9cb0dc333a2b6cc3883ddffd856b758eb17 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=2E=C3=87a=C4=9Flar=20Onur?= Date: Wed, 30 Nov 2005 19:47:11 +0000 Subject: [PATCH] =?UTF-8?q?=20=20=20=20*=20P=C4=B0S=C4=B0=20listesinde=20t?= =?UTF-8?q?art=C4=B1=C5=9Ft=C4=B1=C4=9F=C4=B1m=C4=B1z=20debug=20infolar?= =?UTF-8?q?=C4=B1=20paketten=20ay=C4=B1r=20de=C4=9Fi=C5=9Fiklikleri.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bu infolardan ayrı ayrı paket yapmak yerine (a-debug.pisi, b-debug.pisi v.s gibi) build-farm'de ya da isteyen geliştirici kendi makinasında /etc/pisi/pisi.conf içerisinde "debug = True " ile aktive edebilir. Paketlerin debug infoları /debug klasörü içine konuyor (klasörü yaratmak gerektiğini söylememe gerek yok sanırım :P) --- pisi/configfile.py | 2 ++ pisi/util.py | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/pisi/configfile.py b/pisi/configfile.py index 133dd6a8..a5beeb35 100644 --- a/pisi/configfile.py +++ b/pisi/configfile.py @@ -23,6 +23,7 @@ # #[build] #host = i686-pc-linux-gnu +#debug = False #jobs = "-j1" #CFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer #CXXFLAGS= -mtune=i686 -O2 -pipe -fomit-frame-pointer @@ -62,6 +63,7 @@ class BuildDefaults: """Default values for [build] section""" host = "i686-pc-linux-gnu" jobs = "-j1" + debug = False CFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer" CXXFLAGS = "-mtune=i686 -O2 -pipe -fomit-frame-pointer" LDFLAGS = "" diff --git a/pisi/util.py b/pisi/util.py index 8617836b..7ad8fea7 100644 --- a/pisi/util.py +++ b/pisi/util.py @@ -466,15 +466,32 @@ def strip_file(filepath): if ret: ctx.ui.warning(_("strip command failed for file '%s'!") % f) + def save_elf_debug(f): + """copy debug info into /debug/file.debug file""" + p = os.popen("objcopy --only-keep-debug %s /debug/%s.debug" % (f, os.path.basename(f))) + ret = p.close() + if ret: + ctx.ui.warning(_("objcopy (keep-debug) command failed for file '%s'!") % f) + + """mark binary/shared objects to use /debug/file.debug""" + p = os.popen("objcopy --add-gnu-debuglink=/debug/%s.debug %s" % (os.path.basename(f), f)) + ret = p.close() + if ret: + ctx.ui.warning(_("objcopy (add-debuglink) command failed for file '%s'!") % f) + if "current ar archive" in o: run_strip(filepath, "-g") return True elif "SB executable" in o: + if ctx.config.values.build.debug == "True": + save_elf_debug(filepath) run_strip(filepath) return True elif "SB shared object" in o: + if ctx.config.values.build.debug == "True": + save_elf_debug(filepath) run_strip(filepath, "--strip-unneeded") # FIXME: warn for TEXTREL return True