This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
Other format: | [Raw text] |
Hello, When we debug a loadable module of Linux kernel, we use the command, add-symbol-file to read its symbols. We have to specify its loaded address like (gdb) add-symbol-file drivers/net/e1000e/e1000e.ko 0xfffffffffa008000 The address is appeared in /proc/modules. Someone said several months ago that the address is taken by python script. But I don't know how. Therefore, I did by my way. When we develop kernel module, we are interested in several module at most which we are developing. We don't care the symbols of nfs for example. Therefore, extending add-symbol-file may be a best way. So the syntax of add-symbol-file is Usage: add-symbol-file FILE [ADDR [-s <SECT> <SECT_ADDR> -s <SECT> <SECT_ADDR> ...] ] I.e. ADDR becomes optional. In add_symbol_file(), it checks to see there is only one parameter, FILE. Then searching the module in the linked list of kernel modules and getting loaded address. Construct new string which has FILE and ADDR and pass to original add_symbol_file(). It assumes the modification of http://sourceware.org/ml/gdb-patches/2009-08/msg00115.html Thank you. -Caz Yokoyama, caz at caztech dot com. 503-804-1028(m).
Attachment:
LinuxModuleSymbolLoad.patch
Description: Binary data
Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
---|---|---|
Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |