From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10084 invoked by alias); 19 Apr 2010 16:13:28 -0000 Received: (qmail 10050 invoked by uid 22791); 19 Apr 2010 16:13:25 -0000 X-SWARE-Spam-Status: No, hits=-6.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Apr 2010 16:13:15 +0000 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o3JGDBlw017713 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 19 Apr 2010 12:13:11 -0400 Received: from host0.dyn.jankratochvil.net (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o3JGD9q4027019 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Mon, 19 Apr 2010 12:13:11 -0400 Received: from host0.dyn.jankratochvil.net (localhost [127.0.0.1]) by host0.dyn.jankratochvil.net (8.14.4/8.14.4) with ESMTP id o3JGD8kM001818; Mon, 19 Apr 2010 18:13:08 +0200 Received: (from jkratoch@localhost) by host0.dyn.jankratochvil.net (8.14.4/8.14.4/Submit) id o3JGD8u3001817; Mon, 19 Apr 2010 18:13:08 +0200 Date: Mon, 19 Apr 2010 16:13:00 -0000 From: Jan Kratochvil To: Roy Smith Cc: gdb@sourceware.org Subject: Re: identifying shared libraries in gdb? Message-ID: <20100419161308.GA1430@host0.dyn.jankratochvil.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-08-17) X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2010-04/txt/msg00059.txt.bz2 On Wed, 14 Apr 2010 23:42:04 +0200, Roy Smith wrote: > We've got a core file from a customer and suspect that the customer may > not have the right set of shared libraries installed. On solaris dbx, we > would use "proc -map" to see the elf checksums of each loaded library and > run "elfdump -k" on the .so's that should be there and see if the > checksums match. Is the a way to do the equivalent in gdb on linux? I am aware only on build-id enabled systems (recent Fedoras, unaware of others): $ eu-unstrip -n -p `pidof sleep` 0x400000+0x206000 449e4ead03ed87773ded7ee2da232e663935f50f@0x40024c /bin/sleep /usr/lib/debug/bin/sleep.debug /bin/sleep 0x3d28400000+0x21f000 18c05f9f21450f2d5d8c61b2bfa06d55cdd0f67c@0x3d284001d8 /lib64/ld-2.11.1.so /usr/lib/debug/lib64/ld-2.11.1.so.debug /lib64/ld-2.11.1.so 0x3d28c00000+0x374000 0625835c70e0a883fc4889b45a8fcd66536ed29b@0x3d28c00280 /lib64/libc-2.11.1.so /usr/lib/debug/lib64/libc-2.11.1.so.debug /lib64/libc-2.11.1.so 0x3d29800000+0x218000 3ba0bd0cc7da6d2fa0cb7df46f74f2deefeb1911@0x3d29800248 /lib64/libpthread-2.11.1.so /usr/lib/debug/lib64/libpthread-2.11.1.so.debug /lib64/libpthread-2.11.1.so 0x3d2a000000+0x208000 f548dbf46ffc75059aee750297c6ab67c6b95d20@0x3d2a000248 /lib64/librt-2.11.1.so /usr/lib/debug/lib64/librt-2.11.1.so.debug /lib64/librt-2.11.1.so 0x7ffff5daf000+0x1000 - - - [vdso: 926] It works the same for: $ eu-unstrip -n --core=./core.1689 $ eu-readelf -n /bin/sleep | grep 'Build ID' ... Note section [ 3] '.note.gnu.build-id' of 36 bytes at offset 0x23c: Owner Data size Type GNU 20 GNU_BUILD_ID Build ID: 449e4ead03ed87773ded7ee2da232e663935f50f the hash matches as youc an see. eu-unstrip is "unstrip" and eu-readelf is "readelf" utility from the package "elfutils". Regards, Jan