Hi Sankar,<br> I found this article for debugging third party module sometime back. I have not used it still (I kind of look at the hexadeciamal gibberish still :) ).<br> But you can give it a try :<br><br><a href="http://www.linux.com/learn/linux-training/33991-the-kernel-newbie-corner-kernel-and-module-debugging-with-gdb">http://www.linux.com/learn/linux-training/33991-the-kernel-newbie-corner-kernel-and-module-debugging-with-gdb</a><br>
<br>Regards,<br>Neha<br><br><div class="gmail_quote">On Fri, Apr 19, 2013 at 12:25 PM, Sankar P <span dir="ltr"><<a href="mailto:sankar.curiosity@gmail.com" target="_blank">sankar.curiosity@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
I have written a kernel module which I build using:<br>
<br>
Makefile (edited a bit)<br>
==========<br>
obj-m := simple.o<br>
simple-objs := s.o<br>
<br>
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules<br>
<br>
=======<br>
<br>
Everything builds fine. But my kernel module caused an oops and the<br>
message was something like:<br>
<br>
myfunctionname +0x2507 +5679<br>
<br>
or some hexadecimal gibberish. I know that I can use some external<br>
tool to find out what these addresses mean. But, is there a way I can<br>
get the kernel oops message to print these information along with line<br>
number ?<br>
<br>
Is there a way to build the kernel module with debug symbols ? In user<br>
space, I usually do "-g" or "-ggdb" and it will give me line numbers<br>
and filenames neatly while dumping stacktrace. Is there a similar<br>
facility available for out of tree kernel modules too ?<br>
<br>
Even if I give :<br>
<br>
$ CFLAGS="-ggdb" make<br>
<br>
The output file size (.ko) is not changed.<br>
<br>
Can someone help me with building kernel modules with debug info and<br>
get the filename and line numbers printed in the oops messages /<br>
coredump ?<br>
<br>
Thanks.<br>
<br>
<br>
--<br>
Sankar P<br>
<a href="http://psankar.blogspot.com" target="_blank">http://psankar.blogspot.com</a><br>
<br>
_______________________________________________<br>
Kernelnewbies mailing list<br>
<a href="mailto:Kernelnewbies@kernelnewbies.org">Kernelnewbies@kernelnewbies.org</a><br>
<a href="http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies" target="_blank">http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies</a><br>
</blockquote></div><br>