Debugging
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
Quoted 7 lines · Stephan Zimmermann
Hello List,
I am facing some trouble debugging my Xenomai application. When I set a breakpoint in mymain()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".
Quoted 8 lines
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
Signature · 1 line
Gilles Chanteperdrix.
#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;
}Quoted 5 lines · Stephan Zimmermann
Hello List,
I am facing some trouble debugging my Xenomai application. When I set a breakpoint in mymain()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.
Quoted 4 lines
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.
Quoted 15 lines
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
[email protected]
https://mail.gna.org/listinfo/xenomai-help
Signature · 1 line
Philippe.
Quoted 8 lines · Stephan Zimmermann
Hello List,
I am facing some trouble debugging my Xenomai application. When I set a breakpoint in mymain()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?
Quoted 7 lines
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.
Signature · 1 line
Gilles Chanteperdrix.