<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">On Monday 01 December 2014 03:26 PM,
Freeman Zhang wrote:<br>
</div>
<blockquote cite="mid:547C3B39.1050900@gmail.com" type="cite">
<pre wrap="">Hi list,
I've been trying to setup a debug environment for linux
kernel(v3.4,Android,ARM) with kgdb. It worked fine untill I tried to use
it to debug a module. Under the instruction from LDD, I add module debug
info in gdb with command:
        add-symbol-file test-module.ko address
LDD uses `cat /sys/module/test-module/sections/.text` to get the address
where the module has been loaded. However, I got:
        
        0x00000000</pre>
</blockquote>
Try reading the file as a root. <br>
$ sudo cat /sys/module/test-module/sections/.text<br>
<blockquote cite="mid:547C3B39.1050900@gmail.com" type="cite">
<pre wrap="">
When I use `lsmod`, I got:
        test-module 15278 0 - Live 0x00000000 (O)
Why nothing but 0x00000000 ??
So I have to do some research in kernel/module.c, and find out that
struct module -> module_core = 0xbf000000. But when I try these in gdb:
        add-symbol-file test-module.ko 0xbf000000
        break one_of_my_function
I got:
        Cannot access memory at address 0xbf002350
:(
Could somebody help?
All the best!
Freeman Zhang
        
        
</pre>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
Kernelnewbies mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a>
<a class="moz-txt-link-freetext" href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a>
</pre>
</blockquote>
<br>
<br />-------------------------------------------------------------------------------------------------------------------------------
<br />[ C-DAC is on Social-Media too. Kindly follow us at:
<br />Facebook: https://www.facebook.com/CDACINDIA & Twitter: @cdacindia ]
<br />
<br />This e-mail is for the sole use of the intended recipient(s) and may
<br />contain confidential and privileged information. If you are not the
<br />intended recipient, please contact the sender by reply e-mail and destroy
<br />all copies and the original message. Any unauthorized review, use,
<br />disclosure, dissemination, forwarding, printing or copying of this email
<br />is strictly prohibited and appropriate legal action will be taken.
<br />-------------------------------------------------------------------------------------------------------------------------------
</body>
</html>