Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Hongxu Jia <hongxu.jia@windriver.com>
To: "Mark Hatle" <mark.hatle@windriver.com>,
	"Andreas Müller" <schnitzeltony@googlemail.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 20:59:53 +0800	[thread overview]
Message-ID: <57162BC9.4010708@windriver.com> (raw)
In-Reply-To: <57162516.7000009@windriver.com>

On 04/19/2016 08:31 PM, Mark Hatle wrote:
> On 4/19/16 2:33 AM, Hongxu Jia wrote:
>> Hi all,
>>
>> With some investigation, there is an example to explain how to do remote debug.
>>
>> Also file [YOCTO #9481] for document.
>>
>> Hi Andreas,
>>
>> Would you please have a look the example, to see if it could fit your case.
>>
>> Example:
>>
>> 1. Build a image with gdbserver and gzip installed. The gzip
>>     is the debug binary. Append the following to local.conf
>> ...
>> IMAGE_INSTALL_append = " gdbserver gzip"
>> ...
>>
>> $ bitbake core-image-sato
>>
>> 2. Build gdb-cross for remote debug on host
>>
>> $ bitbake gdb-cross-i586
>>
>> 3. start qemu
>>
>> $ runqemu qemux86 core-image-sato
>>
>> 4. On host side, create symlink /usr/src/debug to
>>     ${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS} which the
>>     location of sources is /usr/src/debug.
>>
>> $ ln -snf /TOPDIR/tmp/work/i586-poky-linux /usr/src/debug
> This is incorrect.  On the host you use the combination of:
>
> (gdb) set sysroot <your debug capable fs path>
> (gdb) set substitute-path /usr/src/debug <your debug capable fs path>/usr/src/debug
>

Yes! Yours is more reasonable. It is verified on my case:

4. On host side, Set a substitution rule for finding source files.
    Replace /usr/src/debug with ${BASE_WORKDIR}/${MULTIMACH_TARGET_SYS}

(gdb) set substitute-path /usr/src/debug /TOPDIR/tmp/work/i586-poky-linux

//Hongxu

>> 5. On target side, ipaddr is 128.224.163.187,
>>     run gdbserver to debug "gzip -h"
>>
>> root@qemux86-64:~# gdbserver localhost:1024 gzip -h
>> Process gzip created; pid = 530
>> Listening on port 1024
>>
>> 6. On host side, enter gzip's devshell
>> $ bitbake -cdevshell gzip
>>
>> 7. On host side, run gdb-cross to remote debug gzip
>>
>> gzip-1.6# i586-poky-linux-gdb ../build/gzip
>>
>> 8. Use path ${STAGING_DIR_HOST} as the system root for
>>     the program being debugged. Any absolute shared
>>     library paths will be prefixed with path;
>>
>> (gdb) set sysroot /TOPDIR/tmp/sysroots/qemux86
>>
>>
>> 9. Start remote target, set break point at help()
>>
>> (gdb) target remote 128.224.163.187:1024
>> (gdb) break gzip.c:325
>> (gdb) info break
>> Num     Type           Disp Enb Address            What
>> 1       breakpoint     keep y   0x0000000000401ec1 in main at
>> /usr/src/debug/gzip/1.6-r0/gzip-1.6/gzip.c:325
>> (gdb) c
>> Continuing.
>>
>> Breakpoint 1, main (argc=2, argv=0x7fffffffeca8) at
>> /usr/src/debug/gzip/1.6-r0/gzip-1.6/gzip.c:465
>> 465                 help(); do_exit(OK); break;
>> (gdb) list
>> 460             case 'd':
>> 461                 decompress = 1; break;
>> 462             case 'f':
>> 463                 force++; break;
>> 464             case 'h': case 'H':
>> 465                 help(); do_exit(OK); break;
>> 466             case 'k':
>> 467                 keep = 1; break;
>> 468             case 'l':
>> 469                 list = decompress = to_stdout = 1; break;
>> (gdb) c
>> Continuing.
>> [Inferior 1 (process 1246) exited normally]
>>
>>
>> 10. On target side, get output of "gzip -h"
>> [snip]
>> Remote debugging from host 128.224.153.74
>> Usage: gzip [OPTION]... [FILE]...
>> Compress or uncompress FILEs (by default, compress FILES in-place).
>>
>> Mandatory arguments to long options are mandatory for short options too.
>>
>>    -c, --stdout      write on standard output, keep original files unchanged
>>    -d, --decompress  decompress
>>    -f, --force       force overwrite of output file and compress links
>>    -h, --help        give this help
>>    -k, --keep        keep (don't delete) input files
>>    -l, --list        list compressed file contents
>>    -L, --license     display software license
>>    -n, --no-name     do not save or restore the original name and time stamp
>>    -N, --name        save or restore the original name and time stamp
>>    -q, --quiet       suppress all warnings
>>    -r, --recursive   operate recursively on directories
>>    -S, --suffix=SUF  use suffix SUF on compressed files
>>    -t, --test        test compressed file integrity
>>    -v, --verbose     verbose mode
>>    -V, --version     display version number
>>    -1, --fast        compress faster
>>    -9, --best        compress better
>>
>> With no FILE, or when FILE is -, read standard input.
>>
>> Report bugs to <bug-gzip@gnu.org>.
>>
>> Child exited with status 0
>> GDBserver exiting
>> [snip]
>>
>> //Hongxu
>>



  reply	other threads:[~2016-04-19 12:59 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 [this message]
2016-04-19 14:11                             ` Andreas Müller
2016-04-19 14:47                               ` Mark Hatle
2016-04-19 14:49                                 ` Mark Hatle
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=57162BC9.4010708@windriver.com \
    --to=hongxu.jia@windriver.com \
    --cc=mark.hatle@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox