Alan Tyson wrote:
Hi,
Could someone please explain why we cannot get source line numbers when
disassembling modules? Is the problem missing functionality in
store_load_module_symbols() or is there an inherent limitation with the
gdb linked in with crash in that it cannot accept additional debug_line
information for modules? I ask because gdb has this functionality for
user-space shared libraries and it seems to work OK. Or am I missing
something which is much more complex?
Thanks,
Alan Tyson,
Hewlett-Packard.
What architecture?
I'm presuming that you're running the "mod" command to load
the debuginfo data from the target module:
# crash
...
crash> dis -l ext3_count_dirs
0xe08aa000 <ext3_count_dirs>: push %edi
0xe08aa001 <ext3_count_dirs+1>: mov %eax,%edi
0xe08aa003 <ext3_count_dirs+3>: push %esi
0xe08aa004 <ext3_count_dirs+4>: xor %esi,%esi
0xe08aa006 <ext3_count_dirs+6>: push %ebx
0xe08aa007 <ext3_count_dirs+7>: xor %ebx,%ebx
0xe08aa009 <ext3_count_dirs+9>: jmp 0xe08aa021
0xe08aa00b <ext3_count_dirs+11>: xor %ecx,%ecx
0xe08aa00d <ext3_count_dirs+13>: mov %ebx,%edx
0xe08aa00f <ext3_count_dirs+15>: mov %edi,%eax
0xe08aa011 <ext3_count_dirs+17>: call 0xe08a809b
<ext3_get_group_desc>
0xe08aa016 <ext3_count_dirs+22>: test %eax,%eax
0xe08aa018 <ext3_count_dirs+24>: je 0xe08aa020
0xe08aa01a <ext3_count_dirs+26>: movzwl 0x10(%eax),%eax
0xe08aa01e <ext3_count_dirs+30>: add %eax,%esi
0xe08aa020 <ext3_count_dirs+32>: inc %ebx
0xe08aa021 <ext3_count_dirs+33>: mov 0x160(%edi),%eax
0xe08aa027 <ext3_count_dirs+39>: cmp 0x24(%eax),%ebx
0xe08aa02a <ext3_count_dirs+42>: jb 0xe08aa00b
0xe08aa02c <ext3_count_dirs+44>: mov %esi,%eax
0xe08aa02e <ext3_count_dirs+46>: pop %ebx
0xe08aa02f <ext3_count_dirs+47>: pop %esi
0xe08aa030 <ext3_count_dirs+48>: pop %edi
0xe08aa031 <ext3_count_dirs+49>: ret
crash> mod -s ext3
MODULE NAME SIZE OBJECT FILE
e08c4f80 ext3 123337
/lib/modules/2.6.18-53.el5/kernel/fs/ext3/ext3.ko
crash> dis -l ext3_count_dirs
/usr/src/debug/kernel-2.6.18/linux-2.6.18.i686/fs/ext3/ialloc.c: 746
0xe08aa000 <ext3_count_dirs>: push %edi
0xe08aa001 <ext3_count_dirs+1>: mov %eax,%edi
0xe08aa003 <ext3_count_dirs+3>: push %esi
0xe08aa004 <ext3_count_dirs+4>: xor %esi,%esi
0xe08aa006 <ext3_count_dirs+6>: push %ebx
0xe08aa007 <ext3_count_dirs+7>: xor %ebx,%ebx
0xe08aa009 <ext3_count_dirs+9>: jmp 0xe08aa021 <ext3_count_dirs+33>
/usr/src/debug/kernel-2.6.18/linux-2.6.18.i686/fs/ext3/ialloc.c: 751
0xe08aa00b <ext3_count_dirs+11>: xor %ecx,%ecx
0xe08aa00d <ext3_count_dirs+13>: mov %ebx,%edx
0xe08aa00f <ext3_count_dirs+15>: mov %edi,%eax
0xe08aa011 <ext3_count_dirs+17>: call 0xe08a809b
<ext3_get_group_desc>
/usr/src/debug/kernel-2.6.18/linux-2.6.18.i686/fs/ext3/ialloc.c: 752
0xe08aa016 <ext3_count_dirs+22>: test %eax,%eax
0xe08aa018 <ext3_count_dirs+24>: je 0xe08aa020
<ext3_count_dirs+32>
/usr/src/debug/kernel-2.6.18/linux-2.6.18.i686/fs/ext3/ialloc.c: 754
0xe08aa01a <ext3_count_dirs+26>: movzwl 0x10(%eax),%eax
0xe08aa01e <ext3_count_dirs+30>: add %eax,%esi
/usr/src/debug/kernel-2.6.18/linux-2.6.18.i686/fs/ext3/ialloc.c: 750
0xe08aa020 <ext3_count_dirs+32>: inc %ebx
0xe08aa021 <ext3_count_dirs+33>: mov 0x160(%edi),%eax
0xe08aa027 <ext3_count_dirs+39>: cmp 0x24(%eax),%ebx
0xe08aa02a <ext3_count_dirs+42>: jb 0xe08aa00b
<ext3_count_dirs+11>
/usr/src/debug/kernel-2.6.18/linux-2.6.18.i686/fs/ext3/ialloc.c: 757
0xe08aa02c <ext3_count_dirs+44>: mov %esi,%eax
0xe08aa02e <ext3_count_dirs+46>: pop %ebx
0xe08aa02f <ext3_count_dirs+47>: pop %esi
0xe08aa030 <ext3_count_dirs+48>: pop %edi
0xe08aa031 <ext3_count_dirs+49>: ret
crash>