From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1219 invoked by alias); 18 May 2009 21:27:55 -0000 Received: (qmail 1209 invoked by uid 22791); 18 May 2009 21:27:54 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS X-Spam-Check-By: sourceware.org Received: from va3ehsobe001.messaging.microsoft.com (HELO VA3EHSOBE001.bigfish.com) (216.32.180.11) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 18 May 2009 21:27:50 +0000 Received: from mail96-va3-R.bigfish.com (10.7.14.247) by VA3EHSOBE001.bigfish.com (10.7.40.21) with Microsoft SMTP Server id 8.1.340.0; Mon, 18 May 2009 21:27:47 +0000 Received: from mail96-va3 (localhost.localdomain [127.0.0.1]) by mail96-va3-R.bigfish.com (Postfix) with ESMTP id 405665A81BD for ; Mon, 18 May 2009 21:27:47 +0000 (UTC) X-BigFish: VPS-3(zz4015L1442Jzz1202hzzz2ei6bh43j64h) X-Spam-TCS-SCL: 3:0 X-FB-SS: 5, Received: by mail96-va3 (MessageSwitch) id 1242682065549311_17901; Mon, 18 May 2009 21:27:45 +0000 (UCT) Received: from MAEDG2.ets.enterasys.com (unknown [134.141.3.138]) (using TLSv1 with cipher AES128-SHA (128/128 bits)) (No client certificate requested) by mail96-va3.bigfish.com (Postfix) with ESMTP id 7C476960053 for ; Mon, 18 May 2009 21:27:45 +0000 (UTC) Received: from macas-nlb.ets.enterasys.com (134.141.79.22) by MAEDG2.ets.enterasys.com (134.141.168.76) with Microsoft SMTP Server (TLS) id 8.1.240.5; Mon, 18 May 2009 17:27:04 -0400 Received: from MAEXCEVS2.ets.enterasys.com ([fe80::18b4:7273:44af:a770]) by macas2.ets.enterasys.com ([fe80::f9b5:1310:4e45:498a%10]) with mapi; Mon, 18 May 2009 17:27:44 -0400 From: "Garrod, David" To: "gdb@sourceware.org" Date: Mon, 18 May 2009 21:27:00 -0000 Subject: How can I use the call command when analyzing a core Message-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 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: 2009-05/txt/msg00124.txt.bz2 I have a core file for a very complex program that I'm trying to analyze us= ing gdb. The program has lots of internal routines that if I were able to c= all them would print out all sorts of interesting information about interna= l data structures. These data structures are complex and more importantly c= omplexly linked. Consequently it is not practicable to write gdb macros etc. Yes I know the program should have been designed to call these dump routine= s before aborting. But in this case that would not have been easy because I= 'm analyzing a SEGV. If I was doing live debugging I could of course do a: call the_routine_that_dumps_all_the_interesting_structures() but if I try that from debugging a core file I get: (gdb) call a() You can't do that without a process to debug. Now of course I realize that if I was doing cross debugging to another arch= itecture this wouldn't be feasible. But in my case I'm debugging a core fil= e that was produced on exactly the same architecture as the one that cored.= So I can't see why this is not possible in theory. I've searched the web a= nd surprisingly I can't seem to find references to other people wanting to = do this. I've been browsing the gdb sources trying to get a feel as to how hard it w= ould be to implement this and came to the conclusion that even if it was po= ssible learning the internals of gdb is a massive task (even though I've da= bbled in them a little before). So in summary my questions from this post are: 1) Is there any chance at all of working out how to change gdb to do "call"= when analyzing a core on the same architecture as the core was taken on? 2) If so how hard is it to do and could I get some pointers on where to sta= rt. Thanks, Dave Garrod Enterasys Networks