All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] remote gdb debugging and Xenomai
@ 2008-07-02 17:47 Karch, Joshua
  2008-07-02 17:52 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: Karch, Joshua @ 2008-07-02 17:47 UTC (permalink / raw)
  To: xenomai

[-- Attachment #1: Type: text/plain, Size: 839 bytes --]


Hi,

I began using GDB to debug rt-tasks in addition to pthreads and I found that placing a breakpoint within an RT-Task causes a termination of the debug session

"Child terminated with signal = 5 " is the error I get from gdbserver on the target device

In the Eclipse environment on my non-Xeno desktop, I receive the following error:
<terminated>gdbserver Debugger (7/2/08 1:27 PM) (Exited. Signal 'SIGTRAP' received. Description: Trace/breakpoint trap.)	


I did some googling and found out I need symbol information available to GDB for Xenomai functions (in addition to PThreads). Where can I find libraries with the symbols?  Is there anything else I need to know to be able to set breakpoints within RT- Tasks for debugging?  I haven't used GDB until now, so this is still new to me.

Thank you,

Joshua Karch.


[-- Attachment #2: Type: text/html, Size: 1349 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] remote gdb debugging and Xenomai
  2008-07-02 17:47 [Xenomai-help] remote gdb debugging and Xenomai Karch, Joshua
@ 2008-07-02 17:52 ` Gilles Chanteperdrix
  2008-07-02 18:12   ` Karch, Joshua
  0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2008-07-02 17:52 UTC (permalink / raw)
  To: Karch, Joshua; +Cc: xenomai

Karch, Joshua wrote:
> Hi,
> 
> I began using GDB to debug rt-tasks in addition to pthreads and I
> found that placing a breakpoint within an RT-Task causes a
> termination of the debug session
> 
> "Child terminated with signal = 5 " is the error I get from gdbserver
> on the target device
> 
> In the Eclipse environment on my non-Xeno desktop, I receive the
> following error: <terminated>gdbserver Debugger (7/2/08 1:27 PM)
> (Exited. Signal 'SIGTRAP' received. Description: Trace/breakpoint
> trap.)
> 
> 
> I did some googling and found out I need symbol information available
> to GDB for Xenomai functions (in addition to PThreads). Where can I
> find libraries with the symbols?

Read README.INSTALL

> Is there anything else I need to know to be able to set breakpoints
> within RT- Tasks for debugging?  I haven't used GDB until now, so
> this is still new to me.

The main reason for such kind of errors is not using the same version of
gdb and gdbserver.

-- 
                                                  Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] remote gdb debugging and Xenomai
  2008-07-02 17:52 ` Gilles Chanteperdrix
@ 2008-07-02 18:12   ` Karch, Joshua
  2008-07-02 18:23     ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: Karch, Joshua @ 2008-07-02 18:12 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]


Gilles,

Regarding GDB, from what I saw in README.INSTALL,  I have to get the GDB sources and compile a custom version of GDB/GDB server for my target machine, right?
I simply apt-get installed gdb on this machine so I don't have a custom version.

Also, the Desktop machine has a different version of GDB.  Would I have to get a custom version of GDB for the Desktop too?
Is this all based on adding cross-compile support?

Thank you,

Josh


-----Original Message-----
From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
Sent: Wed 7/2/2008 1:52 PM
To: Karch, Joshua
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] remote gdb debugging and Xenomai
 
Karch, Joshua wrote:
> Hi,
> 
> I began using GDB to debug rt-tasks in addition to pthreads and I
> found that placing a breakpoint within an RT-Task causes a
> termination of the debug session
> 
> "Child terminated with signal = 5 " is the error I get from gdbserver
> on the target device
> 
> In the Eclipse environment on my non-Xeno desktop, I receive the
> following error: <terminated>gdbserver Debugger (7/2/08 1:27 PM)
> (Exited. Signal 'SIGTRAP' received. Description: Trace/breakpoint
> trap.)
> 
> 
> I did some googling and found out I need symbol information available
> to GDB for Xenomai functions (in addition to PThreads). Where can I
> find libraries with the symbols?

Read README.INSTALL

> Is there anything else I need to know to be able to set breakpoints
> within RT- Tasks for debugging?  I haven't used GDB until now, so
> this is still new to me.

The main reason for such kind of errors is not using the same version of
gdb and gdbserver.

-- 
                                                  Gilles.


