All of lore.kernel.org
 help / color / mirror / Atom feed
* [Xenomai-help] Debugging
@ 2006-01-17 19:28 Kent Borg
  2006-01-18  9:49 ` Gilles Chanteperdrix
  0 siblings, 1 reply; 6+ messages in thread
From: Kent Borg @ 2006-01-17 19:28 UTC (permalink / raw)
  To: xenomai

It occurs to me I have been lax in my understanding of how debugging
works with Xenamai.

 - What happens if I just use gdb and pretend I am debugging a regular
   program?  (Seems scary, but it seems to work at least somewhat for
   me.)

 - What is UVM for?  Sounds interesting, but the "make xconfig" help
   for it says it is for legacy RTOS APIs and I am mostly doing native
   calls.  What is the difference?

 - How about MVM?  It sounds interesting too.  Do I just configure it
   in and grab it on with gdb??

I notice that the string "debug" doesn't seem to appear in the thread
indexes for this list, so I don't think I am asking a frequent
question...


Thanks,

-kb


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

* Re: [Xenomai-help] Debugging
  2006-01-17 19:28 Kent Borg
@ 2006-01-18  9:49 ` Gilles Chanteperdrix
  0 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2006-01-18  9:49 UTC (permalink / raw)
  To: xenomai

Kent Borg wrote:
 > It occurs to me I have been lax in my understanding of how debugging
 > works with Xenamai.
 > 
 >  - What happens if I just use gdb and pretend I am debugging a regular
 >    program?  (Seems scary, but it seems to work at least somewhat for
 >    me.)

It should work. Or at least is it the intention.


 >  - What is UVM for?  Sounds interesting, but the "make xconfig" help
 >    for it says it is for legacy RTOS APIs and I am mostly doing native
 >    calls.  What is the difference?

To know more about UVMs, have a look at:
http://download.gna.org/xenomai/documentation/branches/v2.0.x/pdf/Introduction-to-UVMs.pdf


 > 
 >  - How about MVM?  It sounds interesting too.  Do I just configure it
 >    in and grab it on with gdb??

The MVM is a discrete event simulator, working hand in hand with an
instrumenting compiler and a "real-time aware" graphical frontend for
gdb. In order to use it, you first have to configure and install it.

You will have to compile your applications for this simulation
environment using "gcic" the instrumenting compiler, and run them
through "xenoscope", the gdb graphical frontend.

For examples of programs using the native skin, which can be compiled
for MVM, see the directory:
skins/native/demos

For the MVM full documentation, see:
sim/doc/mvm-manual.txt

-- 


					    Gilles Chanteperdrix.


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

* [Xenomai-help] Debugging
@ 2006-08-17 12:05 Stephan Zimmermann
  2006-08-17 12:35 ` Gilles Chanteperdrix
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Stephan Zimmermann @ 2006-08-17 12:05 UTC (permalink / raw)
  To: xenomai

Hello List,
I am facing some trouble debugging my Xenomai application. When I set a 
breakpoint in my main() task, everything works fine. If I set a breakpoint in 
another task, the debugger won't stop the application. Is this a known 
problem, or am I doing something wrong (compiler/debugger options)? I tryed 
it within Eclipse and gdb commandline interface, both gave me the same 
results. Can someone give me a Hint?

My System:
Debian 3.1 on AMD X2, running in 32bit mode
Xenomai 2.2 on Kernel 2.6.17.6, with no other patches
debian standard gcc 3.3.5
(same problem on intel notebook)
The program I'm working on is written in C++, wrapping classes around the 
native skin.

Thanks
Stephan


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

* Re: [Xenomai-help] Debugging
  2006-08-17 12:05 [Xenomai-help] Debugging Stephan Zimmermann
@ 2006-08-17 12:35 ` Gilles Chanteperdrix
  2006-08-17 12:41 ` Philippe Gerum
  2006-08-17 12:52 ` Gilles Chanteperdrix
  2 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2006-08-17 12:35 UTC (permalink / raw)
  To: Stephan Zimmermann; +Cc: xenomai

