<div dir="ltr"><div>Hi Saket,<br><br>Thank you so much for the clear instructions. I really wanted to get qemu to work on my 64bit system so I kept trying and finally I got things to work.<br><br>After following your instructions I could get further but gdb complained about a &quot;Remote &#39;g&#39; packet reply is too long&quot;.Your way works fine but I needed to debug a kernel module so what finally worked for me is this.<br><br>I am enclosing the steps it may help others some day:<br><br>After Googling into the late hours of the morning I saw someone else had similar issues and he resolved this way:<br><a href="http://lists.gnu.org/archive/html/qemu-discuss/2014-10/msg00069.html">http://lists.gnu.org/archive/html/qemu-discuss/2014-10/msg00069.html</a><br><br></div>I am using GNU gdb (GDB) 7.9 the file is remote.c and I commented out lines:<br><div><br> /* Further sanity checks, with knowledge of the architecture.  */<br>6157  //if (buf_len &gt; 2 * rsa-&gt;sizeof_g_packet)<br>6158  //  error (_(&quot;Remote &#39;g&#39; packet reply is too long: %s&quot;), rs-&gt;buf);<br><br></div><div>make then make install gdm, then proceed as usual but you need to specify the -initrd else cannot debug kernel modules. You can still step into the kernel no issues there but modules nope.<br><br>qemu-system-x86_64 -s -S -kernel arch/x86/boot/bzImage -initrd /boot/initrd.img-4.1.2-vtaqemu+ /dev/zero<br>xvnc4viewer :5900 ( Your port # may differ.. )<br><br>gdb vmlinux<br>target remote localhost:1234<br><br>(gdb) add-symbol-file /home/aruna/kmod/misc.ko 0xffffffffa057e000 -s .data 0xffffffffa0580000 -s .bss 0xffffffffa05802c8<br><br>----------gdb output---------------------------------------------------------------------------------<br>add symbol table from file &quot;/home/aruna/kmod/misc.ko&quot; at<br>    .text_addr = 0xffffffffa057e000<br>    .data_addr = 0xffffffffa0580000<br>    .bss_addr = 0xffffffffa05802c8<br>(y or n) y<br>Reading symbols from /home/aruna/kmod/misc.ko...done.<br><br>(gdb) b hello_write<br><br></div><div>...and it triggers when I echo &quot;testing123&quot; &gt; /dev/aruna<br><br></div><div>Breakpoint 2 at 0xffffffffa057e050: file /home/aruna/kmod/misc.c, line 29.<br>----end--gdb output---------------------------------------------------------------------------------<br><br></div><div>Thank you very much for your help I am extremely grateful, without your guidance I would have not figured things out :)<br><br></div><div>Aruna<br></div><div><br><br></div></div>