0

カスタム ビルドされたカーネルを共有する場合、デバッグ情報なしで提供するのが一般的です。

と同様にsudo apt-get install linux-image-$(uname -r)-dbgsym、カスタム ビルド カーネル用に個別のデバッグ情報ファイルを作成したいと考えています。

ここここで彼らは一般的に説明しました。Linux カーネル全体の個別のデバッグ情報ファイルを作成するための知識を共有したいと思います。

サンプルプログラムの場合

$ gcc -g calc.c

$ ls -l
 total 16
-rwxrwxr-x 1 jeyaram jeyaram 8424 Apr  8 09:44 a.out
-rw-rw-r-- 1 jeyaram jeyaram  246 Apr  8 09:32 calc.c

$ objcopy --only-keep-debug a.out a.debug
$ gcc calc.c -------------> compiling without debug info (skipped 'strip')
$ ls -l
total 20
-rwxrwxr-x 1 jeyaram jeyaram 4736 Apr  8 09:45 a.debug
-rwxrwxr-x 1 jeyaram jeyaram 7200 Apr  8 09:52 a.out
-rw-rw-r-- 1 jeyaram jeyaram  246 Apr  8 09:32 calc.c

$ objcopy --add-gnu-debuglink=a.debug a.out
$ gdb a.out
GNU gdb (Ubuntu/Linaro 7.4-2012.02-0ubuntu2) 7.4-2012.02
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-linux-gnu".
For bug reporting instructions, please see:
<http://bugs.launchpad.net/gdb-linaro/>...
Reading symbols from /home/jeyaram/JJJ/debug_info_analysis/sample_c_test/a.out...Reading symbols from /home/jeyaram/JJJ/debug_info_analysis/sample_c_test/a.debug...done.
done.

しかし、vmlinuxで試している間

$ objcopy --only-keep-debug vmlinux vmlinux.debug
objcopy: Unable to recognise the format of the input file `vmlinux'

何かが足りない???

4

2 に答える 2

1

arm-linux-gnueabi-objcopy --only-keep-debug vmlinux vmlinux.debug正常に動作します。

$ ls -l vmlinux*
-rwxrwxr-x 1 jeyaram jeyaram   7871108 Apr  8 11:24 vmlinux
-rwxrwxr-x 1 jeyaram jeyaram  92520922 Apr  8 11:21 vmlinux.debug
-rw-rw-r-- 1 jeyaram jeyaram 162974220 Apr  7 14:16 vmlinux.o
于 2014-04-08T05:56:40.073 に答える