Hi,
We would like to include the following in lcrash:
Andreas Herrmann added a new command "symtab" to add Symbol tables from
modules
which can be created e.g with the "nm" command. In addition to this the
ksyms
(what you can see in /proc/ksyms) are now used as additional symbol
information.
Another new command is the "module" command which lists all loaded Kernel
Modules
and the addresses where they are loaded to.
Example:
========
module_test.c
#include <linux/module.h>
#include <linux/kernel.h>
int test_glob_1 = 4711;
int test_glob_2 = 0815;
int init_module(void)
{
printk("test_mod_init\n");
return 0;
}
void cleanup_module(void)
{
printk("test_mod_cleanup\n");
}
> nm module_test.o > module_test.map
> lcrash ...
>> symtab -a module_test.map module_test
Adding symbol table.
filename: module_test.map
text_offset: 0x881b060
data_offset: 0x881b0e8
rodata_offset: 0x881b0c4
bss_offset: 0
text_length: 100
data_length: 8
rodata_length: 34
bss_length: 0
size: 496
..Done.
>> module
ADDR SIZE USED NAME REFS
===========================================================================
0x881b000 496 0 module_test []
0x880d000 49472 1 ctc []
0x8800000 46960 0 md []
0x1a5400 0 1 kernel_module []
===========================================================================
>> findsym test_glob_1
ADDR OFFSET TYPE NAME
============================================================
0x881b0e8 0 GLOBAL_DATA test_glob_1
============================================================
1 symbol found
>> print *(int*)0x881b0e8
4711
>
Here is a short description of the new features:
======
Symtab:
======
COMMAND: symtab
[-l [-f] [symtable]]
[-r symtable]
[-a symtable modulename]
[-a symtable offset size]
[-a symtable t_off d_off rd_off b_off t_len d_len rd_len b_len]
[-w outfile]
Add/remove/list symbol table information.
OPTIONS:
-l [symtable]
List information of (all) symbol table(s).
-l -f [symtable]
Show full list of symbols of (all) symbol table(s).
-a symtable modulename
Add new symbol table belonging to module modulename.
-a symtable t_off d_off rd_off b_off t_len d_len rd_len b_len
Add new symbol table using given segment offsets and lengths
(off=offset, len=length, t=text, d=data, rd=rodata, b=bss).
-a symtable offset size
Add new symbol table using given offset and size.
Regard size as size of object file corresponding to symtable.
-r symtable
Remove symbol table.
-a [ksymtab]
-r [ksymtab]
-l [-f] [ksymtab]
Add, remove or list table of exported kernel symbols.
You can use only one of the above command lines at the syme time.
======
Module:
======
COMMAND: module
[modulename]
[-f [modulename]]
[-w outfile]
Display list of loaded modules and module symbols.
OPTIONS:
[modulename]
Display information of (all) module structure(s) in linked list
module_list of the kernel.
Shows address of module structure, and size, usecount, name of
module, and modules that depend on the module.
Equals "cat /proc/modules" in a running Linux system.
[-f [modulename]]
Show list of exported module symbols of (all) module
structure(s)
in linked list module_list of the kernel.
Equals "cat /proc/ksyms" in a running Linux system.
The kernel_module can be accessed by using "kernel_module" as
modulename.
Regards
Michael
------------------------------------------------------------------------
Linux/390 Development
Phone: +49-7031-16-2360, Bld 71032-06-109
Email: holzheu@xxxxxxxxxx
Jyunji Kondo <j-kondo@xxxxxxxxxxxxxxx> on 07/17/2001 05:52:45 AM
Please respond to j-kondo@xxxxxxxxxxxxxxx
To: lkcd@xxxxxxxxxxx
cc:
Subject: Re: Module support
> Jyunji, Andreas Herrmann has been doing some work on a feature like this
> one for lcrash. I'm not sure how complete Andreas's work is at this
> time. I know there was also some legal issues involved in releasing that
> work to the group.
That's sounds nice.
> Andreas, any status ?
Please let me know any pointers about this work?
Thanks.
|