Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Aug 2013 10:05:08 -0600
From:      Gary Aitken <vagabond@blackfoot.net>
To:        FreeBSD Mailing List <freebsd-questions@freebsd.org>
Subject:   how to find where a port came from and rebuild with debug symbols
Message-ID:  <5218D9B4.1060003@blackfoot.net>

next in thread | raw e-mail | index | archive | help
If I have a core file that implicates a library:
  #0  0x000000080525cab0 in wxWindow::DoSetSize () from /usr/local/lib/libwx_gtk2u_core-2.8.so.0
and 
#16 0x00000008056bf720 in wxAuiManager::Update () from /usr/local/lib/libwx_gtk2u_aui-2.8.so.0

and I want to find out which port these came from so I can rebuild it
with debug symbols, how do I do that?

$ nm -a /usr/local/lib/libwx_gtk2u_core-2.8.so.0
nm: /usr/local/lib/libwx_gtk2u_core-2.8.so.0: no symbols

Clearly I'm doing something wrong there...

So I try guessing:

pkg_info
   pkg_info | grep gtk2
linux-f10-gtk2-2.14.7_4 GTK+ library, version 2.X (Linux Fedora 10)
webkit-gtk2-1.8.3_2 An opensource browser engine
wxgtk2-common-2.8.12_2 The wxWidgets GUI toolkit (common files)
wxgtk2-unicode-2.8.12_2 The wxWidgets GUI toolkit (Unicode)

more guessing:

locate wxgtk2-common
/var/db/pkg/wxgtk2-common-2.8.12_2
/var/db/pkg/wxgtk2-common-2.8.12_2/+COMMENT
/var/db/pkg/wxgtk2-common-2.8.12_2/+CONTENTS
/var/db/pkg/wxgtk2-common-2.8.12_2/+DESC
/var/db/pkg/wxgtk2-common-2.8.12_2/+MTREE_DIRS
/var/db/pkg/wxgtk2-common-2.8.12_2/+REQUIRED_BY
/var/db/pkg/wxgtk2-common-2.8.12_2/distfiles

After grousing around I find 
drwxr-xr-x  4 root  wheel  512 Aug 24 09:38 x11-toolkits/wxgtk28
drwxr-xr-x  2 root  wheel  512 Aug  8 10:51 x11-toolkits/wxgtk28-common
drwxr-xr-x  2 root  wheel  512 Feb 17  2013 x11-toolkets/wxgtk28-contrib
drwxr-xr-x  2 root  wheel  512 Feb 17  2013 x11-toolkits/wxgtk28-contrib-common
drwxr-xr-x  2 root  wheel  512 Aug  8 10:51 x11-toolkits/wxgtk28-unicode
drwxr-xr-x  2 root  wheel  512 Feb 17  2013 x11-toolkits/wxgtk28-unicode-contrib

After doing a make of x11-toolkits/wxgtk28
I find a bunch of lib*.so in ../work/wxGTK-2.8.12/lib

and doing nm on them I discover what I want is in
  libwx_gtk2_aui-2.8.so
  libwx_gtk2_core-2.8.so

However, neither of these exists in /usr/local/lib; only a bunch of other libux
things.

So..

ldd /usr/local/bin/hugin | grep libwx
        libwx_baseu-2.8.so.0 => /usr/local/lib/libwx_baseu-2.8.so.0 (0x804d07000)
        libwx_gtk2u_core-2.8.so.0 => /usr/local/lib/libwx_gtk2u_core-2.8.so.0 (0x80506d000)
        libwx_gtk2u_aui-2.8.so.0 => /usr/local/lib/libwx_gtk2u_aui-2.8.so.0 (0x80568e000)
        libwx_gtk2u_xrc-2.8.so.0 => /usr/local/lib/libwx_gtk2u_xrc-2.8.so.0 (0x805904000)
        libwx_gtk2u_html-2.8.so.0 => /usr/local/lib/libwx_gtk2u_html-2.8.so.0 (0x805ba6000)
        libwx_baseu_xml-2.8.so.0 => /usr/local/lib/libwx_baseu_xml-2.8.so.0 (0x805e65000)
        libwx_gtk2u_adv-2.8.so.0 => /usr/local/lib/libwx_gtk2u_adv-2.8.so.0 (0x80606f000)
        libwx_gtk2u_gl-2.8.so.0 => /usr/local/lib/libwx_gtk2u_gl-2.8.so.0 (0x806356000)
        libwx_baseu_net-2.8.so.0 => /usr/local/lib/libwx_baseu_net-2.8.so.0 (0x806564000)

help?

And, assuming I find the right port, how do I rebuild / install it with symbols left in?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?5218D9B4.1060003>