#dunfell Path to sources in debugfs #dunfell


bohdan.shubenok@...
 

Hi all,

I`m trying to debug coredump generated on embedded system running dunfel. 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?


Khem Raj
 

On 10/5/21 7:04 AM, bohdan.shubenok@sigma.software wrote:
Hi all,
I`m trying to debug coredump generated on embedded system running dunfel. 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?
I think its not a general problem with autotool based projects doing out of tree builds but just with sqlite3 package. Perhaps you might want to look at compiler commandline options being passed to sqlite3 build and see if paths can be adjusted during build to account for out of tree build.


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


bohdan.shubenok@...
 

Hi,

I can see this on Qt builds as well. I doubt Qt can have such strange behavior left unnoticed for a long time. The part is missing is "include/QtCore"


bohdan.shubenok@...
 

Hi,

I`m trying to debug without connection to target at all. This are the examples of what I`m running:

# gdb-multiarch b2010_rootfs/usr/bin/noah-heatsystem var/volatile/crash/core.noah.565
(gdb) set sysroot b2010_rootfs/
(gdb) set substitute-path /usr/src/debug b2010/usr/src/debug
.... things are getting loaded .....

(gdb) bt
#0  0xb4a6a144 in saveCursorsOnList (p=0xccf34862, iRoot=3, pExcept=0xb540b350) at ../sqlite-autoconf-3310100/sqlite3.c:64883
.... more frames here .....

And this how it looks like when out of tree build disabled:

# gdb-multiarch b2010_rootfs/usr/bin/noah-heatsystem var/volatile/crash/core.noah.565
(gdb) set sysroot src_add_rootfs/
(gdb) set substitute-path /usr/src/debug src_add_rootfs/usr/src/debug
.... things are getting loaded .....

(gdb) bt
#0  0xb4a6a144 in saveCursorsOnList (p=0xccf34862, iRoot=3, pExcept=0xb540b350) at sqlite3.c:64883
.... more frames here .....


In a  first case `layout next` command shows that no source code can be found and in a second case source code is shown.

Best regards,

Bohdan.