<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>9305</bug_id>
          
          <creation_ts>2016-03-18 11:20:12 +0000</creation_ts>
          <short_desc>-dbg packages have stopped containing sources while -fdebug-prefix-map used</short_desc>
          <delta_ts>2016-04-14 20:05:29 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>2.3</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>High</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>2.1 M4</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Hongxu Jia">hongxu.jia</reporter>
          <assigned_to name="Hongxu Jia">hongxu.jia</assigned_to>
          <cc>liezhi.yang</cc>
    
    <cc>mark.hatle</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>richard.purdie</cc>
    
    <cc>ross.burton</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>No (bug/feature does not impact docs)</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>60147</commentid>
    <comment_count>0</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-18 11:20:12 +0000</bug_when>
    <thetext>The problem is the way we use debugedit to extract the sources list at do_package

The generate debugsources.list did not has sources list any more.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60154</commentid>
    <comment_count>1</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-03-18 14:55:45 +0000</bug_when>
    <thetext>I have a potential fix for this.

# This has to be long enough to support remapping
DEBUG_REMAP_DIR = &quot;/usr/src/build/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}&quot;

DEBUG_FLAGS = &quot;-g -feliminate-unused-debug-types \
                -fdebug-prefix-map=${WORKDIR}=${DEBUG_REMAP_DIR} \
                -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
                -fdebug-prefix-map=${STAGING_DIR_HOST}= \
&quot;

DEBUGSRC_OVERRIDE_PATH = &quot;${@os.path.dirname(os.path.dirname(d.getVar(&apos;DEBUG_REMAP_DIR&apos;, True) or &quot;&quot;))}&quot;


I&apos;m also investigating replacing the &apos;debugedit&apos; program.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60155</commentid>
    <comment_count>2</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-03-18 14:56:38 +0000</bug_when>
    <thetext>Forgot that fix would go into the bitbake.conf

