Date: Thu, 1 Aug 1996 14:40:50 +0200 (MET DST) From: Jean-Paul POIRET <jpp@vtcom.fr> To: FreeBSD questions <freebsd-questions@freebsd.org> Subject: Re: Can really gdb examine a core file ? Message-ID: <Pine.BSF.3.91.960801142601.12538C-100000@deepthought.sv.vtcom.fr> In-Reply-To: <9608011050.AA17216@cssmuc.frt.dec.com>
next in thread | previous in thread | raw e-mail | index | archive | help
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
>
>
>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.91.960801142601.12538C-100000>
