[Ubuntu Wiki] Update of "Debug Symbol Packages" by lathiat

Ubuntu Wiki noreply at ubuntu.com
Mon Dec 9 09:09:10 UTC 2019


Dear Wiki user,

You have subscribed to a wiki page or wiki category on "Ubuntu Wiki" for change notification.

The "Debug Symbol Packages" page has been changed by lathiat:
http://wiki.ubuntu.com/Debug%20Symbol%20Packages?action=diff&rev1=6&rev2=7

Comment:
add info about using the find-dbgsym-packages tool, unindent two sections

  }}}
   
  === Manual install of debug packages ===
-  If the package in question is the ''xserver-xorg-core'' package you can try
+ If the package in question is the ''xserver-xorg-core'' package you can try
-  {{{
+ {{{
  sudo apt-get install xserver-xorg-core-dbg
  }}}
  
-  or
+ or
-  {{{
+ {{{
  sudo apt-get install xserver-xorg-core-dbgsym
  }}}
  
  === Automatic Resolution / Installation of necessary packages ===
-  The above procedure will install the debug symbol package for a single package only. Chances are that the binary uses shared libraries in other packages and debug symbols for them might be required in order to obtain a readable stack trace or perform other debugging tasks. 
+ The above procedure will install the debug symbol package for a single package only. Chances are that the binary uses shared libraries in other packages and debug symbols for them might be required in order to obtain a readable stack trace or perform other debugging tasks. 
  
+ You can use the 'find-dbgsym-packages' command from the 'debian-goodies' package to find debug symbols for a core file, running PID or binary path.
-  You can download the following [[attachment:list-symbols-packages-v2.1.sh |shell script (list-symbols-packages-v2.1.sh)]] to resolve all the dependencies. Attaching a debugger to an already running process may require elevated privileges even if you own the process. The following invocation will print out the list of files to install. If you want to debug an instance of yelp use:
-  {{{#!highlight bash
- sudo bash ./list-symbols-packages-v2.sh -p $(pidof yelp)}}}
  
-  To automatically install them apt can be called with the input from the script. The script is invoked with {{{-t}}} for a terse output (without the descriptions of the packages) and error messages are suppressed.
+ For a binary path it only finds debug symbols for the actual binary itself, and not any dynamically linked library dependencies or other libraries loaded at runtime. For that functionality to work you need to use either a core file or running PID which is the preferred method.
  
+ This tool will find both "-dbg" and "-dbgsym" style packages. However it only finds debug symbols for apt repositories that are currently enabled and updated, so you need to ensure that you enable at least the "ddebs.ubuntu.com" archive as described elsewhere on this page and for a Launchpad PPA or the Ubuntu Cloud Archive you need to add another source line with the component changed from "main" to "main/debug".
-  {{{#!highlight bash
- sudo bash ./list-symbols-packages-v2.sh -t -p $(pidof yelp) 2>/dev/null|\
- xargs -d $'\n' sudo apt-get install }}}
  
+ {{{
+ apt install debian-goodies
+ find-dbgsym-packages [core_path|running_pid|binary_path]
+ }}}
+ 
+ If the above tool is not working for you, there is an older shell script that attempts to do this by parsing the gdb output instead however often does not work correctly.
+ 
+ You can download the following [[attachment:list-symbols-packages-v2.1.sh |shell script (list-symbols-packages-v2.1.sh)]] to resolve all the dependencies. Attaching a debugger to an already running process may require elevated privileges even if you own the process. The following invocation will print out the list of files to install.
+ {{{
+ sudo bash ./list-symbols-packages-v2.sh -p $(pidof yelp)
+ }}} To automatically install them apt can be called with the input from the script. The script is invoked with {{{-t}}} for a terse output without the descriptions of the packages and error messages are suppressed:{{{
-  /!\ Version 2 of this script makes it compatible with the newer GDB (which no longer loads all libraries at startup by default). -v2 currently only works if you run it against a currently-executing binary (i.e., with '-p $(pidof <whatever>'). The [[attachment:list-symbols-packages.sh|older version]] of the script is also available.
+ sudo bash ./list-symbols-packages-v2.sh -t -p $(pidof yelp) 2>/dev/null | xargs -d $'\n' sudo apt-get install }}} /!\ Version 2 of this script makes it compatible with the newer GDB (which no longer loads all libraries at startup by default). -v2 currently only works if you run it against a currently-executing binary (i.e., with '-p $(pidof <whatever>'). The [[attachment:list-symbols-packages.sh|older version]] of the script is also available.
  
  ----
  CategoryBugSquad CategoryDebugging



More information about the Ubuntu-bugsquad mailing list