Also each of the three items should likely be ?= or ??=</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60173</commentid>
    <comment_count>3</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-19 15:06:07 +0000</bug_when>
    <thetext>(In reply to comment #1)
&gt; I have a potential fix for this.
&gt; 
&gt; # This has to be long enough to support remapping
&gt; DEBUG_REMAP_DIR =
&gt; &quot;/usr/src/build/${MULTIMACH_TARGET_SYS}/${PN}/${EXTENDPE}${PV}-${PR}&quot;
&gt; 
&gt; DEBUG_FLAGS = &quot;-g -feliminate-unused-debug-types \
&gt;                 -fdebug-prefix-map=${WORKDIR}=${DEBUG_REMAP_DIR} \
&gt;                 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
&gt;                 -fdebug-prefix-map=${STAGING_DIR_HOST}= \
&gt; &quot;
&gt; 
&gt; DEBUGSRC_OVERRIDE_PATH =
&gt; &quot;${@os.path.dirname(os.path.dirname(d.getVar(&apos;DEBUG_REMAP_DIR&apos;, True) or
&gt; &quot;&quot;))}&quot;
&gt; 
&gt; 
&gt; I&apos;m also investigating replacing the &apos;debugedit&apos; program.

Got it, thanks,

I would like to learn it.

//Hongxu</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60181</commentid>
    <comment_count>4</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 07:43:54 +0000</bug_when>
    <thetext>1. Prepare a C source file and use rpm-native&apos;s debugedit for testing:

mkdir -p /folk/hjia/dir1/dir2

cat &lt;&lt; ENDOF &gt; /folk/hjia/dir1/dir2/test.c

int main(int argc, char *argv[])
{
  return 0;
}
ENDOF

DEBUGEDIT=&quot;/buildarea/raid0/hjia/build-20160321-yocto-buildpath/tmp/work/x86_64-linux/rpm-native/5.4.16-r0/build/tools/debugedit&quot;


2. Use absolute path to compile, and replace &quot;/folk/hjia&quot; with &quot;/usr/src&quot; in DWARF
   The result was expected.

gcc -g /folk/hjia/dir1/dir2/test.c -o test_absolute

$DEBUGEDIT -b &quot;/folk/hjia&quot; -d &quot;/usr/src&quot; -i -l test_absolute.list test_absolute

objdump -g test_absolute &gt; test_absolute.log

vim test_absolute.log
--------
124 Contents of the .debug_info section:
134     &lt;11&gt;   DW_AT_name        : (indirect string, offset: 0x5): /usr/src/dir1/dir2/test.c

251  The Directory Table (offset 0x1b):
252   1     /usr/src/dir1/dir2
253   2     X
254 
255  The File Name Table (offset 0x31):
256   Entry Dir     Time    Size    Name
257   1     1       0       0       test.c

268 Contents of the .debug_str section:
269 
270   0x00000000 61726776 002f7573 722f7372 632f6469 argv./usr/src/di
271   0x00000010 72312f64 6972322f 74657374 2e630063 r1/dir2/test.c.c
272   0x00000020 00617267 63006368 6172006d 61696e00 .argc.char.main.
273   0x00000030 474e5520 4320342e 382e3420 2d6d7475 GNU C 4.8.4 -mtu
274   0x00000040 6e653d67 656e6572 6963202d 6d617263 ne=generic -marc
275   0x00000050 683d7838 362d3634 202d6720 2d667374 h=x86-64 -g -fst
276   0x00000060 61636b2d 70726f74 6563746f 7200     ack-protector.
--------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60182</commentid>
    <comment_count>5</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 07:47:14 +0000</bug_when>
    <thetext>3. Use relative path to compile, if we still use the same repalcement,
   the result was not expected. &apos;/folk/hjia&apos; still existed in DWARF

gcc -g ./dir1/dir2/dir3/test.c -o test_reltive

$DEBUGEDIT -b &quot;/folk/hjia/dir1/dir2&quot; -d &quot;/usr/src/debug&quot; -i -l test_reltive.list test_reltive

objdump -g test_reltive &gt; test_reltive.log

vim test_reltive.log
--------
124 Contents of the .debug_info section:
134     &lt;11&gt;   DW_AT_name        : (indirect string, offset: 0x0): ./dir1/dir2/test.c
135     &lt;15&gt;   DW_AT_comp_dir    : (indirect string, offset: 0x1d): /folk/hjia

253  The Directory Table (offset 0x1b):
254   1     dir1/dir2
255   2     X
256 
257  The File Name Table (offset 0x28):
258   Entry Dir     Time    Size    Name
259   1     1       0       0       test.c

270 Contents of the .debug_str section:
271 
272   0x00000000 2e2f6469 72312f64 6972322f 74657374 ./dir1/dir2/test
273   0x00000010 2e630061 72677600 61726763 002f666f .c.argv.argc./fo
274   0x00000020 6c6b2f68 6a696100 63686172 006d6169 lk/hjia.char.mai
275   0x00000030 6e00474e 55204320 342e382e 34202d6d n.GNU C 4.8.4 -m
276   0x00000040 74756e65 3d67656e 65726963 202d6d61 tune=generic -ma
277   0x00000050 7263683d 7838362d 3634202d 67202d66 rch=x86-64 -g -f
278   0x00000060 73746163 6b2d7072 6f746563 746f7200 stack-protector.
--------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60183</commentid>
    <comment_count>6</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 07:55:16 +0000</bug_when>
    <thetext>4. If we use relative path to compile, we should use &apos;/src&apos; to replace &apos;/folk&apos;.

gcc -g ./dir1/dir2/test.c -o test_reltive

$DEBUGEDIT -b &quot;/folk&quot; -d &quot;/src&quot; -i -l test_reltive.list test_reltive

objdump -g test_reltive &gt; test_reltive.log

vim test_reltive.log
--------
124 Contents of the .debug_info section:
134     &lt;11&gt;   DW_AT_name        : (indirect string, offset: 0x0): ./dir1/dir2/test.c
135     &lt;15&gt;   DW_AT_comp_dir    : (indirect string, offset: 0x1d): /src/hjia

253  The Directory Table (offset 0x1b):
254   1     dir1/dir2
255   2     X
256 
257  The File Name Table (offset 0x28):
258   Entry Dir     Time    Size    Name
259   1     1       0       0       test.c

270 Contents of the .debug_str section:
271 
272   0x00000000 2e2f6469 72312f64 6972322f 74657374 ./dir1/dir2/test
273   0x00000010 2e630061 72677600 61726763 002f7372 .c.argv.argc./sr
274   0x00000020 632f686a 69610000 63686172 006d6169 c/hjia..char.mai
275   0x00000030 6e00474e 55204320 342e382e 34202d6d n.GNU C 4.8.4 -m
276   0x00000040 74756e65 3d67656e 65726963 202d6d61 tune=generic -ma
277   0x00000050 7263683d 7838362d 3634202d 67202d66 rch=x86-64 -g -f
278   0x00000060 73746163 6b2d7072 6f746563 746f7200 stack-protector.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60184</commentid>
    <comment_count>7</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 08:05:15 +0000</bug_when>
    <thetext>5. Drop debugedit, we just use -fdebug-prefix-map=/folk/hjia=/usr/src to compile

1) Use absolute path to compile:

