]> xenbits.xensource.com Git - people/julieng/freebsd.git/commitdiff
Add debug file extension to kldxref(8) after r288176
authoremaste <emaste@FreeBSD.org>
Fri, 2 Oct 2015 13:16:06 +0000 (13:16 +0000)
committeremaste <emaste@FreeBSD.org>
Fri, 2 Oct 2015 13:16:06 +0000 (13:16 +0000)
After r288176 kernel debug files have the extension .debug.  They also
moved to /usr/lib/debug/boot/kernel by default so in the normal case
kldxref does not encounter them.  A src.conf(5) setting may be used to
continue installing them in /boot/kernel though, so have kldxref skip
.debug files in addition to .symbols files.

Reported by: fabient
Sponsored by: The FreeBSD Foundation

usr.sbin/kldxref/kldxref.c

index c3784eff04eb2262104045d18715edeee41f4e86..1e8180149b6d694f11689a4e36266964dd43ce12 100644 (file)
@@ -360,9 +360,12 @@ main(int argc, char *argv[])
                        fwrite(&ival, sizeof(ival), 1, fxref);
                        reccnt = 0;
                }
-               /* skip non-files or .symbols entries */
+               /* skip non-files and separate debug files */
                if (p->fts_info != FTS_F)
                        continue;
+               if (p->fts_namelen >= 6 &&
+                   strcmp(p->fts_name + p->fts_namelen - 6, ".debug") == 0)
+                       continue;
                if (p->fts_namelen >= 8 &&
                    strcmp(p->fts_name + p->fts_namelen - 8, ".symbols") == 0)
                        continue;