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
https://wiki.ubuntu.com/DebuggingProgramCrash

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

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

Run sudo apt-get source <packagename>

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

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 openoffice.org-core

NOTICE: 'openoffice.org' packaging is maintained in the 'Bzr' version control system at:
http://bazaar.launchpad.net/~openoffice-pkgs/openoffice/2.4.1-hardy
Please use:
bzr get http://bazaar.launchpad.net/~openoffice-pkgs/openoffice/2.4.1-hardy
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
    https://wiki.ubuntu.com/MeetingLogs/devweek0802/Patching1
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 :
#3
Revision history for this message
Philip Ashmore (contact-philipashmore) said :
#4