gcc -fdebug-prefix-map=/folk/hjia=/usr/src  -g /folk/hjia/dir1/dir2/test.c -o test_absolute

objdump -g test_absolute &gt; test_absolute.log

vim test_absolute.log
--------
124 Contents of the .debug_info section:
&lt;11&gt;   DW_AT_name        : (indirect string, offset: 0x6f): /usr/src/dir1/dir2/test.c

251  The Directory Table (offset 0x1b):
252   1     /usr/src/dir1/dir2
253 
254  The File Name Table (offset 0x2f):
255   Entry Dir     Time    Size    Name
256   1     1       0       0       test.c

267 Contents of the .debug_str section:
268 
269   0x00000000 61726776 00474e55 20432034 2e382e34 argv.GNU C 4.8.4
270   0x00000010 202d6d74 756e653d 67656e65 72696320  -mtune=generic 
271   0x00000020 2d6d6172 63683d78 38362d36 34202d67 -march=x86-64 -g
272   0x00000030 202d6664 65627567 2d707265 6669782d  -fdebug-prefix-
273   0x00000040 6d61703d 2f666f6c 6b2f686a 69613d2f map=/folk/hjia=/
274   0x00000050 7573722f 73726320 2d667374 61636b2d usr/src -fstack-
275   0x00000060 70726f74 6563746f 72006172 6763002f protector.argc./
276   0x00000070 7573722f 7372632f 64697231 2f646972 usr/src/dir1/dir
277   0x00000080 322f7465 73742e63 006d6169 6e006368 2/test.c.main.ch
278   0x00000090 617200                              ar.
--------

2) Use relative path to compile:

gcc -fdebug-prefix-map=/folk/hjia=/usr/src  -g ./dir1/dir2/test.c -o test_reltive

objdump -g test_reltive &gt; test_reltive.log

vim test_reltive.log
--------
124 Contents of the .debug_info section:
134     &lt;11&gt;   DW_AT_name        : (indirect string, offset: 0x0): ./dir1/dir2/test.c
135     &lt;15&gt;   DW_AT_comp_dir    : (indirect string, offset: 0x18): /usr/src

253  The Directory Table (offset 0x1b):
254   1     ./dir1/dir2
255 
256  The File Name Table (offset 0x28):
257   Entry Dir     Time    Size    Name
258   1     1       0       0       test.c

269 Contents of the .debug_str section:
270 
271   0x00000000 2e2f6469 72312f64 6972322f 74657374 ./dir1/dir2/test
272   0x00000010 2e630061 72677600 2f757372 2f737263 .c.argv./usr/src
273   0x00000020 00474e55 20432034 2e382e34 202d6d74 .GNU C 4.8.4 -mt
274   0x00000030 756e653d 67656e65 72696320 2d6d6172 une=generic -mar
275   0x00000040 63683d78 38362d36 34202d67 202d6664 ch=x86-64 -g -fd
276   0x00000050 65627567 2d707265 6669782d 6d61703d ebug-prefix-map=
277   0x00000060 2f666f6c 6b2f686a 69613d2f 7573722f /folk/hjia=/usr/
278   0x00000070 73726320 2d667374 61636b2d 70726f74 src -fstack-prot
279   0x00000080 6563746f 72006172 6763006d 61696e00 ector.argc.main.
280   0x00000090 63686172 00                         char.
--------</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60185</commentid>
    <comment_count>8</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 08:19:38 +0000</bug_when>
    <thetext>The -fdebug-prefix-map is more powerful than debugedit, If we
tweak DEBUG_FLAGS, we could drop the use of debugedit in do_package:
--------
 DEBUG_FLAGS ?= &quot;-g -feliminate-unused-debug-types \
-                -fdebug-prefix-map=${B}=/usr/src/${BPN} \
-                -fdebug-prefix-map=${S}=/usr/src/${BPN} \
+                -fdebug-prefix-map=${WORKDIR}=/usr/src/debug \
                 -fdebug-prefix-map=${STAGING_DIR_NATIVE}= \
                 -fdebug-prefix-map=${STAGING_DIR_HOST}= \
 &quot;
--------

There is only one situation that it makes sense to keep debugedit:
While DEBUG_FLAGS is not used for compiling.(I think it should be
a bug)

So I think drop invoking debugedit is reasonable and proper.

