From owner-freebsd-questions Thu Aug 1 05:41:57 1996 Return-Path: owner-questions Received: (from root@localhost) by freefall.freebsd.org (8.7.5/8.7.3) id FAA13582 for questions-outgoing; Thu, 1 Aug 1996 05:41:57 -0700 (PDT) Received: from bourbon.pl.vtcom.fr (bourbon.pl.vtcom.fr [193.252.69.217]) by freefall.freebsd.org (8.7.5/8.7.3) with SMTP id FAA13572 for ; Thu, 1 Aug 1996 05:41:41 -0700 (PDT) Received: (from mail@localhost) by bourbon.pl.vtcom.fr (8.6.12/8.6.11) id OAA15771 for ; Thu, 1 Aug 1996 14:35:25 +0100 Received: from deepthought.sv.vtcom.fr(193.252.64.251) by bourbon.pl.vtcom.fr via smap (V1.3) id sma015767; Thu Aug 1 14:35:06 1996 Date: Thu, 1 Aug 1996 14:40:50 +0200 (MET DST) From: Jean-Paul POIRET X-Sender: jpp@deepthought.sv.vtcom.fr To: FreeBSD questions Subject: Re: Can really gdb examine a core file ? In-Reply-To: <9608011050.AA17216@cssmuc.frt.dec.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-questions@freebsd.org X-Loop: FreeBSD.org Precedence: bulk Yes, with a : gcc -static -g -o es es.c ------- the bt of gdb works. However, it seems not easy to print the global data contents: (gdb) p titi[0] $1 = 0 I tried with a single global int: --es.c----------------- | int toto; | | ... | | toto = 40; | ----------------------- (gdb) p toto $1 = 0 a "40" would be better. Thanks for your help > > jpp@vtcom.fr writes: > > Hello ! When I try a post-mortem analysis with Gdb of a C programm with a > > bss array , like this es.c : > > --------------------------- > > | int titi[1000]; | > > | f() | > > | { | > > | int l = 4; | > > | kill(getpid(),6); | > > | } | > > | main() | > > | { | > > | titi[0] = 461; | > > | f(); | > > | } | > > --------------------------- > > > > gcc -g -c es.c > > gcc -g -o es es.o > > ./es > > Abort (core dumped) > > > > Thus, I have got the core file: > > > > -rw------- 1 jpp jpp 147456 Jul 31 18:34 es.core > > > > Now, I wish to examine the core file : > > > [gdb output deleted] > > try generating a staic binary and see if that helps. gdb has problems > looking at a core dump from a dynamic binary since the shared libraries > aren't mapped any more. > > --- > Gary Jennejohn (work) gjennejohn@frt.dec.com > (home) Gary.Jennejohn@munich.netsurf.de > (play) gj@freebsd.org > > >