title: GDB - Loading Debug information from external ".sym" files
body: <p>I am attempting to carry out postmortem analysis of a crashed binary, "TestApp", on a linux system.</p>
  
  <p>I have a copy of the binaries and and shared objects that are copied onto the device in a path:</p>
  
  <pre><code>/usr/public/target
  </code></pre>
  
  <p>This folder contains all the binaries in question in the directory structure used on the system under test, ie:</p>
  
  <pre><code>/usr/public/target/sbin/TestApp
  /usr/public/target/lib/TestAppLib.so
  /usr/public/target/usr/lib/TestAppAPILib.so
  </code></pre>
  
  <p>The automated build process strips the debug information from the binaries, and stores them in external, symbol files, all under:</p>
  
  <pre><code>/usr/public/target_external_symbols
  </code></pre>
  
  <p>So the symbol information for the above binaries would exist in files named:</p>
  
  <pre><code>/usr/public/target_external_symbols/sbin/TestApp.sym
  /usr/public/target_external_symbols/lib/TestAppLib.so.sym
  /usr/public/target_external_symbols/usr/lib/TestAppAPILib.so.sym
  </code></pre>
  
  <p>How do I get GDB to be aware of the existence of these external symbols and to load them?</p>
  
  <p>I typically invoke GDB via:</p>
  
  <pre><code>gdb TestApp TestApp.core
  </code></pre>
  
  <p>I've referred to other articles on creating a test <code>.gdbinit</code> file and passing it to GDB via the <code>-command</code> argument, but it doesn't appear to work. Every time I attempt to get a backtrace from my core file, I get an indication from GDB that it cannot open the debug symbols. Any help in resolving this is appreciated.</p>
  
  <pre><code>(gdb) info shared
  From        To          Syms Read   Shared Object Library
  0x78000000  0x780061e8  Yes (*)     /usr/public/target/lib/TestAppLib.so
  0x78010000  0x7806e60c  Yes (*)     /usr/public/target/usr/lib/TestAppAPILib.so
  0x78070000  0x78091d2c  Yes (*)     /usr/public/target/lib/libm.so.2
  (*): Shared library is missing debugging information.
  </code></pre>
  
  <p>Thank you.</p>