Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>You need to use <em>objcopy</em> to <a href="http://docs.redhat.com/docs/en-US/Red_Hat_Enterprise_Linux/4/html/Debugging_with_gdb/separate-debug-files.html" rel="noreferrer">separate the debug information</a>:</p> <pre><code>objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}" strip --strip-debug --strip-unneeded "${tostripfile}" objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}" </code></pre> <p>I use the bash script below to separate the debug information into files with a .debug extension in a .debug directory. This way I can tar the libraries and executables in one tar file and the .debug directories in another. If I want to add the debug info later on I simply extract the debug tar file and voila I have symbolic debug information.</p> <p>This is the bash script:</p> <pre><code>#!/bin/bash scriptdir=`dirname ${0}` scriptdir=`(cd ${scriptdir}; pwd)` scriptname=`basename ${0}` set -e function errorexit() { errorcode=${1} shift echo $@ exit ${errorcode} } function usage() { echo "USAGE ${scriptname} &lt;tostrip&gt;" } tostripdir=`dirname "$1"` tostripfile=`basename "$1"` if [ -z ${tostripfile} ] ; then usage errorexit 0 "tostrip must be specified" fi cd "${tostripdir}" debugdir=.debug debugfile="${tostripfile}.debug" if [ ! -d "${debugdir}" ] ; then echo "creating dir ${tostripdir}/${debugdir}" mkdir -p "${debugdir}" fi echo "stripping ${tostripfile}, putting debug info into ${debugfile}" objcopy --only-keep-debug "${tostripfile}" "${debugdir}/${debugfile}" strip --strip-debug --strip-unneeded "${tostripfile}" objcopy --add-gnu-debuglink="${debugdir}/${debugfile}" "${tostripfile}" chmod -x "${debugdir}/${debugfile}" </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload