0

The requirement is to use GNU strip to discard the symbols from an object file, and save the symbols. Later on, if there are any core dumps of this object file, we have to include the symbols to check the core dumps. How can we accomplish this task? Thanks in advance!

Derui Si
  • 1,085
  • 1
  • 9
  • 13
  • 1
    You are probably looking for [this](http://stackoverflow.com/questions/866721/how-to-generate-gcc-debug-symbol-outside-the-build-target). – jxh Jul 31 '12 at 14:20

2 Answers2

1

The simple solution would be to keep a copy of the binary before you strip it. Then you can use the unstripped version to investigate the core dump as these binaries will be identical except for the stripped symbol information.

So, if you have a FOO binary, do something like:

  cp FOO FOO.unstripped
  strip FOO

then run FOO and when you investigate the coredump, use FOO.unstripped.

BjoernD
  • 4,720
  • 27
  • 32
1

Different ways to get a "symbol file" are discussed here: How to generate gcc debug symbol outside the build target?

Actually, the linked question is very similar to this one.

Community
  • 1
  • 1
dasup
  • 3,815
  • 1
  • 16
  • 25