[yocto] using gdb with externalsrc

Dave Kimble dkimble at alticast.com
Thu Jul 16 10:20:56 PDT 2015


The path is S (externalsrc path).

compiler flags:
i586-poky-linux-gcc  -m32 -march=i586 --sysroot=[sysroot dir] -DHAVE_CONFIG_H -I. -I[externalsrc dir] -I..   -D_ANSC_LINUX -D_ANSC_USER -D_ANSC_LITTLE_ENDIAN_  -O2 -pipe -g -feliminate-unused-debug-types     -c -o [component].o `test -f '[component source file]' 

(gdb) show directories
Source directories searched: $cdir:$cwd


Would it work to do add a do_package_append() that just manually copies the sources?


________________________________________
From: Khem Raj <raj.khem at gmail.com>
Sent: Wednesday, July 15, 2015 8:54 PM
To: Dave Kimble
Cc: yocto at yoctoproject.org
Subject: Re: [yocto] using gdb with externalsrc

On Wed, Jul 15, 2015 at 2:52 PM, Dave Kimble <dkimble at alticast.com> wrote:
> Yes, I'm able to debug the externalsrc component. I can see variables, set
> breakpoints, step/next through the code etc. (so the symbols are valid). And
> local changes to the externalsrc component are reflected when I debug.
>
> But I can't list the externalsrc component source code from within gdb (or
> find it anywhere in the image). The source for all of the other components
> is in the image (and I can list it in gdb). When I try to list the code for
> the externalsrc component, gdb prints this error message:
> "[path on my build machine]/sourceFile.c: No such file or directory."

is this path pointing to S which is externalsrc path or to B which is
under build TMPDIR
and secondly, can you see compiler flags used during build for externalsrc ?

are you using master branch ?

what does show directories say

>
> If I don't use externalsrc at all, I can debug all of the components and
> list source code for all of them from within gdb.
>
> So, I can't solve how to get the externalsrc source code into the image. I
> don't mind if I have to use "set substitute-path" from within gdb if
> externalsrc source files are put in a different place (although, it'd be
> ideal if they were put in the same place).
>

sources are embedded in debug info, most probably when debug-split is done
at that point there could be something going wrong where its not able
to put the right path links



More information about the yocto mailing list