[-- Attachment #2: Type: text/html, Size: 2750 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] remote gdb debugging and Xenomai
  2008-07-02 18:12   ` Karch, Joshua
@ 2008-07-02 18:23     ` Gilles Chanteperdrix
  2008-07-02 22:51       ` Karch, Joshua
  0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2008-07-02 18:23 UTC (permalink / raw)
  To: Karch, Joshua; +Cc: xenomai

Karch, Joshua wrote:
> Gilles,
> 
> Regarding GDB, from what I saw in README.INSTALL,  I have to get the
> GDB sources and compile a custom version of GDB/GDB server for my
> target machine, right?

I was referring to Xenomai README.INSTALL explaining how to enable debug
symbols in Xenomai libraries.

 I simply apt-get installed gdb on this machine
> so I don't have a custom version.

The problem is that if you have gdb 6.5 on the host and gdbserver 6.4 on
the target it will not work. You have to use exactly the same version.

-- 


					    Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] remote gdb debugging and Xenomai
  2008-07-02 18:23     ` Gilles Chanteperdrix
@ 2008-07-02 22:51       ` Karch, Joshua
  2008-07-03  7:34         ` Gilles Chanteperdrix
  0 siblings, 1 reply; 7+ messages in thread
From: Karch, Joshua @ 2008-07-02 22:51 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 2184 bytes --]


Gilles,

so I installed the same version of gdb (6.4.90) which is older but is part of the debian distro I am using.  I've tried using gdbserver to connect as well as gdb.

When I use a version of gdbserver and gdb on the target machine, I can debug and set breakpoints without issues on the target machine.  The Xenomai libraries have the symbols necessary for debugging.  
However, on my desktop, I don't have those libraries installed.

I'm running eclipse with GDB set to gdbserver Debugger.  I also NFS mounted the Xenomai target machine and under the "Shared Libraries" of Debug from project properties in Eclipse I included the /lib, /usr/lib, and /usr/xenomai/lib directories.  I am using ssh tunneling to do "make" and the compile works fine.  I've also tried setting GDB to "remote gdb/Mi" through ssh, but I am unable to make that work.  If I could run gdb over ssh tunneling through Eclipse, all of the proper symbols would be loaded, and I would be able to debug properly.  I keep getting tunnel errors if I try that method.  My only other option is using gdbserver, but that requires me to have the same version of gdb on both the Xenomai machine and my desktop, plus the libraries.  My issue in this case is I can't get the libraries off the Xenomai machine to be loaded by GDB on my desktop so I can debug.

Any ideas?

Thank you,

Josh

-----Original Message-----
From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
Sent: Wed 7/2/2008 2:23 PM
To: Karch, Joshua
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] remote gdb debugging and Xenomai
 
Karch, Joshua wrote:
> Gilles,
> 
> Regarding GDB, from what I saw in README.INSTALL,  I have to get the
> GDB sources and compile a custom version of GDB/GDB server for my
> target machine, right?

I was referring to Xenomai README.INSTALL explaining how to enable debug
symbols in Xenomai libraries.

 I simply apt-get installed gdb on this machine
> so I don't have a custom version.

The problem is that if you have gdb 6.5 on the host and gdbserver 6.4 on
the target it will not work. You have to use exactly the same version.

-- 


					    Gilles.


