GUF-Yocto-jethro-9.0-r7707-0
i.MX6
User Manual
11.1.5 Remote vs. native debugging
To be able to debug Embedded Linux system with low memory footprint GDB is extended to be run from a remote
development host by connecting to a minimal debug agent called
gdbserver
for user space degugging and
kgdb
or
kgdboe
for kernel debugging. The communication can be done through RS232, Ethernet or even USB.
This technique allows the developer to keep both the debug symbol copies of the binaries and the source code
just on the host system.
In contrast native debugging can be done on the target system too. A native GDB is also available on Garz &
Fricke Yocto systems. However, this is more complicated since the directories for the symbol files and the source
files must be made available from the SDK through e.g. a network file system.
So the recommended way for debugging is remote debugging out of the Yocto SDK that is shipped with Garz &
Fricke Yocto systems.
11.1.6 User space code vs. kernel code debugging
As already stated above the kernel is treated differently with respect to debugging. Apart from the already
explained different debug agents to use, kernel debugging requires a deeper understanding of the OS aspects
such as virtual memory mapping, interrupt processing etc. and is currently beyond the scope of this manual.
11.1.7 Known issues
Static instanciation in implicitly implemented C++ methods causes a GDB segmentation fault in newer
Glibc versions
Since the switch from
EGlibc
to
GLibc
in Yocto the following exception is known when instantiating static vari-
ables in implicitely implemented C++ member methods.
GDB complains with the following exception
Program received signal SIGSEGV, Segmentation fault.
_dl_debug_initialize (ldbase=1447, ns=195728) at dl-debug.c:55
55
if (r->r_map == NULL || ldbase != 0)
if something like the following code excerpt is implemented:
...
class AnotherClass
{
public:
AnotherClass();
};
...
class AClass
{
public:
void pub()
{
static Anotherclass crashingInstance; // Crash here ... move pub() to void AClass
,!
:pub()
}
};
...
MainClass::MainClass()
{
AClass anInstance;
anInstace.pub();
}
...
The error is gone if the method is converted to an explicit implementation:
67