How do I step through the source code of installed packages?

Asked by Philip Ashmore

I'm a C/C++ developer new to Ubuntu but I know how to do this on other platforms.

I followed the proceedure about installing debugging symbols in

I've installed the debugging symbols for the libraries I want to, but in kdbg the stack trace just shows the function names - not the source code.

In synaptic I've enabled settings -> Repositories -> Ubuntu Software -> source code as well as specific source repositories but I can't see the source package that corresponds to an installed binary package.

Any pointers?

Question information

English Edit question
Ubuntu kdevelop Edit question
No assignee Edit question
Solved by:
Philip Ashmore
Last query:
Last reply:
Revision history for this message
Åskar (olskar) said :

Run sudo apt-get source <packagename>

Revision history for this message
Philip Ashmore (contact-philipashmore) said :

According to the apt-get man page, in the "source" command section:

"Note that source packages are not tracked like binary packages, they exist only in the current directory and are similar to downloading source tar balls.".

While this is informative, what I'm looking for is where to install them so that they're picked up by kdbg in conjunction with the debugging symbols.

For example in Fedora, kdbg would suggest what source packages to install with "debuginfo-install <pkg-name>" and that would get me the debugging symbols and the source code for the version I have installed.

Further, it appears from this man page that as the source packages aren't tracked the same way as the binary packages!

And just as I was coming to terms with that, I tried
    apt-get -s source

NOTICE: '' packaging is maintained in the 'Bzr' version control system at:
Please use:
bzr get
to retrieve the latest (possible unreleased) updates to the package.

I don't think kdbg will be of much use in stepping through the source code if this is the case.

I (eventually) found
I will work through that but my initial impression is that this is uncharted territory. How can this be?

Revision history for this message
Bhavani Shankar (bhavi) said :
Revision history for this message
Philip Ashmore (contact-philipashmore) said :