gdb with a broken sdk


dacav
 

Hello!


I'd like debug an application that is running on my target board.
I installed gdbserver on the target, and I'd like to connect to it
from a gdb instance running locally.

Because of a broken 3rd party meta-layer, I'm currently unable to
build the SDK. In short, the `populate_sdk` task fails, as well as
`meta-toolchain`.

This page[1] of the documentation suggests to run
`bitbake gdb-cross-<architecture>` (where <architecture>=aarch65, in
my case). The task completes successfully.

I can find my gtb binary:

$ find $tmp -name aarch64-foobar-gdb

It ends up being in a sysroot:

$tmp/sysroots-components/x86_64/gdb-cross-aarch64/usr/bin/aarch64-foobar/aarch64-foobar-gdb

Unfortunately, invoking such binary fails because of runtime
dependencies (python) being missing. It will dump a stack trace
and say:

AttributeError: module 'sys' has no attribute 'lib'

This is most likely due to some PATH-like environment variable not
being set. I've asked for advice on #yocto, where I was suggested to
try with `bitbake -c devshell`.

The trick seems to work in that I can find various aarch64-foobar-*
executables, but I can't find aarch64-foobar-gdb. There are also
a few incompatible binaries, e.g. aarch64-none-elf-gdb, arm-none-...gdb.
None of them seem to be useful agains my target.

How can I include aarch64-foobar-gdb in the devshell's PATH?



Thanks in advance,
- dacav


[1] https://docs.yoctoproject.org/dev-manual/common-tasks.html?highlight=gdb#using-the-gdbserver-method

Join yocto@lists.yoctoproject.org to automatically receive all group messages.