• 07/14/2017
  • Public Content
Contents

Debug

When developers compile, build, and run their applications, they may encounter runtime errors or other problems. There are several methods to debug different issues on the compute module.
Additional debug information can be found in these topics:
Establishing a Serial Connection
The expansion board includes a Serial to USB bridge which provides a the channel to receive runtime message and send commands.
Application Debugging
GDB on device usage
As the preferred debugger on Linux systems,
GNU Debugger
(GDB) is included with the Ref-OS-IoT image. GDB is free software protected by the GNU General Public License.
Note:
For more information on GDB, visit:
.
Example:
Add the -g flag to include appropriate debug information on the generated binary to debug the native C application with GDB. You can compile it directly on the target module or cross-compile on a host and deploy to the target device after.
$CC -g -o helloworld hello_world.c
Start debugging and run the application with the following:
root@intel-5xx-64:~# gdb helloworld
GNU gdb (GDB) 7.12
Copyright (C) 2016 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-refos-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from helloworld...done.
(gdb) run
Starting program: /home/root/helloworld
Hello world![Inferior 1 (process 1003) exited normally]
GDB remote usage
Pre-requirement:
By default, gdbserver is not included into the image, so you need to build your own custom image by adding the following line to local.conf:
REFKIT_IMAGE_EXTRA_FEATURES += “tools-debug”
When developing native applications, you will use a host machine to cross-compile the application and deploy it on the remote development board. To enable remote debugging, start gdbserver so that developers can debug binaries from the host machine remotely.
On the Intel® Joule™ module, open port 2345 and start
gdbserver on it
:
root@intel-5xx-64:~# iptables -A INPUT -p tcp --dport 2345 -j ACCEPT root@intel-5xx-64:~# gdbserver :2345 helloworld Process helloworld created; pid = 948 Listening on port 2345
On the host machine, run
gdb
, then connect target device using “
target
<target_ip>:<port>
” command
and run with “
continue” a
s shown below:
$ gdb
GNU gdb (Ubuntu 7.7.1-0ubuntu5~14.04.2) 7.7.1
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word".
(gdb)
target remote 10.237.55.40:2345
^C10.237.55.40:2345: Interrupted system call.
(gdb) target remote 10.237.55.40:2345
Remote debugging using 10.237.55.40:2345
warning: Could not load vsyscall page because no executable was specified
try using the "file" command first.
0x00000038f4800c40 in ?? ()
(gdb)
continue
Continuing.
[Inferior 1 (process 925) exited normally]
(gdb)
 

Product and Performance Information

1

Intel's compilers may or may not optimize to the same degree for non-Intel microprocessors for optimizations that are not unique to Intel microprocessors. These optimizations include SSE2, SSE3, and SSSE3 instruction sets and other optimizations. Intel does not guarantee the availability, functionality, or effectiveness of any optimization on microprocessors not manufactured by Intel. Microprocessor-dependent optimizations in this product are intended for use with Intel microprocessors. Certain optimizations not specific to Intel microarchitecture are reserved for Intel microprocessors. Please refer to the applicable product User and Reference Guides for more information regarding the specific instruction sets covered by this notice.

Notice revision #20110804