All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Hatle <mark.hatle@windriver.com>
To: "Andreas Müller" <schnitzeltony@googlemail.com>,
	"Hongxu Jia" <hongxu.jia@windriver.com>
Cc: Patches and discussions about the oe-core layer
	<openembedded-core@lists.openembedded.org>
Subject: Re: [PATCH 01/17] conf/bitbake.conf package.bbclass: fix dbg package not contain sources while -fdebug-prefix-map used
Date: Tue, 19 Apr 2016 09:49:44 -0500	[thread overview]
Message-ID: <57164588.80204@windriver.com> (raw)
In-Reply-To: <571644F9.1080400@windriver.com>

Of course after hitting send, I noticed the example in 7 was missing on step.. :P

On 4/19/16 9:47 AM, Mark Hatle wrote:
> On 4/19/16 9:11 AM, Andreas Müller wrote:
>> thanks a lot for your efforts. Do I understand this right: You suggest
>> to use build sysroot (on my own risk - as I did before) and make gdb
>> happy by linking sources?
>>
>> Problem I see is that we have multiple package archs e.g
>> ARM/ARMThumb/Machine so ${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}
>> expands to multiple paths. But a script symlinking all together + set
>> substitute-path might help here...
>>
>> I will play around with this in the later...
>>
>> Andreas
>>
> 
> See Yocto Project bug #9481: https://bugzilla.yoctoproject.org/show_bug.cgi?id=9481
> 
> Below are the steps that I have added that I hope will be documented in the YP
> 2.1 documentation. (This matches current master.)
> 
> I just went through and verified the steps on my local machine. As noted, there
> is currently a bug in the debugfs creation. RP helped me fix the 'rpm' case, but
> it appears ipkg support is broken in some way.
> 
> 
> 
> 1. Configure your build system to construct the companion debug filesystem
> 
> In the local.conf:
> 
> IMAGE_GEN_DEBUGFS = '1'
> IMAGE_FSTYPES_DEBUGFS = 'tar.bz2'
> 
> The options above will cause the system to generate a special companion
> filesystem fragment, that contains the matching source and debug symbols to your
> deployable filesystem. It does this by looking at what is in the deployed
> filesystem, and pulling the corresponding -dbg packages.
> 
> The companion debug filesystem is NOT a complete filesystem, but only contains
> the debug fragements. It must be combined with the full filesystem for
> debugging. (Later steps will show this.)
> 
> 2. Configure the system to include gdbserver in the target filesystem
> 
> In the local.conf (or an image recipe):
> 
> IMAGE_INSTALL_append = “ gdbserver"
> 
> 3. Build the environment
> 
> Construct the image (and companion Debug Filesystem)
> bitbake <image>
> 
> Build the cross GDB component and make it available for debugging
> 
> Build the SDK that matches the image (this is best for a production build for
> later debugging, especially during long term maintenance)
> bitbake -c populate_sdk <image>
> 
> or
> 
> Build the minimal toolchain components that match the target (this is smaller
> then a typical SDK and only contains a minimal set of components to build simple
> test applications, as well as run the debugger)
> bitbake meta-toolchain
> 
> or
> 
> Build gdb itself within the build system (this produces a temporary copy of
> cross-gdb that can be used for debugging during development. It is the quickest
> approach, but the other methods are better for long term maintenance strategies.)
> bitbake gdb-cross-<arch>
> 
> (Note: If you run bitbake gdb-cross, the system will give you a suggestion like
> gdb-cross-i586, the suggestion is likely the actual name you want to use.)
> 
> 4. Setup your environment
> 
> 4.1 Setup the debugfs
> 
> $ mkdir debugfs
> $ cd debugfs
> $ tar xvfj <build dir>/tmp-glibc/deploy/images/<machine>/<image>.rootfs.tar.bz2
> $ tar xvfj <build dir>/tmp-glibc/deploy/images/<machine>/<image>-dbg.rootfs.tar.bz2
> 
> 4.2 Setup GDB
> 
> Install the SDK (if you built one) and source the correct environment file. This
> will put it in your path.
> 
> if using the build system gdb will be in
> <build>/<tmp>/sysroots/<host>/usr/bin/<arch>/<arch>-gdb
> 
> 5. Boot the target
> 
> For QEMU, <link to runqemu docs…>
> 
> (verify that your host can access the target via TCP)
> 
> 6. Debug a program
> 
> 6.1 Run gdbserver on the target, such as:
> 
> (We’ll debug gzip in this example, see gdbserver docs for additional options)
> 
> root@qemux86:~# gdbserver localhost:1234 /bin/gzip —help
> 
> 6.2 On the host, run gdb, configure it and connect to the target:
> 
> $ cd <directory holding the debugfs dir>
> $ <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 this point everything should automatically load (matching binaries, symbols
> and headers.)
> 
> Note: the gdb ‘set’ commands above can be placed into the users ~/.gdbinit GDB
> will automatically run whatever commands are in that file when it is started.
> 
> 
> 7. Deploying WITHOUT a full image rebuild
> 
> In many cases, during development you want a quick method to deploy a new binary
> to the target and debug it, without waiting for a full image build.
> 
> One approach to this is to build the component you want to debug. Then directly
> copy the executable to BOTH the target and the host ‘debugfs’. If the binary is
> processed through the debug splitting in OE, you should also copy the debug
> items (the .debug contents and corresponding /usr/src/debug) from the work dir.
> 
> Such as:
> 
> $ bitbake bash
> $ bitbake -c devshell bash
> $ cd ..
> $ scp packages-split/bash/bin/bash <target>:/bin/bash

