Re: #dunfell Path to sources in debugfs #dunfell


Robert Berger
 

Hi,

My comments are inline.

On 05/10/2021 17:04, bohdan.shubenok@sigma.software wrote:
Hi all,
I`m trying to debug coredump generated on embedded system running dunfel.
Just to clarify your user space applications crashes and you try to see why? In other words you would like to load the application and the core file into your debugger and inspect it?

The issue I`m facing is with the source files path in "-dbg.rootfs" archive and within dedug portion of a package.
When loaded in QtCreator some sources can`t be found :
The part is missing is "*build/..*". Such notation is obviosly cancels itself and adding empty "build" folder manually helps.
This path allings with how it builds. Here is a part of Makefile found in build path for sqlite:
   build/Makefile:20:VPATH = ../sqlite-autoconf-3310100
   build/Makefile:313:abs_srcdir = /home/bohdan/noah/noah/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/sqlite3/3_3.31.1-r0/build/../sqlite-autoconf-3310100
   build/Makefile:315:abs_top_srcdir = /home/bohdan/noah/noah/tmp/work/cortexa8hf-neon-poky-linux-gnueabi/sqlite3/3_3.31.1-r0/build/../sqlite-autoconf-3310100
   build/Makefile:358:srcdir = ../sqlite-autoconf-3310100
So I tried to disable out-of-tree build for sqlite by replacing *'inherit autotools*' with '*inherit autotools-brokensep*'. After building and loading new debugfs QtCreator was able to found required sources:
Is this a known issue or me doing something wrong with build setup?
This is very strange, but also I am not quite sure how exactly you debug.
I assume you run gdbserver on the target and connect from some cross-gdb on your host to it.

You could try to install gdb onto your target plus debug info and sources to exclude the cross-gdb configuration problem as I describe below.

If you use gdbserver/cross-gdb I assume directories on your target rootfs and host roots are different. So you need to tell your cross-gdb on the host where to find the debug info and the sources.

Can you please try something like this?

http://docs.yoctoproject.org/singleindex.html#using-the-gdbserver-method

What I would inspect carefully is something like that:

$ cd directory-holding-the-debugfs-directory
$ arch-gdb
(gdb) set sysroot debugfs
(gdb) set substitute-path /usr/src/debug debugfs/usr/src/debug
(gdb) target remote IP-of-target:1234

At least in the latest and greatest version this works. I remember a bug a long time ago with some ancient yocto release with cross-debugging, but this was resolved with some upgrade and was certainly older than dunfell.

Regards,

Robert

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