How to get debug symbols in xenomai libraries
I tried using --enable-debug with configure and it claims it did it, but according to gdb, the resulting libraries do not have debug symbols.
I see -g added to the gcc line all over the place, except when libtool does the final linking where for some reason it has disappeared (while all other options appear to have made it through).
This is on powerpc.
Any ideas?
Signature · 1 line
Len Sorensen
Quoted 11 lines · Lennart Sorensen
I tried using --enable-debug with configure and it claims it did it, but according to gdb, the resulting libraries do not have debug symbols.
I see -g added to the gcc line all over the place, except when libtool does the final linking where for some reason it has disappeared (while all other options appear to have made it through).
This is on powerpc.
Any ideas?
run the "file" utility on the library to see whether or not it has debugging information.
Signature · 1 line
Gilles.
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Lennart Sorensen
I tried using --enable-debug with configure and it claims it did it, but according to gdb, the resulting libraries do not have debug symbols.
I see -g added to the gcc line all over the place, except when libtool does the final linking where for some reason it has disappeared (while all other options appear to have made it through).
This is on powerpc.
I should have said 'this is armhf'. Too many systems in use.
Quoted 4 lines
Quoted 2 lines
Any ideas?
run the "file" utility on the library to see whether or not it has debugging information.
file says 'dynamically linked, not stripped'.
gdb says 'no debug symbols' for the xenomai libraries, but it does see them for libc and others.
Signature · 1 line
Len Sorensen
Quoted 15 lines · Lennart Sorensen
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Lennart Sorensen
I tried using --enable-debug with configure and it claims it did it, but according to gdb, the resulting libraries do not have debug symbols.
I see -g added to the gcc line all over the place, except when libtool does the final linking where for some reason it has disappeared (while all other options appear to have made it through).
This is on powerpc.
I should have said 'this is armhf'. Too many systems in use.
Quoted 2 lines
Quoted 2 lines
Any ideas?
Quoted 8 lines
Quoted 2 lines
run the "file" utility on the library to see whether or not it has debugging information.
file says 'dynamically linked, not stripped'.
gdb says 'no debug symbols' for the xenomai libraries, but it does see them for libc and others.
Confirmed, I have the same problem, even on arm soft float and x86. Will try and understand what happens.
Signature · 1 line
Gilles.
Quoted 19 lines · Gilles Chanteperdrix
Quoted 18 lines · Lennart Sorensen
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Lennart Sorensen
I tried using --enable-debug with configure and it claims it did it, but according to gdb, the resulting libraries do not have debug symbols.
I see -g added to the gcc line all over the place, except when libtool does the final linking where for some reason it has disappeared (while all other options appear to have made it through).
This is on powerpc.
I should have said 'this is armhf'. Too many systems in use.
Quoted 4 lines
Quoted 2 lines
Any ideas?
run the "file" utility on the library to see whether or not it has debugging information.
Quoted 8 lines
Quoted 5 lines
file says 'dynamically linked, not stripped'.
gdb says 'no debug symbols' for the xenomai libraries, but it does see them for libc and others.
Confirmed, I have the same problem, even on arm soft float and x86. Will try and understand what happens.
No, in fact the libraries have the debug symbols, only file does not print it. But the crossed gcc finds them.
Signature · 1 line
Gilles.
Quoted 22 lines · Gilles Chanteperdrix
Quoted 21 lines · Gilles Chanteperdrix
Quoted 20 lines · Lennart Sorensen
Quoted 9 lines · Gilles Chanteperdrix
Quoted 8 lines · Lennart Sorensen
I tried using --enable-debug with configure and it claims it did it, but according to gdb, the resulting libraries do not have debug symbols.
I see -g added to the gcc line all over the place, except when libtool does the final linking where for some reason it has disappeared (while all other options appear to have made it through).
This is on powerpc.
I should have said 'this is armhf'. Too many systems in use.
Quoted 4 lines
Quoted 2 lines
Any ideas?
run the "file" utility on the library to see whether or not it has debugging information.
file says 'dynamically linked, not stripped'.
Quoted 9 lines
Quoted 6 lines
Quoted 3 lines
gdb says 'no debug symbols' for the xenomai libraries, but it does see them for libc and others.
Confirmed, I have the same problem, even on arm soft float and x86. Will try and understand what happens.
No, in fact the libraries have the debug symbols, only file does not print it. But the crossed gcc finds them.
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0
and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Signature · 1 line
Gilles.
Quoted 10 lines · Gilles Chanteperdrix
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Signature · 1 line
Len Sorensen
Quoted 8 lines · Lennart Sorensen
Quoted 7 lines · Gilles Chanteperdrix
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0
Quoted 8 lines
Quoted 3 lines
and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
Signature · 1 line
Gilles.
Quoted 13 lines · Gilles Chanteperdrix
Quoted 12 lines · Lennart Sorensen
Quoted 10 lines · Gilles Chanteperdrix
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Signature · 1 line
Len Sorensen
Quoted 19 lines · Lennart Sorensen
Quoted 18 lines · Gilles Chanteperdrix
Quoted 16 lines · Lennart Sorensen
Quoted 10 lines · Gilles Chanteperdrix
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Quoted 7 lines
Quoted 2 lines
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Could you try a manual build?
Signature · 1 line
Gilles.
Quoted 20 lines · Gilles Chanteperdrix
Quoted 19 lines · Lennart Sorensen
Quoted 18 lines · Gilles Chanteperdrix
Quoted 16 lines · Lennart Sorensen
Quoted 10 lines · Gilles Chanteperdrix
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
Signature · 1 line
Len Sorensen
Quoted 28 lines · Lennart Sorensen
Quoted 27 lines · Gilles Chanteperdrix
Quoted 26 lines · Lennart Sorensen
Quoted 13 lines · Gilles Chanteperdrix
Quoted 12 lines · Lennart Sorensen
Quoted 10 lines · Gilles Chanteperdrix
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 6 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0
There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
Signature · 1 line
Gilles.
Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Lennart Sorensen
On Fri, Sep 05, 2014 at 11:04:35PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:57:10PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:31:35PM +0200, Gilles Chanteperdrix
Quoted 31 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 5 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
Quoted 7 lines
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
dh_strip in debian/rules is the guilty party here - It is responsible for stripping debug symbols from binary executables and libraries.
Regards, Paul.
Quoted 46 lines · Paul
Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Lennart Sorensen
On Fri, Sep 05, 2014 at 11:04:35PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:57:10PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:31:35PM +0200, Gilles Chanteperdrix
Quoted 36 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 5 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0
Quoted 5 lines
Quoted 2 lines
There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
dh_stripin debian/rules is the guilty party here - It is responsible for stripping debug symbols from binary executables and libraries.
I am not sure this is the issue, since Lennart passes the "nostrip" directive, and says that the file utility says that the libraries are not stripped.
Anyway, packages like libc6 have debug symbols in a separate package from the main binary package. Is this complicated to achieve?
Signature · 1 line
Gilles.
Quoted 54 lines · Gilles Chanteperdrix
Quoted 53 lines · Paul
Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Lennart Sorensen
On Fri, Sep 05, 2014 at 11:04:35PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:57:10PM +0200, Gilles Chanteperdrix
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Lennart Sorensen
Quoted 2 lines
On Fri, Sep 05, 2014 at 10:31:35PM +0200, Gilles
ChanteperdrixQuoted 38 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 5 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
Quoted 7 lines
Quoted 3 lines
dh_stripin debian/rules is the guilty party here - It is responsible for stripping debug symbols from binary executables and libraries.I am not sure this is the issue, since Lennart passes the "nostrip" directive, and says that the file utility says that the libraries are not stripped.
Apologies - Missed the bit about passing nostrip via DEB_BUILD_OPTIONS.
Quoted 2 lines
Anyway, packages like libc6 have debug symbols in a separate package from the main binary package. Is this complicated to achieve?
Very simple to achieve. The bulk of it is a cut'n'paste job in debian/control plus a couple of lines in debian/rules. Please see attached patch.
Regards, Paul.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Add-debug-packages-to-debian-for-library-and-runtime.patch
Type: text/x-diff
Size: 3289 bytes
Desc: not available
URL: <http://www.xenomai.org/pipermail/xenomai/attachments/20140906/37876aab/attachment.patch>
Gilles Chanteperdrix
AppliedQuoted 63 lines · Paul
Quoted 54 lines · Gilles Chanteperdrix
Quoted 53 lines · Paul
Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Lennart Sorensen
On Fri, Sep 05, 2014 at 11:04:35PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:57:10PM +0200, Gilles Chanteperdrix
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Lennart Sorensen
Quoted 2 lines
On Fri, Sep 05, 2014 at 10:31:35PM +0200, Gilles
ChanteperdrixQuoted 38 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 5 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
Quoted 7 lines
Quoted 3 lines
dh_stripin debian/rules is the guilty party here - It is responsible for stripping debug symbols from binary executables and libraries.I am not sure this is the issue, since Lennart passes the "nostrip" directive, and says that the file utility says that the libraries are not stripped.
Quoted 8 lines
Apologies - Missed the bit about passing nostrip via
DEB_BUILD_OPTIONS.Quoted 2 lines
Anyway, packages like libc6 have debug symbols in a separate package from the main binary package. Is this complicated to achieve?
Very simple to achieve. The bulk of it is a cut'n'paste job in debian/control plus a couple of lines in debian/rules. Please see attached patch.
Merged, thanks a lot. Lennart, could you check whether it works in your case?
Regards.
Signature · 1 line
Gilles.
Quoted 2 lines · Gilles Chanteperdrix
Merged, thanks a lot. Lennart, could you check whether it works in your case?
I will give that a try Monday.
Signature · 1 line
Len Sorensen
Quoted 149 lines · Paul
Quoted 54 lines · Gilles Chanteperdrix
Quoted 53 lines · Paul
Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Lennart Sorensen
On Fri, Sep 05, 2014 at 11:04:35PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:57:10PM +0200, Gilles Chanteperdrix
Quoted 3 lines · wrote:
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines
Quoted 3 lines · Lennart Sorensen
Quoted 2 lines
On Fri, Sep 05, 2014 at 10:31:35PM +0200, Gilles
ChanteperdrixQuoted 38 lines · wrote:
Quoted 25 lines
Quoted 25 lines
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 5 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
Quoted 7 lines
Quoted 3 lines
dh_stripin debian/rules is the guilty party here - It is responsible for stripping debug symbols from binary executables and libraries.I am not sure this is the issue, since Lennart passes the "nostrip" directive, and says that the file utility says that the libraries are not stripped.
Apologies - Missed the bit about passing nostrip via
DEB_BUILD_OPTIONS.Quoted 2 lines
Anyway, packages like libc6 have debug symbols in a separate package from the main binary package. Is this complicated to achieve?
Very simple to achieve. The bulk of it is a cut'n'paste job in debian/control plus a couple of lines in debian/rules. Please see attached patch.
Regards, Paul.
From
2680ee4171ef29770a6aa275aa2576c20cc7bd79Mon Sep 17 00:00:00 2001
From: Paul Corner <[email protected]>
Date: Sat, 6 Sep 2014 16:08:39 +0100
Subject: [PATCH] Add debug packages to debian for library and runtime
packages.--- debian/control | 29 +++++++++++++++++++++++++++++ debian/rules | 6 ++++-- 2 files changed, 33 insertions(+), 2 deletions(-)debian/control +29
-0@@ -24,6 +24,21 @@ Description: Xenomai runtime utilities This package contains the runtime programs and the testsuite for the Xenomai realtime system. +Package: xenomai-runtime-dbg +Section: debug +Architecture: amd64 arm armeb armel armhf i386 powerpc powerpcspe +Depends: xenomai-runtime (=${binary:Version}), ${misc:Depends} +Description: debugging symbols for Xenomai runtime utilities + Xenomai is a real-time development framework cooperating with the Linux + kernel in order to provide a pervasive, interface-agnostic, hard real-time + support to user-space applications, seamlessly integrated into the GNU/Linux + environment. Xenomai provides its own API and emulation layers ("skins") to + make migration from other RTOS easier. Examples are: pSOS+, VxWorks, VRTX, + uiTRON, RTAI, POSIX. + . + This package contains the debug symbols for the runtime programs and testsuite + for Xenomai realtime system. + Package: xenomai-kernel-source Section: kernel Architecture: all@@ -62,6 +77,20 @@ Description: Shared libraries for Xenomai . This package contains the shared libraries. +Package: libxenomai1-dbg +Section: debug +Architecture: amd64 arm armeb armel armhf i386 powerpc powerpcspe +Depends: libxenomai1 (=${binary:Version}), ${misc:Depends} +Description: Debugging symbols for libxenomai1 + Xenomai is a real-time development framework cooperating with the Linux + kernel in order to provide a pervasive, interface-agnostic, hard real-time + support to user-space applications, seamlessly integrated into the GNU/Linux + environment. Xenomai provides its own API and emulation layers ("skins") to + make migration from other RTOS easier. Examples are: pSOS+, VxWorks, VRTX, + uiTRON, RTAI, POSIX. + . + This package contains the debug symbols for libxenomai1. + Package: libxenomai-dev Section: libdevel Architecture: amd64 arm armeb armel armhf i386 powerpc powerpcspedebian/rules +2
-1@@ -16,7 +16,8 @@ DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CONFIG_OPTS = --prefix=/usr \ --includedir=/usr/include/xenomai \ --mandir=/usr/share/man \ - --with-testdir=/usr/lib/xenomai/testsuite + --with-testdir=/usr/lib/xenomai/testsuite \ + --enable-debug ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE)) CONFIG_OPTS += --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
debian/rules binary-arch: build install · line 107
Quoted 9 lines
debian/rules +2
-1@@ -99,7 +100,8 @@ binary-arch: build install dh_installdocs -s -A CREDITS README.INSTALL TROUBLESHOOTING dh_link -s dh_installchangelogs -s - dh_strip -s + dh_strip -pxenomai-runtime --dbg-package=xenomai-runtime-dbg + dh_strip -plibxenomai1 --dbg-package=libxenomai1-dbg dh_compress -s dh_fixperms -s dh_makeshlibs -s
That seems to work great. Thanks.
Signature · 1 line
Len Sorensen
Quoted 2 lines · Paul
dh_stripin debian/rules is the guilty party here - It is responsible for stripping debug symbols from binary executables and libraries.
Not when you set DEB_BUILD_OPTIONS to nostrip.
Signature · 1 line
Len Sorensen
Quoted 7 lines · Gilles Chanteperdrix
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
Well we can give that a try.
Of course I hate libtool. It's stupid .libs thing makes it so annying to find the actual library.
Signature · 1 line
Len Sorensen
Quoted 6 lines · Lennart Sorensen
Quoted 5 lines · Gilles Chanteperdrix
You do not need to run "make install"
Just run configure --enable-debug
Then make
Then try gdb on the compiled libxenomai.so.0.0.0
Quoted 8 lines
Quoted 2 lines
There are two layers of Makefileries, thee aim is to find where the problem is coming from, not to use this as a solution.
Well we can give that a try.
Of course I hate libtool. It's stupid .libs thing makes it so annying to find the actual library.
It is:
src/skins/common/.libs/libxenomai.so.0.0.0
Signature · 1 line
Gilles.
Quoted 3 lines · Lennart Sorensen
Quoted 2 lines · Gilles Chanteperdrix
Quoted 1 line · Lennart Sorensen
On Fri, Sep 05, 2014 at 10:57:10PM +0200, Gilles Chanteperdrix
Quoted 2 lines · wrote:
Quoted 2 lines
Quoted 2 lines
Quoted 2 lines · Lennart Sorensen
Quoted 1 line
On Fri, Sep 05, 2014 at 10:31:35PM +0200, Gilles Chanteperdrix
Quoted 25 lines · wrote:
Quoted 25 lines
Quoted 24 lines
Quoted 12 lines
Quoted 12 lines
Quoted 11 lines
Just tried a fresh build with minimal flags, simply:
configure --enable-debug CFLAGS="-fomit-frame-pointer" --host=arm-linux-gnueabihf
make
arm-linux-gnueabihf-gdb src/skins/common/.libs/libxenomai.so.0.0.0and gdb says it can find symbols. (-fomit-frame-pointer is needed with the toolchain I use, otherwise gcc complains that it can not use the r7 register).
Quoted 7 lines
Quoted 4 lines
I tried adding that option, and still gdb says no symbols.
Toolchain is debian wheezy's gcc 4.6, and everything is natively compiled.
Do you build the package manually, like I just did? Or do you use the debian/rules stuff?
I use the debian/rules, but I set DEB_CFLAGS_APPEND=-fomit-frame-pointer and I added --enable-debug to the configure line in debian/rules and I set DEB_BUILD_OPTIONS=nostrip
Quoted 5 lines
Quoted 1 line
Could you try a manual build?
That makes installing such a pain and the gcc lines had all the right arguments (-g -fomit-frame-pointer etc). And we did want to debug with as close to the normal runtime build as possible.
In which case, you will need to edit the debian/rules - Remove the dh_strip lines and you should retain the debug symbols.
Regards, Paul.