[-- Attachment #2: Type: text/html, Size: 3136 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] remote gdb debugging and Xenomai
  2008-07-02 22:51       ` Karch, Joshua
@ 2008-07-03  7:34         ` Gilles Chanteperdrix
  2008-07-03 13:32           ` Karch, Joshua
  0 siblings, 1 reply; 7+ messages in thread
From: Gilles Chanteperdrix @ 2008-07-03  7:34 UTC (permalink / raw)
  To: Karch, Joshua; +Cc: xenomai

Karch, Joshua wrote:
> Gilles,
> 
> so I installed the same version of gdb (6.4.90) which is older but is
> part of the debian distro I am using.  I've tried using gdbserver to
> connect as well as gdb.
> 
> When I use a version of gdbserver and gdb on the target machine, I
> can debug and set breakpoints without issues on the target machine.
> The Xenomai libraries have the symbols necessary for debugging. 
> However, on my desktop, I don't have those libraries installed.
> 
> I'm running eclipse with GDB set to gdbserver Debugger.  I also NFS
> mounted the Xenomai target machine and under the "Shared Libraries"
> of Debug from project properties in Eclipse I included the /lib,
> /usr/lib, and /usr/xenomai/lib directories.  I am using ssh tunneling
> to do "make" and the compile works fine.  I've also tried setting GDB
> to "remote gdb/Mi" through ssh, but I am unable to make that work.
> If I could run gdb over ssh tunneling through Eclipse, all of the
> proper symbols would be loaded, and I would be able to debug
> properly.  I keep getting tunnel errors if I try that method.  My
> only other option is using gdbserver, but that requires me to have
> the same version of gdb on both the Xenomai machine and my desktop,
> plus the libraries.  My issue in this case is I can't get the
> libraries off the Xenomai machine to be loaded by GDB on my desktop
> so I can debug.
> 
> Any ideas?

I know nothing about eclipse, sorry, after all, this is Xenomai
mailing-list, not eclipse mailing list.
However, what I can tell you is that the best way I have found to work
with gdb on targets, is to use gdb's solib-absolute-prefix.

All you have to do is to install all your packages with full debug
symbols in a staging directory, at the place they will be on the target.
And either use directly this directory via NFS on your target, or
generate another directory where all binaries and libraries are stripped
but at the same place as in the non-stripped staging directory, using
that second directory to generate your target system image. Then, when
running gdb with gdb server do:
set solib-absolute-prefix /path/to/non-stripped/staging/dir
After that, when gdbserver will open a (maybe stripped) file on the
target, gdb will look in the non-stripped staging dir for the same lib
with debug symbols and find it.

I suggest you understand and learn to use gdb without frontends before
using it through frontends, this will let you a lot understanding why
frontends do not work as you would expect.

-- 


					    Gilles.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [Xenomai-help] remote gdb debugging and Xenomai
  2008-07-03  7:34         ` Gilles Chanteperdrix
@ 2008-07-03 13:32           ` Karch, Joshua
  0 siblings, 0 replies; 7+ messages in thread
From: Karch, Joshua @ 2008-07-03 13:32 UTC (permalink / raw)
  To: Gilles Chanteperdrix; +Cc: xenomai

[-- Attachment #1: Type: text/plain, Size: 3462 bytes --]


Gilles,

thank you for your advice with this-- this is my first time using GDB outside of the eclipse front end so it will take some time to learn the commands.  I appreciate your help with this-- it would be nice to be able to visualize and pause the main loops of my RT Tasks, and view variables at breakpoints.  Until now I've debugged loop code outside of the Xenomai framework before inserting it, or have used printf statements with great care(or data logging threads) to surmise if the system is working.  So far I've been lucky, but as time goes on it would be much better to learn to debug properly.

Cheers,

Josh

-----Original Message-----
From: Gilles Chanteperdrix [mailto:gilles.chanteperdrix@xenomai.org]
Sent: Thu 7/3/2008 3:34 AM
To: Karch, Joshua
Cc: xenomai@xenomai.org
Subject: Re: [Xenomai-help] remote gdb debugging and Xenomai
 
Karch, Joshua wrote:
> Gilles,
> 
> so I installed the same version of gdb (6.4.90) which is older but is
> part of the debian distro I am using.  I've tried using gdbserver to
> connect as well as gdb.
> 
> When I use a version of gdbserver and gdb on the target machine, I
> can debug and set breakpoints without issues on the target machine.
> The Xenomai libraries have the symbols necessary for debugging. 
> However, on my desktop, I don't have those libraries installed.
> 
> I'm running eclipse with GDB set to gdbserver Debugger.  I also NFS
> mounted the Xenomai target machine and under the "Shared Libraries"
> of Debug from project properties in Eclipse I included the /lib,
> /usr/lib, and /usr/xenomai/lib directories.  I am using ssh tunneling
> to do "make" and the compile works fine.  I've also tried setting GDB
> to "remote gdb/Mi" through ssh, but I am unable to make that work.
> If I could run gdb over ssh tunneling through Eclipse, all of the
> proper symbols would be loaded, and I would be able to debug
> properly.  I keep getting tunnel errors if I try that method.  My
> only other option is using gdbserver, but that requires me to have
> the same version of gdb on both the Xenomai machine and my desktop,
> plus the libraries.  My issue in this case is I can't get the
> libraries off the Xenomai machine to be loaded by GDB on my desktop
> so I can debug.
> 
> Any ideas?

I know nothing about eclipse, sorry, after all, this is Xenomai
mailing-list, not eclipse mailing list.
However, what I can tell you is that the best way I have found to work
with gdb on targets, is to use gdb's solib-absolute-prefix.

All you have to do is to install all your packages with full debug
symbols in a staging directory, at the place they will be on the target.
And either use directly this directory via NFS on your target, or
generate another directory where all binaries and libraries are stripped
but at the same place as in the non-stripped staging directory, using
that second directory to generate your target system image. Then, when
running gdb with gdb server do:
set solib-absolute-prefix /path/to/non-stripped/staging/dir
After that, when gdbserver will open a (maybe stripped) file on the
target, gdb will look in the non-stripped staging dir for the same lib
with debug symbols and find it.

I suggest you understand and learn to use gdb without frontends before
using it through frontends, this will let you a lot understanding why
frontends do not work as you would expect.

-- 


					    Gilles.


[-- Attachment #2: Type: text/html, Size: 4572 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2008-07-03 13:32 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-02 17:47 [Xenomai-help] remote gdb debugging and Xenomai Karch, Joshua
2008-07-02 17:52 ` Gilles Chanteperdrix
2008-07-02 18:12   ` Karch, Joshua
2008-07-02 18:23     ` Gilles Chanteperdrix
2008-07-02 22:51       ` Karch, Joshua
2008-07-03  7:34         ` Gilles Chanteperdrix
2008-07-03 13:32           ` Karch, Joshua

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.