//Hongxu</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60186</commentid>
    <comment_count>9</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 08:25:12 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; 3. Use relative path to compile, if we still use the same repalcement,
&gt;    the result was not expected. &apos;/folk/hjia&apos; still existed in DWARF
&gt; 
&gt; gcc -g ./dir1/dir2/dir3/test.c -o test_reltive
&gt; 
&gt; $DEBUGEDIT -b &quot;/folk/hjia/dir1/dir2&quot; -d &quot;/usr/src/debug&quot; -i -l
&gt; test_reltive.list test_reltive
&gt; 

s#-b &quot;/folk/hjia/dir1/dir2&quot;#-b &quot;/folk/hjia&quot;#</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60187</commentid>
    <comment_count>10</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 08:26:52 +0000</bug_when>
    <thetext>(In reply to comment #5)
&gt; 3. Use relative path to compile, if we still use the same repalcement,
&gt;    the result was not expected. &apos;/folk/hjia&apos; still existed in DWARF
&gt; 
&gt; gcc -g ./dir1/dir2/dir3/test.c -o test_reltive
&gt; 
&gt; $DEBUGEDIT -b &quot;/folk/hjia/dir1/dir2&quot; -d &quot;/usr/src/debug&quot; -i -l
&gt; test_reltive.list test_reltive

s#-d &quot;/usr/src/debug&quot;#-d &quot;/usr/src&quot;#</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60189</commentid>
    <comment_count>11</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 09:21:32 +0000</bug_when>
    <thetext>We still need to generate debugsources.list, so just invoke debugedit to
generate it and do not edit anything.

diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index ef80e50..31e701a 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -312,8 +312,6 @@ def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
     dvar = d.getVar(&apos;PKGD&apos;, True)
     objcopy = d.getVar(&quot;OBJCOPY&quot;, True)
     debugedit = d.expand(&quot;${STAGING_LIBDIR_NATIVE}/rpm/bin/debugedit&quot;)
-    workdir = d.getVar(&quot;WORKDIR&quot;, True)
-    workparentdir = d.getVar(&quot;DEBUGSRC_OVERRIDE_PATH&quot;, True) or os.path.dirname(os.path.dirname(workdir))
 
     # We ignore kernel modules, we don&apos;t generate debug info files.
     if file.find(&quot;/lib/modules/&quot;) != -1 and file.endswith(&quot;.ko&quot;):
@@ -327,7 +325,7 @@ def splitdebuginfo(file, debugfile, debugsrcdir, sourcefile, d):
 
     # We need to extract the debug src information here...
     if debugsrcdir:
-        cmd = &quot;&apos;%s&apos; -b &apos;%s&apos; -d &apos;%s&apos; -i -l &apos;%s&apos; &apos;%s&apos;&quot; % (debugedit, workparentdir, debugsrcdir, sourcefile, file)
+        cmd = &quot;&apos;%s&apos; -i -l &apos;%s&apos; &apos;%s&apos;&quot; % (debugedit, sourcefile, file)
         (retval, output) = oe.utils.getstatusoutput(cmd)
         if retval:
             bb.fatal(&quot;debugedit failed with exit code %s (cmd was %s)%s&quot; % (retval, cmd, &quot;:\n%s&quot; % output if output else &quot;&quot;))</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60190</commentid>
    <comment_count>12</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-21 09:37:12 +0000</bug_when>
    <thetext>The debugsources.list is used for copydebugsources, I am still investigating it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60210</commentid>
    <comment_count>13</comment_count>
    <who name="Mark Hatle">mark.hatle</who>
    <bug_when>2016-03-21 15:57:52 +0000</bug_when>
    <thetext>&gt; The debugsources.list is used for copydebugsources, I am still investigating it.

To replace debugedit we need to write a new program that will simply iterate the dwarf symbols and provide a list of all of the sources that were referenced.

We can then post-process this list to generate the equivalent of the debugsources.list file.

I&apos;d also like to see a QA test to identify things NOT using the &quot;-fdebug-prefix-map=&quot; option.  Should be obvious if the returned references to file are in the local workdir.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60271</commentid>
    <comment_count>14</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-22 09:09:47 +0000</bug_when>
    <thetext>Test case:

1. Modify recipe service in meta-skeleton,
   execute it caused segment fault

diff --git a/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c b/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
index 96c67ac..0862882 100644
--- a/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
+++ b/meta-skeleton/recipes-skeleton/service/service/skeleton_test.c
@@ -1,12 +1,10 @@
-#include &lt;unistd.h&gt;
-
-/* This demo does nothing except for testing /etc/init.d/skeleton */
+#include &lt;stdio.h&gt;
 
 int main(int argc, char *argv[])
 {
-       daemon(0, 0);
-       while (1) {
-               sleep(1);
-       }
+       printf(&quot;hello world\n&quot;);
+
+       char *p = NULL;
+       *p = 1;
        return 0;
 }

diff --git a/meta-skeleton/recipes-skeleton/service/service_0.1.bb b/meta-skeleton/recipes-skeleton/service/service_0.1.bb
index c5cd7a9..c4b43f0 100644
--- a/meta-skeleton/recipes-skeleton/service/service_0.1.bb
+++ b/meta-skeleton/recipes-skeleton/service/service_0.1.bb
@@ -3,29 +3,16 @@ SECTION = &quot;base&quot;
 LICENSE = &quot;GPLv2&quot;
 LIC_FILES_CHKSUM = &quot;file://${WORKDIR}/COPYRIGHT;md5=349c872e0066155e1818b786938876a4&quot;
 
-SRC_URI = &quot;file://skeleton \
-          file://skeleton_test.c \
+SRC_URI = &quot;file://skeleton_test.c \
           file://COPYRIGHT \
           &quot;
 
 do_compile () {
-       ${CC} ${WORKDIR}/skeleton_test.c -o ${WORKDIR}/skeleton-test
+       ${CC} ${WORKDIR}/skeleton_test.c ${DEBUG_FLAGS}  -o ${WORKDIR}/skeleton-test
 }
 
 do_install () {
-       install -d ${D}${sysconfdir}/init.d
-       cat ${WORKDIR}/skeleton | \
-         sed -e &apos;s,/etc,${sysconfdir},g&apos; \
-             -e &apos;s,/usr/sbin,${sbindir},g&apos; \
-             -e &apos;s,/var,${localstatedir},g&apos; \
-             -e &apos;s,/usr/bin,${bindir},g&apos; \
-             -e &apos;s,/usr,${prefix},g&apos; &gt; ${D}${sysconfdir}/init.d/skeleton
-       chmod a+x ${D}${sysconfdir}/init.d/skeleton
-
        install -d ${D}${sbindir}
        install -m 0755 ${WORKDIR}/skeleton-test ${D}${sbindir}/
 }
 
-RDEPENDS_${PN} = &quot;initscripts&quot;
-
-CONFFILES_${PN} += &quot;${sysconfdir}/init.d/skeleton&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60273</commentid>
    <comment_count>15</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-22 09:11:54 +0000</bug_when>
    <thetext>Test Case:

2. Install service, gdb and *-dbg to core-image-minimal

vim local.conf
...
IMAGE_INSTALL_append = &quot; service gdb&quot;
EXTRA_IMAGE_FEATURES_append = &quot; dbg-pkgs&quot;
...

vim conf/bblayers.conf
...
BBLAYERS ?= &quot; \ 
  /buildarea/raid0/hjia/poky/meta \
  /buildarea/raid0/hjia/poky/meta-poky \
  /buildarea/raid0/hjia/poky/meta-skeleton \
  /buildarea/raid0/hjia/poky/meta-yocto-bsp \
  &quot;
...

bitbake core-image-minimal</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>60274</commentid>
    <comment_count>16</comment_count>
    <who name="Hongxu Jia">hongxu.jia</who>
    <bug_when>2016-03-22 09:19:20 +0000</bug_when>
    <thetext>Test Case:

3. Run qemu and invoke gdb to execute skeleton-test,
   while segment fault, the source printed correctly.

runqemu qemux86-64 slirp nographic
...
root@qemux86-64:~# gdb skeleton-test

(gdb) r
Starting program: /usr/sbin/skeleton-test 
hello world

Program received signal SIGSEGV, Segmentation fault.
0x000000000040056b in main (argc=1, argv=0x7fffffffed08) at /usr/src/debug/skeleton_test.c:8
8		*p = 1;

(gdb) list
3	int main(int argc, char *argv[])
4	{
5		printf(&quot;hello world\n&quot;);
6	
7		char *p = NULL;
8		*p = 1;
9		return 0;
10	}

...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>61256</commentid>
    <comment_count>17</comment_count>
    <who name="Ross Burton">ross.burton</who>
    <bug_when>2016-04-14 20:05:29 +0000</bug_when>
    <thetext>Fixed in oe-core e50d23c30cd8259941b25e336b11cd96e4f6cd31.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>