(missing step)
$ cp packages-split/bash/bin/bash <path>/debugfs/bin/bash

> $ cp -a packages-split/bash-dbg/* <path>/debugfs
> 
> 



  reply	other threads:[~2016-04-19 14:49 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-03-28  8:18 [PATCH V7 00/17] fix buildpaths QA issue && dbp package source generation Hongxu Jia
2016-03-28  8:18 ` [PATCH 01/17] conf/bitbake.conf package.bbclass: fix dbg package not contain sources while -fdebug-prefix-map used Hongxu Jia
2016-04-18  8:09   ` Andreas Müller
2016-04-18  8:11     ` Hongxu Jia
2016-04-18  8:23       ` Andreas Müller
2016-04-18  8:32         ` Hongxu Jia
2016-04-18  8:47           ` Andreas Müller
2016-04-18  9:04             ` Hongxu Jia
2016-04-18  9:15               ` Andreas Müller
2016-04-18  9:34                 ` Hongxu Jia
2016-04-18  9:52                   ` Andreas Müller
2016-04-18 13:08                     ` Hongxu Jia
2016-04-18 13:55                       ` Burton, Ross
2016-04-18 14:16                         ` Andreas Müller
2016-04-18 14:51                           ` Richard Purdie
2016-04-18 18:50                           ` Mark Hatle
2016-04-18 21:05                             ` Andreas Müller
2016-04-19  0:51                               ` Mark Hatle
2016-04-19  4:32                             ` Paul Eggleton
2016-04-19 12:29                               ` Mark Hatle
2016-04-19  7:33                           ` Hongxu Jia
2016-04-19 12:31                             ` Mark Hatle
2016-04-19 12:59                               ` Hongxu Jia
2016-04-19 14:11                             ` Andreas Müller
2016-04-19 14:47                               ` Mark Hatle
2016-04-19 14:49                                 ` Mark Hatle [this message]
2016-04-19 14:54                               ` Richard Purdie
2016-04-19 21:50                                 ` Andreas Müller
2016-04-28 21:41                                 ` Andreas Müller
2016-04-19  1:46                         ` Hongxu Jia
2016-03-28  8:18 ` [PATCH 02/17] gcc-5.3/gcc-4.9: -fdebug-prefix-map support to remap relative path Hongxu Jia
2016-03-28  8:18 ` [PATCH 03/17] conf/bitbake.conf package.bbclass: improve dbg package sources generation from work-shared Hongxu Jia
2016-03-29 22:38   ` Richard Purdie
2016-03-30  1:58     ` Hongxu Jia
2016-03-30  5:36       ` Hongxu Jia
2016-03-28  8:18 ` [PATCH 04/17] dtc.inc: fix buildpaths QA issue Hongxu Jia
2016-03-28  8:18 ` [PATCH 05/17] fix_buildpaths.bbclass: add bbclass to fix build path Hongxu Jia
2016-03-28  8:18 ` [PATCH 06/17] icu: fix buildpaths QA issue Hongxu Jia
2016-03-28  8:18 ` [PATCH 07/17] tcl: fix buildpath " Hongxu Jia
2016-03-28  8:18 ` [PATCH 08/17] python2/3: " Hongxu Jia
2016-03-28  8:18 ` [PATCH 09/17] bbclass distutils/distutils3: fix .pyc/.pyo buildpath Hongxu Jia
2016-03-28  8:18 ` [PATCH 10/17] bbclass distutils/distutils3/setuptools/setuptools3: clean up DISTUTILS_INSTALL_ARGS Hongxu Jia
2016-03-28  8:18 ` [PATCH 11/17] python-setuptools/python3-setuptools: use old-style install Hongxu Jia
2016-03-28  8:18 ` [PATCH 12/17] python3-pip: " Hongxu Jia
2016-03-28  8:18 ` [PATCH 13/17] waf.bbclass: support do patch on extracted files Hongxu Jia
2016-03-28  8:18 ` [PATCH 14/17] python-pycairo: fix buildpath QA issue Hongxu Jia
2016-03-28  8:18 ` [PATCH 15/17] openssl: " Hongxu Jia
2016-03-28  8:19 ` [PATCH 16/17] epiphany: fix buildpaths " Hongxu Jia
2016-03-28  8:19 ` [PATCH 17/17] ifupdown: fix do_compile failed while GCCVERSION = "4.9%" Hongxu Jia
2016-03-30  8:06 ` [PATCH V7 00/17] fix buildpaths QA issue && dbp package source generation Hongxu Jia

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57164588.80204@windriver.com \
    --to=mark.hatle@windriver.com \
    --cc=hongxu.jia@windriver.com \
    --cc=openembedded-core@lists.openembedded.org \
    --cc=schnitzeltony@googlemail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.