vendredi 27 février 2015

Enable debugging of kernel module from user-space process



I am working with openvswitch on ubuntu 14.04 server. I can easily attach gdb with any of its binary files for debugging its various features but when it comes to its kernel module, I am not able to debug it as per my requirement. I am using following steps to attach linux kernel with gdb: 1. gdb /tmp/vmlinux /proc/kcore 2. Adding a symbol File to GDB: cd /sys/module/openvswitch/sections/ ls -A1 .cat .text .data .bss 3. in gdb - add-symbol-file datapath/linux/openvswitch.ko 0xf87a2000 -s .data 0xf87b4000 -s .bss 0xf87b4560 4. b vxlan_udp_encap_recv


but when I generate packets for testing ovs kernel module and step over it says "The program is not being run."


Note: I have confirmed all module symbols by running this command: nm root/ovs/_build-gcc/datapath/linux/openvswitch.ko = which prints all symbols. and lsmod also confirms the existence of ovs kernel module.


I want to make ovs module stop at specified break point after it receives a message from its user-space application on netlink socket for its detailed debugging as conveniently as it allows me to debug a user-space process. Please suggest me how do I resolve this problem or if there is any alternative. I'll be really grateful for any help or suggestion. Thank you!




Aucun commentaire:

Enregistrer un commentaire