[-- Attachment #1: message body and .signature --]
[-- Type: text/plain, Size: 1313 bytes --]

Stephan Zimmermann wrote:
 > Hello List,
 > I am facing some trouble debugging my Xenomai application. When I set a 
 > breakpoint in my main() task, everything works fine. If I set a breakpoint in 
 > another task, the debugger won't stop the application. Is this a known 
 > problem, or am I doing something wrong (compiler/debugger options)? I tryed 
 > it within Eclipse and gdb commandline interface, both gave me the same 
 > results. Can someone give me a Hint?

I tested putting a breakpoint on the function "thread_routine" of the
attached program, and it works. Could you send us a minimal program
where this does not work ? 

Another detail: in order to correctly debug threaded programs, gdb needs
the libthread_db library, do you see the following line when starting
gdb:
Using host libthread_db library "/lib/libthread_db.so.1".

 > 
 > My System:
 > Debian 3.1 on AMD X2, running in 32bit mode
 > Xenomai 2.2 on Kernel 2.6.17.6, with no other patches
 > debian standard gcc 3.3.5
 > (same problem on intel notebook)
 > The program I'm working on is written in C++, wrapping classes around the 
 > native skin.

You may be reinventing the wheel, there is a xenomm projects which
provides a C++ interface to the native skin, see:
https://gna.org/projects/xenomm

-- 


					    Gilles Chanteperdrix.

[-- Attachment #2: test_thread_bpt.c --]
[-- Type: text/plain, Size: 360 bytes --]

#include <pthread.h>
#include <semaphore.h>

void *thread_routine(void *cookie)
{
	sem_t *sem = (sem_t *) cookie;
	sem_wait(sem);
	return NULL;
}

int main(int argc, const char *argv[])
{
	pthread_t thread;
	sem_t sem;

	sem_init(&sem, 0, 0);
	pthread_create(&thread, NULL, &thread_routine, &sem);
	sem_post(&sem);

	pthread_join(thread, NULL);
	
	return 0;
}

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

* Re: [Xenomai-help] Debugging
  2006-08-17 12:05 [Xenomai-help] Debugging Stephan Zimmermann
  2006-08-17 12:35 ` Gilles Chanteperdrix
@ 2006-08-17 12:41 ` Philippe Gerum
  2006-08-17 12:52 ` Gilles Chanteperdrix
  2 siblings, 0 replies; 6+ messages in thread
From: Philippe Gerum @ 2006-08-17 12:41 UTC (permalink / raw)
  To: Stephan Zimmermann; +Cc: xenomai

On Thu, 2006-08-17 at 14:05 +0200, Stephan Zimmermann wrote:
> Hello List,
> I am facing some trouble debugging my Xenomai application. When I set a 
> breakpoint in my main() task, everything works fine. If I set a breakpoint in 
> another task, the debugger won't stop the application. Is this a known 
> problem,

No.

>  or am I doing something wrong (compiler/debugger options)? I tryed 
> it within Eclipse and gdb commandline interface, both gave me the same 
> results. Can someone give me a Hint?
> 

The language used has no incidence for on the way breakpoints are
handled kernel-wise. Are you 100% sure that the code location is indeed
executed (e.g. is a breakpoint on a trace statement ignored by GDB
albeit the trace appears?); does "info breakpoints" gives you the right
output regarding your breakpoint (i.e. is it enabled, and at the right
place you expect it to be)?

In any case, we would need a simple test code reproducing the issue to
further investigate it, if any.

> My System:
> Debian 3.1 on AMD X2, running in 32bit mode
> Xenomai 2.2 on Kernel 2.6.17.6, with no other patches
> debian standard gcc 3.3.5
> (same problem on intel notebook)
> The program I'm working on is written in C++, wrapping classes around the 
> native skin.
> 
> Thanks
> Stephan
> 
> _______________________________________________
> Xenomai-help mailing list
> Xenomai-help@domain.hid
> https://mail.gna.org/listinfo/xenomai-help
-- 
Philippe.




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

* Re: [Xenomai-help] Debugging
  2006-08-17 12:05 [Xenomai-help] Debugging Stephan Zimmermann
  2006-08-17 12:35 ` Gilles Chanteperdrix
  2006-08-17 12:41 ` Philippe Gerum
@ 2006-08-17 12:52 ` Gilles Chanteperdrix
  2 siblings, 0 replies; 6+ messages in thread
From: Gilles Chanteperdrix @ 2006-08-17 12:52 UTC (permalink / raw)
  To: Stephan Zimmermann; +Cc: xenomai

Stephan Zimmermann wrote:
 > Hello List,
 > I am facing some trouble debugging my Xenomai application. When I set a 
 > breakpoint in my main() task, everything works fine. If I set a breakpoint in 
 > another task, the debugger won't stop the application. Is this a known 
 > problem, or am I doing something wrong (compiler/debugger options)? I tryed 
 > it within Eclipse and gdb commandline interface, both gave me the same 
 > results. Can someone give me a Hint?
 > 
 > My System:
 > Debian 3.1 on AMD X2, running in 32bit mode
 > Xenomai 2.2 on Kernel 2.6.17.6, with no other patches
 > debian standard gcc 3.3.5
 > (same problem on intel notebook)
 > The program I'm working on is written in C++, wrapping classes around the 
 > native skin.

Next idea: are you trying to put a breakpoint on a class constructor ?
There is a known issue with gdb and gcc version 3 and later: the
compiler generate several versions of each constructor, and you are not
necessarily putting the breakpoint on the version that is really
executed.

-- 


					    Gilles Chanteperdrix.


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

end of thread, other threads:[~2006-08-17 12:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-17 12:05 [Xenomai-help] Debugging Stephan Zimmermann
2006-08-17 12:35 ` Gilles Chanteperdrix
2006-08-17 12:41 ` Philippe Gerum
2006-08-17 12:52 ` Gilles Chanteperdrix
  -- strict thread matches above, loose matches on Subject: below --
2006-01-17 19:28 Kent Borg
2006-01-18  9:49 ` Gilles Chanteperdrix

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.