From mboxrd@z Thu Jan 1 00:00:00 1970 From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Subject: Debugging information Date: Thu, 04 Jul 2013 00:19:30 +0200 Message-ID: <87mwq3477x.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:34788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuVTX-0007q7-Ph for bug-guix@gnu.org; Wed, 03 Jul 2013 18:24:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UuVTW-0007cG-H8 for bug-guix@gnu.org; Wed, 03 Jul 2013 18:24:35 -0400 Received: from hera.aquilenet.fr ([141.255.128.1]:48108) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UuVTW-0007c8-7I for bug-guix@gnu.org; Wed, 03 Jul 2013 18:24:34 -0400 Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id B4E3EF47 for ; Thu, 4 Jul 2013 00:19:31 +0200 (CEST) Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WtAaVvlaB3Vh for ; Thu, 4 Jul 2013 00:19:31 +0200 (CEST) Received: from pluto (reverse-83.fdn.fr [80.67.176.83]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 1B28A6E1 for ; Thu, 4 Jul 2013 00:19:31 +0200 (CEST) List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org Sender: bug-guix-bounces+gcggb-bug-guix=m.gmane.org@gnu.org To: bug-guix@gnu.org Hello, Commit be58d01 in =E2=80=98core-updates=E2=80=99 changes =E2=80=98gnu-build= -system=E2=80=99 such that, if a package has a derivation output called =E2=80=9Cdebug=E2=80=9D, the = =E2=80=98strip=E2=80=99 phase saves debugging info in separate files there, instead of just losing it (info "(gdb) Separate Debug Files"). Currently this is an opt-in mechanism, hence commit 9bf62d9, which enables it for a few packages. I think it=E2=80=99d be great to make it op= t-out instead, but the downside is that it takes a lot of disk space; this is not a problem when using the substituter, but it means that local builds require more space, at least temporarily (the =E2=80=9Cdebug=E2=80=9D outpu= ts can be GC=E2=80=99d eventually.) For the record, the debugging output for glibc t= akes 67=C2=A0MiB, and that of Guile takes 25=C2=A0MiB. Hmm, maybe that=E2=80=99= s not that much? Anyway, here=E2=80=99s a sample session where GDB uses debugging info from = libc and libguile, both of which are installed in profile =E2=80=98foo=E2=80=99: --8<---------------cut here---------------start------------->8--- $ ./pre-inst-env guix package -p foo -i guile-2.0.9:debug -i guile-2.0.9 -i= glibc:debug The following packages will be installed: glibc-2.17 debug /nix/store/hr9rimw4zdbygxb44yddi9zkhffwfxmy-gl= ibc-2.17-debug guile-2.0.9 out /nix/store/gbcsdddb4jc3iiraly1dhkgyj95pd3nj-gu= ile-2.0.9 guile-2.0.9 debug /nix/store/5ziwsxvcfqa1dpx893kc9r9sjmq21x1f-gu= ile-2.0.9-debug 3 packages in profile $ gdb=20 GNU gdb (GDB) 7.6 Copyright (C) 2013 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law. Type "show copying" and "show warranty" for details. This GDB was configured as "x86_64-unknown-linux-gnu". For bug reporting instructions, please see: . (gdb) set debug-file-directory foo/lib/debug (gdb) file foo/bin/guile Reading symbols from /nix/store/gbcsdddb4jc3iiraly1dhkgyj95pd3nj-guile-2.0.= 9/bin/guile...Reading symbols from /nix/store/5ziwsxvcfqa1dpx893kc9r9sjmq21= x1f-guile-2.0.9-debug/lib/debug/nix/store/gbcsdddb4jc3iiraly1dhkgyj95pd3nj-= guile-2.0.9/bin/guile.debug...done. done. (gdb) b strcmp Function "strcmp" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 1 (strcmp) pending. (gdb) b scm_from_locale_string Function "scm_from_locale_string" not defined. Make breakpoint pending on future shared library load? (y or [n]) y Breakpoint 2 (scm_from_locale_string) pending. (gdb) r Starting program: /nix/store/gbcsdddb4jc3iiraly1dhkgyj95pd3nj-guile-2.0.9/b= in/guile=20 Breakpoint 1, strcmp () at ../sysdeps/x86_64/multiarch/../strcmp.S:134 134 ../sysdeps/x86_64/multiarch/../strcmp.S: No such file or directory. (gdb) disable 1 (gdb) c Continuing. warning: Could not load shared library symbols for linux-vdso.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/nix/store/ybdv89csf4sn7wbmgj9kfjjk1b0mhrl= b-glibc-2.17/lib/libthread_db.so.1". Breakpoint 2, scm_from_locale_string (str=3Dstr@entry=3D0x7ffff7b763d6 "pru= hsruhpwphuhuh") at strings.c:1583 1583 strings.c: No such file or directory. --8<---------------cut here---------------end--------------->8--- The important thing here is =E2=80=98set debug-file-directory=E2=80=99, whi= ch tells GDB where to look for separate debugging info files. Neat, isn=E2=80=99t it? :-) I think it=E2=80=99s an important feature if we are to make software freedo= m practical. Comments? Ludo=E2=80=99.