On Wednesday 09 August 2006 20:53, Rick Spillane wrote:
> OK. So I figured out how to solve my problem. I will post my results
> and method below:
Can you put the below content on the UML Wiki for future users? You're likely 
the 3rd asking this question in these days.
It's at:
http://uml.harlowhill.com/

> The module was compiled using ARCH=um of course, so it has debugging
> information right in the .ko file.
>
> I put a break point at __link_module (kernel/module.c:1775).
>
> I boot UML, and tell it to load my module.
>
> gdb breaks at the designated location. This is where UML has just
> loaded the module, and its about to add it to its list of modules. The
> actual module data (text+data) are stored in the module's
> 'module_core' member, since I need the address, I do:
>
> print ((struct mod *)mod)->module_core
>
> Then I take this address, and the name of my module from where I
> started gdb (the current working directory), and use the
> 'add-symbol-file' command, as indicated in the old module debugging
> HOWTO.
>
> add-symbol-file project/db-4.4.20.NC/build_unix/kbdbmodule.ko 0x11646000
>
> gdb asks me if I want to add symbol table from the file, I say 'y' (yes).
>
> To test it out, I set a break point in the module:
>
> b kbdb.c:19
>
> gdb now recognizes the file, and sets the breakpoint without
> complaining, Now to see if it stops in the right place:
>
> c
>
> gdb hits the breakpoint, and prints out the correct line of code
> corresponding to the line of code that is actually on line 19 of the
> kbdb.c file, so I know its working now.
>
> Thank you Blaiserblade for pointing me to the right function
> (sys_init_module), and thanks to the guy who wrote the old UML HOWTO
> for 2.4 so that I knew to use add-symbol-file.

-- 
Inform me of my mistakes, so I can keep imitating Homer Simpson's "Doh!".
Paolo Giarrusso, aka Blaisorblade
http://www.user-mode-linux.org/~blaisorblade
Chiacchiera con i tuoi amici in tempo reale! 
 http://it.yahoo.com/mail_it/foot/*http://it.messenger.yahoo.com 


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
User-mode-linux-user mailing list
User-mode-linux-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-user

Reply via email to