1 |
On Thu, Oct 08, 2020 at 06:50:16PM -0400, John Covici wrote: |
2 |
> Since I compile most packages with split-debug and my default flags |
3 |
> contain -gdb, could I use the existing packages? |
4 |
|
5 |
LOL, I feel like I might have overcomplicated that. ;-) |
6 |
|
7 |
I'm not sure if it will keep as many symbols as `-ggdb3`, but you probably don't |
8 |
need that many anyway. Remember to enable the `splitdebug` and `installsources` |
9 |
FEATURES on both packages. Following the Gentoo guide [1]: |
10 |
|
11 |
/etc/portage/ $ cat env/debugsyms env/installsources |
12 |
CFLAGS="${CFLAGS} -ggdb" |
13 |
CXXFLAGS="${CXXFLAGS} -ggdb" |
14 |
FEATURES="${FEATURES} splitdebug compressdebug nostrip" |
15 |
FEATURES="${FEATURES} installsources" |
16 |
|
17 |
/etc/portage/ $ cat package.env/sys-apps/kpci |
18 |
sys-apps/kmod debugsyms installsources |
19 |
sys-apps/pciutils debugsyms installsources |
20 |
|
21 |
$ emerge -atv1 kmod pciutils |
22 |
|
23 |
I'm not sure what you mean by "my default flags contain -gdb". Are these your |
24 |
CFLAGS (in which case I think you mean `-ggdb`), or is it some USE-flag or |
25 |
FEATURE of which I'm unaware? |
26 |
|
27 |
Anyway, then you should be able to break at the same function as before, using |
28 |
the globally installed version of `lspci`: |
29 |
|
30 |
$ gdb lspci |
31 |
Reading symbols from lspci... |
32 |
(gdb) b index_mm_open |
33 |
Function "index_mm_open" not defined. |
34 |
Make breakpoint pending on future shared library load? (y or [n]) y |
35 |
Breakpoint 1 (index_mm_open) pending. |
36 |
(gdb) run -k |
37 |
Starting program: /usr/sbin/lspci -k |
38 |
|
39 |
[...] |
40 |
|
41 |
Breakpoint 1, index_mm_open (ctx=ctx@entry=0x555555570b30, |
42 |
filename=filename@entry=0x7fffffffc9a0 |
43 |
"/lib/modules/5.4.60-gentoo/modules.dep.bin", |
44 |
stamp=stamp@entry=0x555555570b90) at |
45 |
/usr/src/debug/sys-apps/kmod-27-r2/kmod-27/libkmod/libkmod-index.c |
46 |
:744 |
47 |
|
48 |
Cheers for pointing this out. I'm still not completely accustomed to using Linux |
49 |
with a _good_ package manager. ;-) |
50 |
|
51 |
[1] https://wiki.gentoo.org/wiki/Debugging#Install_debugging_information |
52 |
|
53 |
-- |
54 |
|
55 |
Ashley Dixon |
56 |
suugaku.co.uk |
57 |
|
58 |
2A9A 4117 |
59 |
DA96 D18A |
60 |
8A7B B0D2 |
61 |
A30E BF25 |
62 |
F290 A8AA |