[Ubuntu Daily PPA] How to install debug symbols package

Having trouble installing or compiling FreeCAD? Get help here.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

[Ubuntu Daily PPA] How to install debug symbols package

Postby NormandC » Sun Jan 29, 2017 9:59 pm

@sgrogan wrote recently that he activated the debug symbols packages on the Daily Builds PPA. (Thanks! :) )

From what I understand, this may allow to generate a more useful backtrace log, but AFAIK nobody has tested this so far.

The problem is that there is no easy way to install these debug symbols packages.

From what I was able to gather, here's what you need to do to install debug symbols packages.

Please note that you cannot use GUI tools! I tried using the Software sources GUI tool and it messed up my sources!

Note: on Kubuntu and other KDE-based desktops, please replace gksudo gedit with kdesudo kate.

First, the PPA needs one more deb line, and the file in sources.list.d needs to be edited.

On Ubuntu 14.04 LTS:

Code: Select all

gksudo gedit /etc/apt/sources.list.d/freecad-maintainers-freecad-daily-trusty.list
On Ubuntu 16.04 LTS:

Code: Select all

gksudo gedit /etc/apt/sources.list.d/freecad-maintainers-freecad-daily-xenial.list
On Ubuntu 16.10:

Code: Select all

gksudo gedit /etc/apt/sources.list.d/freecad-maintainers-freecad-daily-yakkety.list
On Ubuntu 17.04:

Code: Select all

gksudo gedit /etc/apt/sources.list.d/freecad-maintainers-freecad-daily-zesty.list
Next, we copy the first line starting with deb and ending with main, and we append /debug to the copied line.

For trusty, the new line will look like this:

Code: Select all

deb http://ppa.launchpad.net/freecad-maintainers/freecad-daily/ubuntu trusty main/debug
For other versions, "trusty" will be replaced by the proper distro name.

Save the changes and close the file.

Next, the sources list needs to be updated:

Code: Select all

sudo apt-get update
And finally we can install the debug symbols package:

Code: Select all

sudo apt-get install freecad-daily-dbgsym
The package was not listed in the Synaptic package manager even after refreshing the sources, I was only able to install it from the terminal.

Now to test! :geek:


---
Source: How to install debug symbols for installed packages?
User avatar
Kunda1
Posts: 8853
Joined: Thu Jan 05, 2017 9:03 pm

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby Kunda1 » Sun Jan 29, 2017 10:13 pm

NormandC wrote: Now to test! :geek:
Nice!
Linking https://forum.freecadweb.org/viewtopic.php?t=20007
When we get this working we should mention it in the Wiki FreeCAD Debugging page
Want to contribute back to FC? Checkout:
#lowhangingfruit | Use the Source, Luke. | How to Help FreeCAD | How to report FC bugs and features
User avatar
sgrogan
Posts: 6167
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby sgrogan » Sun Jan 29, 2017 11:50 pm

NormandC wrote:@sgrogan wrote recently that he activated the debug symbols packages on the Daily Builds PPA. (Thanks! :) )

From what I understand, this may allow to generate a more useful backtrace log, but AFAIK nobody has tested this so far.

The problem is that there is no easy way to install these debug symbols packages.
I haven't tried yet, but why wouldn't

Code: Select all

sudo apt-get install freecad-daily-dbgsym
work?
Thanks for the link, it's good to know that gdb can find the libs automatically.
"fight the good fight"
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby NormandC » Sun Jan 29, 2017 11:53 pm

sgrogan wrote: I haven't tried yet, but why wouldn't

Code: Select all

sudo apt-get install freecad-daily-dbgsym
work?
Because that's one of the first things I tried and it didn't work, the package wasn't found. You really need to edit the freecad-maintainers-freecad-daily-<version>.list file and add the main/debug line. Only then is the package found.
sgrogan wrote:it's good to know that gdb can find the libs automatically.
It's untested :D
User avatar
sgrogan
Posts: 6167
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby sgrogan » Mon Jan 30, 2017 12:01 am

NormandC wrote:Because that's one of the first things I tried and it didn't work, the package wasn't found. You really need to edit the freecad-maintainers-freecad-daily-<version>.list file and add the main/debug line. Only then is the package found.
My question was more rhetorical, I assumed that you had tried it already. The broken link at the end of your link probably explained it.
I googled around before I activated this and the debug symbols should not effect performance. This seems distinct from a debug build. Thanks for testing this NormandC! Have you crashed FreeCAD on purpose yet?
"fight the good fight"
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby NormandC » Mon Jan 30, 2017 12:05 am

sgrogan wrote:The broken link at the end of your link probably explained it.
Broken link? :?:

I read that by default, Canonical didn't want the package software (like Synaptic) to be polluted with debug packages, since most end users will never use them.
sgrogan wrote:Have you crashed FreeCAD on purpose yet?
I can't seem to leave the forum and try! :D
User avatar
sgrogan
Posts: 6167
Joined: Wed Oct 22, 2014 5:02 pm

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby sgrogan » Mon Jan 30, 2017 12:23 am

NormandC wrote: Broken link? :?:
EDIT:
from the comments ppa.launchpad.net/USER/PPA/ubuntu but it's not a real link :oops:
NormandC wrote:I can't seem to leave the forum and try! :D
FreeCAD doesn't crash easily anyway, you must work at it ;)
"fight the good fight"
User avatar
kkremitzki
Posts: 2170
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby kkremitzki » Mon Jan 30, 2017 1:07 am

Rather than doing gksudo gedit etc, it's also easy to just use sudo -e FILENAME which will open up FILENAME with whatever editor the environment variable EDITOR is set to, e.g. for me I have:

Code: Select all

$ echo $EDITOR
/usr/bin/nvim
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.
User avatar
NormandC
Posts: 18534
Joined: Sat Feb 06, 2010 9:52 pm
Location: Québec, Canada

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby NormandC » Mon Jan 30, 2017 1:22 am

Code: Select all

$ echo $EDITOR
Returns an empty line for me. I've never set this variable and wouldn't know how, which I'm pretty sure is the case for most Ubuntu users.

sudo -e FILENAME opens the file in nano Image

I'm a GUI guy, I use the terminal only when I *have* to. A terminal-based text editor is a no-go for me.
User avatar
kkremitzki
Posts: 2170
Joined: Thu Mar 03, 2016 9:52 pm
Location: Texas

Re: [Ubuntu Daily PPA] How to install debug symbols package

Postby kkremitzki » Mon Jan 30, 2017 1:37 am

NormandC wrote:

Code: Select all

$ echo $EDITOR
Returns an empty line for me. I've never set this variable and wouldn't know how, which I'm pretty sure is the case for most Ubuntu users.

sudo -e FILENAME opens the file in nano Image

I'm a GUI guy, I use the terminal only when I *have* to. A terminal-based text editor is a no-go for me.
By default Ubuntu uses nano, yeah; it's vi(m) in Centos and Arch, I believe. You can set it by, for example,

Code: Select all

echo "export EDITOR=vim" >> ~/.bashrc
But if you're a GUI guy and not a fan of nano I doubt vim would be any preferable :D this is more of an aside for people who prefer to do things in the command line.
Like my FreeCAD work? I'd appreciate any level of support via Patreon, Liberapay, or PayPal! Read more about what I do at my blog.