From: "Matthias Urlichs" <smurf@smurf.noris.de>
To: george@mvista.com, linux-kernel@vger.kernel.org
Cc: akpm@osdl.org
Subject: [PATCH][2.6-mm] kgdb documentation fix
Date: Sun, 13 Feb 2005 02:07:58 +0100 [thread overview]
Message-ID: <20050213010758.GA15159@kiste> (raw)
[-- Attachment #1: Type: text/plain, Size: 5083 bytes --]
Hi,
Please apply.
---
Update Documentation/i386/kgdb/gdbinit-modules to conform
to the current kernel's module data structure.
Signed-Off-By: Matthias Urlichs <smurf@smurf.noris.de>
---
===== Documentation/i386/kgdb/gdbinit-modules 1.1 vs edited =====
--- 1.1/Documentation/i386/kgdb/gdbinit-modules 2005-02-12 12:44:54 +01:00
+++ edited/Documentation/i386/kgdb/gdbinit-modules 2005-02-12 20:12:45 +01:00
@@ -60,87 +60,90 @@
# $mod is set to NULL. This ensure to not add symbols for a wrong
# address.
#
+#
+# Sat Feb 12 20:05:47 CET 2005
+#
+# Adapted to the 2.6.* module data structure.
+# (Getting miffed at gdb for not having "offsetof" in the process :-/ )
+#
+# Autogenerate add-symbol-file statements from the module list instead
+# of relying on a no-longer-working loadmodule.sh program.
+#
+# Matthias Urlichs <smurf@debian.org>
+#
+#
# Have a nice hacking day !
#
#
define mod-list
- set $mod = (struct module*)module_list
- # the last module is the kernel, ignore it
- while $mod != &kernel_module
- printf "%p\t%s\n", (long)$mod, ($mod)->name
- set $mod = $mod->next
+ set $lmod = modules->next
+ # This is a circular data structure
+ while $lmod != &modules
+ set $mod = (struct module *)(((char *)$lmod) - ((int)&(((struct module *)0) -> list)))
+ printf "%p\t%s\n", $mod, $mod->name
+ set $lmod = $lmod->next
end
end
document mod-list
+mod-list
List all modules in the form: <module-address> <module-name>
Use the <module-address> as the argument for the other
mod-commands: mod-print-symbols, mod-add-symbols.
end
+define mod-list-syms
+ set $lmod = modules->next
+ # This is a circular data structure
+ while $lmod != &modules
+ set $mod = (struct module *)(((char *)$lmod) - ((int)&(((struct module *)0) -> list)))
+ printf "add-symbol-file %s.ko %p\n", $mod->name, $mod->module_core
+ set $lmod = $lmod->next
+ end
+end
+document mod-list-syms
+mod-list-syms
+List all modules in the form: add-symbol-file <module-path> <module-core>
+for adding modules' symbol tables without loadmodule.sh.
+end
+
define mod-validate
- set $mod = (struct module*)module_list
- while ($mod != $arg0) && ($mod != &kernel_module)
- set $mod = $mod->next
+ set $lmod = modules->next
+ set $mod = (struct module *)(((char *)$lmod) - ((int)&(((struct module *)0) -> list)))
+ while ($lmod != &modules) && ($mod != $arg0)
+ set $lmod = $lmod->next
+ set $mod = (struct module *)(((char *)$lmod) - ((int)&(((struct module *)0) -> list)))
end
- if $mod == &kernel_module
- set $mod = 0
- printf "%p is not a module\n", $arg0
+ if $lmod == &modules
+ set $mod = 0
+ printf "%p is not a module\n", $arg0
end
end
document mod-validate
mod-validate <module-address>
Internal user-command used to validate the module parameter.
-If <module> is a real loaded module, set $mod to it otherwise set $mod to 0.
+If <module> is a real loaded module, set $mod to it, otherwise set $mod
+to 0.
end
-
define mod-print-symbols
mod-validate $arg0
if $mod != 0
- set $i = 0
- while $i < $mod->nsyms
- set $sym = $mod->syms[$i]
- printf "%p\t%s\n", $sym->value, $sym->name
- set $i = $i + 1
- end
+ set $i = 0
+ while $i < $mod->num_syms
+ set $sym = $mod->syms[$i]
+ printf "%p\t%s\n", $sym->value, $sym->name
+ set $i = $i + 1
+ end
+ set $i = 0
+ while $i < $mod->num_gpl_syms
+ set $sym = $mod->gpl_syms[$i]
+ printf "%p\t%s\n", $sym->value, $sym->name
+ set $i = $i + 1
+ end
end
end
document mod-print-symbols
mod-print-symbols <module-address>
-Print all exported symbols of the module. see mod-list
-end
-
-
-define mod-add-symbols-align
- mod-validate $arg0
- if $mod != 0
- set $mod_base = ($mod->size_of_struct + (long)$mod)
- if ($arg2 != 0) && (($mod_base & ($arg2 - 1)) != 0)
- set $mod_base = ($mod_base | ($arg2 - 1)) + 1
- end
- add-symbol-file $arg1 $mod_base
- end
-end
-document mod-add-symbols-align
-mod-add-symbols-align <module-address> <object file path name> <align>
-Load the symbols table of the module from the object file where
-first section aligment is <align>.
-To retreive alignment, use `objdump -h <object file path name>'.
+Print all exported symbols of the module. See mod-list
end
-define mod-add-symbols
- mod-add-symbols-align $arg0 $arg1 sizeof(long)
-end
-document mod-add-symbols
-mod-add-symbols <module-address> <object file path name>
-Load the symbols table of the module from the object file.
-Default alignment is 4. See mod-add-symbols-align.
-end
-
-define mod-add-lis
- mod-add-symbols-align $arg0 /usr/src/LiS/streams.o 16
-end
-document mod-add-lis
-mod-add-lis <module-address>
-Does mod-add-symbols <module-address> /usr/src/LiS/streams.o
-end
--
Matthias Urlichs | {M:U} IT Design @ m-u-it.de | smurf@smurf.noris.de
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 189 bytes --]
reply other threads:[~2005-02-13 1:09 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20050213010758.GA15159@kiste \
--to=smurf@smurf.noris.de \
--cc=akpm@osdl.org \
--cc=george@mvista.com \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.