Building kernel modules with debuginfo and printing line numbers in kernel oops message / coredump

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

I have written a kernel module which I build using:

Makefile (edited a bit)
==========
obj-m := simple.o
simple-objs := s.o

make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules

=======

Everything builds fine. But my kernel module caused an oops and the
message was something like:

myfunctionname +0x2507 +5679

or some hexadecimal gibberish. I know that I can use some external
tool to find out what these addresses mean. But, is there a way I can
get the kernel oops message to print these information along with line
number ?

Is there a way to build the kernel module with debug symbols ? In user
space, I usually do "-g" or "-ggdb" and it will give me line numbers
and filenames neatly while dumping stacktrace. Is there a similar
facility available for out of tree kernel modules too ?

Even if I give :

$ CFLAGS="-ggdb" make

The output file size (.ko) is not changed.

Can someone help me with building kernel modules with debug info and
get the filename and line numbers printed in the oops messages /
coredump ?

Thanks.


--
Sankar P
http://psankar.blogspot.com

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies




[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux