Subject: Help with cordumps?

From: [email-masked]
Date: Fri, 6 Nov 1998 17:18:33 +0100

How do I get the stack trace off a fvwm2 core file?

  # gdb --corefile=core
  (gdb) where

prints the addresses only, not the function names.

Another problem might be that the corefile is from a
module, not fvwm2. Can I prevent this?

Bye

Dominik
-- 
Dominik Vogt, Hewlett-Packard GmbH, Dept. BVS
Herrenberger Str.130, 71034 Boeblingen, Germany
phone: 07031/14-4596, fax: 07031/14-3883, [email-masked]

--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: Brad Giaccio <[email-masked]>
Date: Fri, 06 Nov 1998 13:26:21 -0500 (EST)

I know I have looked at stack traces of modules beofre, I think the
solution to get function names was to compile with just -g not the -O2.
See if that helps.  But fortunatelly I don't have any cores lying around
right now so I'm not 100% sure.

Brad

-- 
--- There are two kinds of knowledge, you either know the answer or
			you know where to find it
		      -Kane, Johnson, and anonymous

---

From: [email-masked] (Paul D. Smith)
Date: 06 Nov 1998 13:54:36 -0500

%% [email-masked] writes:

  dv> How do I get the stack trace off a fvwm2 core file?

  dv>   # gdb --corefile=core
  dv>   (gdb) where

You have to provide the executable name (and path), too:

  gdb /usr/local/bin/fvwm2 core
  (gdb) bt

(where and bt (backtrace) are synonyms)

  dv> prints the addresses only, not the function names.

If you are providing the executable name, then this means you don't have
any debugging info in the executable.

If you've installed stripped, then strip has removed all that info.  You
can provide the name of an unstripped binary, even if the core was from
a stripped binary, and GDB will put it all together.  So, if you did
install-strip you should run GDB with the version in the build tree.

Or, you might have not compiled with -g in the first place.

  dv> Another problem might be that the corefile is from a
  dv> module, not fvwm2. Can I prevent this?

No, but GDB should tell you the name of the app when you start it; look
in the startup text.

If you think cores are stomping on each other you need to somehow chdir
to a new directory for each app: maybe add chdir() to the main() of
the modules.

Or, you could not start those modules while you debug the main app.

-- 
-------------------------------------------------------------------------------
 Paul D. Smith <[email-masked]>         Network Management Development
 "Please remain calm...I may be mad, but I am a professional." --Mad Scientist
-------------------------------------------------------------------------------
   These are my opinions---Nortel Networks takes no responsibility for them.
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm-workers" in the
body of a message to [email-masked].
To report problems, send mail to [email-masked].

---

From: [email-masked] (Paul D. Smith)
Date: 09 Nov 1998 00:06:08 -0500

%% Brad Giaccio <[email-masked]> writes:

  bg> I know I have looked at stack traces of modules beofre, I think the
  bg> solution to get function names was to compile with just -g not the -O2.

This depends completely on your compiler.  Some compilers won't allow
you to provide both -g and -O in the same object file (sometimes not
even in the same link!)

However, GCC (and, probably, most modern compilers) do allow and even
encourage this (note there are some warnings, for example, which won't
be issued unless optimization is enabled).

It can, of course, be a little odd debugging these apps since (esp. on
RISC systems where pipeline optimizations, etc. come into play) the code
pointer can skip around a lot, moving you what appears to be _backwards_
in the code as you step, sometimes... :)

GNU autoconf tests for this and doesn't enable optimization (as I
recall) if your compiler doesn't support both -g and -O at the same
time.