Remote debug question
First, I'm sorry if this has been asked and answered here before. I found a link to a page to search the archives but the link was broken. So, I'm not sure how to search the archives without downloading them all.
I'm running xenomai 3 on a Beaglebone Black and my host is Mint 17. All the samples checkout. I can build and run my own code using xenomai extensions, but remote debugging seems to be erratic. First, I see two threads immediately at startup though I don't have symbols for the second read. I didn't create this thread, so I'm not sure why its there or where it came from.
Second, the debugger (dbgserver) seems to lose itself. I'll step through code and it will suddenly and at random locations just not break on the next line. Debugger says threads are still alive, but when I pause execution (though I shouldn't have to since I stepped) it appears all the threads are terminated.
Lastly, when I run without the debugger I get different behavior. I never had a problem before I converted to xenomai, so I'm not sure if its a xenomai or dbg problem.
Basically, are there known problems with dbg and dbgserver? Is there something xenomai specific that I should put in my gdbinit?
Sent from my Packard Bell 386
GDB: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Target xeno-config:
xeno-config --verbose
--version="2.6.3"
--cc="gcc"
--arch="arm"
--prefix="/usr/xenomai"
--xeno-cflags="-I/usr/xenomai/include -D_GNU_SOURCE -D_REENTRANT-D__XENO__"
--xeno-ldflags="-L/usr/xenomai/lib -lxenomai -lpthread -lrt " --posix-cflags="" --posix-ldflags="-Wl,@/usr/xenomai/lib/posix.wrappers
-L/usr/xenomai/lib -lpthread_rt -lxenomai -lpthread -lrt "
--library-dir="/usr/xenomai/lib"
Target kernel: Linux beaglebone 3.8.13xenomai-bone53 #2 Mon May 19 14:43:41 UTC 2014 armv7l GNU/Linux
Quoted 25 lines · Mathew Benson
First, I'm sorry if this has been asked and answered here before. I found a link to a page to search the archives but the link was broken. So, I'm not sure how to search the archives without downloading them all.
I'm running xenomai 3 on a Beaglebone Black and my host is Mint 17. All the samples checkout. I can build and run my own code using xenomai extensions, but remote debugging seems to be erratic. First, I see two threads immediately at startup though I don't have symbols for the second read. I didn't create this thread, so I'm not sure why its there or where it came from.
Second, the debugger (dbgserver) seems to lose itself. I'll step through code and it will suddenly and at random locations just not break on the next line. Debugger says threads are still alive, but when I pause execution (though I shouldn't have to since I stepped) it appears all the threads are terminated.
Lastly, when I run without the debugger I get different behavior. I never had a problem before I converted to xenomai, so I'm not sure if its a xenomai or dbg problem.
Basically, are there known problems with dbg and dbgserver? Is there something xenomai specific that I should put in my gdbinit?
Sent from my Packard Bell 386
Quoted 4 lines · Mathew Benson
GDB: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Target xeno-config:
xeno-config --verbose--version="2.6.3"
So, that is xenomai 2.6.3, not xenomai 3.
Signature · 1 line
Gilles.
Sorry. Yes, 2.6.3. Good to know about the EINTR though. And I'll check gdb and gdbserver versions tomorrow. But I think I fixed most of my problems, except for a few nagging gdb quirks. Just a few things that weren't inherently obvious and didn't appear in the Doxygen docs. Thanks.
Quoted 11 lines · Gilles Chanteperdrix
Quoted 4 lines · Mathew Benson
GDB: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1 Target xeno-config:
xeno-config --verbose--version="2.6.3"So, that is xenomai 2.6.3, not xenomai 3.
--
Gilles.
Quoted 1 line · Mathew Benson
GDB: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
You shoult not be using gdb, but arm-linux-gnueabihf-gdb, right? If you are using an arm-linux-gnueabihf toolchain.
Signature · 1 line
Gilles.
Correct. I'm using the entire arm-linux-gnueabihf toolchain including gdbserver. It works. Just a little twitchy.
Quoted 9 lines · Gilles Chanteperdrix
Quoted 1 line · Mathew Benson
GDB: GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
You shoult not be using gdb, but arm-linux-gnueabihf-gdb, right? If you are using an arm-linux-gnueabihf toolchain.
--
Gilles.
Quoted 2 lines · Mathew Benson
Correct. I'm using the entire arm-linux-gnueabihf toolchain including gdbserver. It works. Just a little twitchy.
Ok, I am sorry, I did not really understand. Do you still have bugs, meaning different behaviour with and without Xenomai, or not ?
Regards.
Signature · 1 line
Gilles.
Quoted 4 lines · Mathew Benson
First, I'm sorry if this has been asked and answered here before. I found a link to a page to search the archives but the link was broken. So, I'm not sure how to search the archives without downloading them all.
In google, add site:xenomai.org at the end of the search, that is what google custom search did.
Quoted 7 lines
I'm running xenomai 3 on a Beaglebone Black and my host is Mint
17. All the samples checkout. I can build and run my own code using xenomai extensions, but remote debugging seems to be erratic. First, I see two threads immediately at startup though I don't have symbols for the second read. I didn't create this thread, so I'm not sure why its there or where it came from.
This is xenomai logging thread. It allows printf in xenomai applications to avoid switching to secondary mode.
Quoted 8 lines
Second, the debugger (dbgserver) seems to lose itself. I'll step through code and it will suddenly and at random locations just not break on the next line. Debugger says threads are still alive, but when I pause execution (though I shouldn't have to since I stepped) it appears all the threads are terminated.
Lastly, when I run without the debugger I get different behavior.
I am not sure what you mean by that, but yes, using gdb causes threads to:
- be interrupted
- and switch to secondary mode to handle interactions with the debugger.
So, your application should be prepared for some services to return EINTR or -1 with errno set to EINTR, depending on which part of Xenomai POSIX API you are using. For services that are not automatically restarted upon signals that is.
Quoted 5 lines
I never had a problem before I converted to xenomai, so I'm not sure if its a xenomai or dbg problem.
Basically, are there known problems with dbg and dbgserver? Is there something xenomai specific that I should put in my gdbinit?
There should not be. There is one big catch with gdb/gdbserver
though: the versions of the cross-gdb on host and gdbserver on the target should correspond exactly, otherwise the two may not talk the same protocol, and you end up with weird behaviours like what you are describing.
Could you provide us with a simple self-contained test case, and a description of the way to reproduce the problem?
Regards.
Signature · 1 line
Gilles.