From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27470 invoked by alias); 9 Dec 2008 17:09:50 -0000 Received: (qmail 27458 invoked by uid 22791); 9 Dec 2008 17:09:49 -0000 X-Spam-Check-By: sourceware.org Received: from mta.netezza.com (HELO netezza.com) (12.148.248.132) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 09 Dec 2008 17:09:14 +0000 Received: from ([172.29.50.72]) by mta.netezza.com with SMTP id 4441227.8131479; Tue, 09 Dec 2008 12:09:09 -0500 Received: from [172.29.82.111] ([172.29.82.111]) by mail1.netezza.com with Microsoft SMTPSVC(6.0.3790.3959); Tue, 9 Dec 2008 12:09:09 -0500 Subject: Classifying core files? From: Paul Smith Reply-To: psmith@gnu.org To: gdb@sourceware.org Content-Type: text/plain Date: Tue, 09 Dec 2008 17:09:00 -0000 Message-Id: <1228842548.2017.64.camel@psmith-ubeta.netezza.com> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit 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: 2008-12/txt/msg00024.txt.bz2 Hi all; I have a situation where I'm collecting cores from a wide variety of (well-defined) systems: there are cores from other architectures (where I need a cross debugger), cores from different executables, cores that require special extra shared objects to be available (because they dlopen() things), etc. What I have at my disposal is a bunch of local and cross-debuggers and gcc/binutils suites, a bunch of potential executables that cores could come from, and a bunch of shared objects that might or might not have been loaded. And, a core file. What I'm trying to do is generate a script that can determine the right set of GDB executable, GDB command line options (to "set sysroot", etc.), etc., starting with only the core file itself as information, then invoke GDB properly. What options do I have to help me do this? About all I have is using "file" or maybe "readelf" to find the hardware type, so I can guess more-or-less which cross-GDB I might need. Then when I start GDB with the core it will say something like "Core was generated by `someapp'." Once I have the executable I can use "info shared" to find missing dynamic objects. This seems brittle, esp. the first part using "file" and parsing the output of GDB to find the executable. Does anyone have any better options? Are there any "info" operations in GDB I could use, given _only_ the core file, that can help me? What about some way of tagging the executables themselves, either with a string or somehow in the executable ELF image that would get added to the core, that I could query given just the resulting core file? Any ideas would be welcome. Thanks!