linux-um archives
 help / color / mirror / Atom feed
From: Blaisorblade <blaisorblade@yahoo.it>
To: user-mode-linux-devel@lists.sourceforge.net, mikado4vn@gmail.com
Cc: user-mode-linux-user@lists.sourceforge.net
Subject: Re: [uml-devel] Resend: how to debug module on UML kernel 2.6.15.6 + SKAS mode?
Date: Fri, 24 Mar 2006 15:44:23 +0100	[thread overview]
Message-ID: <200603241544.23878.blaisorblade@yahoo.it> (raw)
In-Reply-To: <442366BA.3080902@gmail.com>

On Friday 24 March 2006 04:25, Mikado wrote:
> - How can I debug loadable modules at run time?
>
> Here is my way:
>
>   ( /tmp/mymodule.ko exists on both [Host] and [UML] )
>   + [Host] # gdb linux
>   + [Host] (gdb) ...
>   + [Host] (gdb) r <params>
>   + [UML] # insmod /tmp/mymodule.ko
>   + [UML] # cat /sys/module/mymodule/sections/{.text,.bss,.data}
>   + [Host] (gdb) add-symbol-file /tmp/mymodule.ko <.text_addr> -s .bss
> <.bss_addr> -s .data <.data_addr>
>   + ...
>
> Tell me if I was wrong, thanks!
>
> - How can I set breakpoint at module's init function?
>
> After add module's symbol, I set breakpoint at init function then
> 'rmmod' then re-'insmod' but gdb didn't break at init function. What was
> wrong?

gdb modifies the program code to set breakpoints, but the code is reloaded on 
module reload.

So, break on the caller of the module init function, and step from there. 
Maybe Bahi's mail refers to 2.4, I'm not sure, but the concepts are the same.

Most module-related code is in kernel/module.c, as for instance
static LIST_HEAD(modules);

which is the new name for module_list.

> - Sometimes gdb can't follow source codes in '.h' header files. Did I
> miss something?

What happens? Maybe gdb is stepping there but the calls are inlined and it's 
not apparent that it's looking at source code. However I've not clear what 
you describe, anyway.
-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade (Skype ID "PaoloGiarrusso", ICQ 215621894)
http://www.user-mode-linux.org/~blaisorblade

	
	
		
___________________________________ 
Yahoo! Messenger with Voice: chiama da PC a telefono a tariffe esclusive 
http://it.messenger.yahoo.com



-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642
_______________________________________________
User-mode-linux-devel mailing list
User-mode-linux-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel

  parent reply	other threads:[~2006-03-24 14:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-24  3:25 [uml-devel] Resend: how to debug module on UML kernel 2.6.15.6 + SKAS mode? Mikado
2006-03-24  4:37 ` D. Bahi
2006-03-24 14:44 ` Blaisorblade [this message]
2006-03-25 16:01   ` Mikado
2006-03-26 17:52     ` Blaisorblade

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=200603241544.23878.blaisorblade@yahoo.it \
    --to=blaisorblade@yahoo.it \
    --cc=mikado4vn@gmail.com \
    --cc=user-mode-linux-devel@lists.sourceforge.net \
    --cc=user-mode-linux-user@lists.sourceforge.net \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox