Sysprogs forums › Forums › VisualKernel › Fail to Launch GDB Session
- This topic has 8 replies, 2 voices, and was last updated 10 years, 4 months ago by nickcheng.
-
AuthorPosts
-
June 13, 2014 at 10:35 #848nickchengParticipant
Hi there,
This is my first time to use virtualkernel with virtual studio 2013 to debug kernel.
The following is the my environment:
Virtual machine OS: CentOS6.5 x86_64
Virtual Studio: Microsoft Visual Studio Premium 2013
I follow the instruction on http://sysprogs.com/VisualKernel/tutorials/kgdb/, till step_13.
It pops out the error message as below:Your VisualKernel trial expires in 23 days!
C:Program Files (x86)SysprogsVisualKernelKernelToolsamd64x86_64-linux-gnu-gdb.exe –interpreter mi
-file-exec-and-symbols “c:\KernelCache\2.6.32-431.el6.x86_64_0.kernel\vmlinux”
=thread-group-added,id=”i1″
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-pc-mingw32 –target=x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
&”warning: Skipping deprecated .gdb_index section in c:\KernelCache\2.6.32-431.el6.x86_64_0.kernel\vmlinux.nDo “set use-deprecated-index-sections on” before the file is readnto use the section anyway.”
&”n”
OK
-list-features
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start- option”]
-gdb-set stop-on-solib-events 1
OK
-data-list-register-names
^done,register-names= [“rax”,”rbx”,”rcx”,”rdx”,”rsi”,”rdi”,”rbp”,”rsp”,”r8″,”r9″,”r10″,”r11″,”r12″,”r13″,”r14″,”r15″,”rip”,”eflags”,”cs”,”ss”,”ds”,”es”,”fs”,”gs”,”st0″,”st1″,”st2″,”st3″,”st4″,”st5″,”st6″,”st7″,”fctrl”,”fstat”,”ftag”,”fiseg”,”fioff”,”foseg”,”fooff”,”fop”,”xmm0″,”xmm1″,”xmm2″,”xmm3″,”xmm4″,”xmm5″,”xmm6″,”xmm7″,”xmm8″,”xmm9″,”xmm10″,”xmm11″,”xmm12″,”xmm13″,”xmm14″,”xmm15″,”mxcsr”,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,””,”orig_rax”,”al”,”bl”,”cl”,”dl”,”sil”,”dil”,”bpl”,”spl”,”r8l”,”r9l”,”r10l”,”r11l”,”r12l”,”r13l”,”r14l”,”r15l”,”ah”,”bh”,”ch”,”dh”,”ax”,”bx”,”cx”,”dx”,”si”,”di”,”bp”,””,”r8w”,”r9w”,”r10w”,”r11w”,”r12w”,”r13w”,”r14w”,”r15w”,”eax”,”ebx”,”ecx”,”edx”,”esi”,”edi”,”ebp”,”esp”,”r8d”,”r9d”,”r10d”,”r11d”,”r12d”,”r13d”,”r14d”,”r15d”]
-gdb-set disassembly-flavor intel
OK
-gdb-set print demangle off
OK
-gdb-version
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-pc-mingw32 –target=x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
OK
info target
&”info targetn”
Symbols from “c:KernelCache2.6.32-431.el6.x86_64_0.kernelvmlinux”.
Local exec file:
`c:KernelCache2.6.32-431.el6.x86_64_0.kernelvmlinux’, file type elf64-x86-64.
&”warning: Cannot find section for the entry point of c:\KernelCache\2.6.32-431.el6.x86_64_0.kernel\vmlinux.n”
Entry point: 0x1000000
0xffffffff81000000 – 0xffffffff81533565 is .text
0xffffffff81533568 – 0xffffffff815336e4 is .notes
0xffffffff815336f0 – 0xffffffff815379a0 is __ex_table
0xffffffff81600000 – 0xffffffff8182abd7 is .rodata
0xffffffff8182abd8 – 0xffffffff8183011c is __bug_table
0xffffffff81830120 – 0xffffffff81832a00 is .pci_fixup
0xffffffff81832a00 – 0xffffffff81840990 is __ksymtab
0xffffffff81840990 – 0xffffffff81848c00 is __ksymtab_gpl
0xffffffff81848c00 – 0xffffffff8184fbc8 is __kcrctab
0xffffffff8184fbc8 – 0xffffffff81853d00 is __kcrctab_gpl
0xffffffff81853d00 – 0xffffffff8186d26f is __ksymtab_strings
0xffffffff8186d280 – 0xffffffff818711d0 is __init_rodata
0xffffffff818711d0 – 0xffffffff81873000 is __param
0xffffffff81a00000 – 0xffffffff81c0cc50 is .data
0xffffffffff600000 – 0xffffffffff600106 is .vsyscall_0
0xffffffffff600140 – 0xffffffffff60017f is .vsyscall_fn
0xffffffffff600180 – 0xffffffffff6001e0 is .vsyscall_gtod_data
0xffffffffff600400 – 0xffffffffff60043d is .vsyscall_1
0xffffffffff600800 – 0xffffffffff600875 is .vsyscall_2
0xffffffffff600880 – 0xffffffffff600884 is .vgetcpu_mode
0xffffffffff6008c0 – 0xffffffffff6008c8 is .jiffies
0x0000000000000000 – 0x0000000000017298 is .data.percpu
0xffffffff81c26000 – 0xffffffff81c6ae04 is .init.text
0xffffffff81c6ae20 – 0xffffffff81d2a208 is .init.data
0xffffffff81d2a208 – 0xffffffff81d2a220 is .x86_cpu_dev.init
0xffffffff81d2a220 – 0xffffffff81d388ac is .parainstructions
0xffffffff81d388b0 – 0xffffffff81d4760c is .altinstructions
0xffffffff81d4760c – 0xffffffff81d4b023 is .altinstr_replacement
0xffffffff81d4b023 – 0xffffffff81d4cfa8 is .exit.text
0xffffffff81d4d000 – 0xffffffff81d57000 is .smp_locks
0xffffffff81d57000 – 0xffffffff81d58000 is .data_nosave
0xffffffff81d58000 – 0xffffffff8201faa4 is .bss
0xffffffff82020000 – 0xffffffff82040000 is .brk
OK
-break-insert -f /tmp/VisualKernel/e/VisualStudio2013_Projects/LinuxKernelModule1/LinuxKernelModule1_main.c:8
&”No source file named /tmp/VisualKernel/e/VisualStudio2013_Projects/LinuxKernelModule1/LinuxKernelModule1_main.c.n”
^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”“,pending=”/tmp/VisualKernel/e/VisualStudio2013_Projects/LinuxKernelModule1/LinuxKernelModule1_main.c:8″,times=”0″,original-location=”/tmp/VisualKernel/e/VisualStudio2013_Projects/LinuxKernelModule1/LinuxKernelModule1_main.c:8”}
-break-info 1
^done,BreakpointTable={nr_rows=”1″,nr_cols=”6″,hdr=[{width=”7″,alignment=”-1″,col_name=”number”,colhdr=”Num”},{width=”14″,alignment=”-1″,col_name=”type”,colhdr=”Type”},{width=”4″,alignment=”-1″,col_name=”disp”,colhdr=”Disp”},{width=”3″,alignment=”-1″,col_name=”enabled”,colhdr=”Enb”},{width=”10″,alignment=”-1″,col_name=”addr”,colhdr=”Address”},{width=”40″,alignment=”2″,col_name=”what”,colhdr=”What”}],body=[bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”“,pending=”/tmp/VisualKernel/e/VisualStudio2013_Projects/LinuxKernelModule1/LinuxKernelModule1_main.c:8″,times=”0″,original-location=”/tmp/VisualKernel/e/VisualStudio2013_Projects/LinuxKernelModule1/LinuxKernelModule1_main.c:8”}]}
-break-after 1 0
OK
-target-select remote :51506
Remote communication error. Target disconnected.: No error.I also attach the virtual machine’s vmx file.
Are there any suggestions?
All kind of comments are welcome.
Thank you,June 17, 2014 at 19:11 #3221supportKeymasterHi,
Could you please check your virtual COM port settings on the virtual machine? Does the COM port number there match the number in VisualKernel settings? Could you please attach the screenshots of both COM port settings dialog and the VisualKernel debug settings dialog?
BTW, if you are using VMWare, it is recommended to use VMWare GDB stub (http://sysprogs.com/VisualKernel/tutorials/vmware/) instead of a virtual COM port, as it’s much faster and more reliable.
June 21, 2014 at 03:20 #3228nickchengParticipantHi Bazis,
Do you check my last post? Are there any comments?
I attached two screenshots.
I hope those could help.
Thanks,June 27, 2014 at 19:47 #3227supportKeymasterHi,
Sorry, have not received your settings screenshot yet. BTW, we have released VisualKernel 1.1 that supports debugging kernel over network. Let us know if that works for you better.
July 2, 2014 at 03:55 #3222nickchengParticipantHi Bazis,
I took your advice and follow the instructions on http://sysprogs.com/VisualKernel/tutorials/vmware/ instead of a virtual COM port.
I still got the error message as below,Your VisualKernel trial expires in 4 days!
C:Program Files (x86)SysprogsVisualKernelKernelToolsamd64x86_64-linux-gnu-gdb.exe –interpreter mi
-file-exec-and-symbols “c:\KernelCache\2.6.32-431.el6.x86_64_0.kernel\vmlinux”
=thread-group-added,id=”i1″
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-pc-mingw32 –target=x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
&”warning: Skipping deprecated .gdb_index section in c:\KernelCache\2.6.32-431.el6.x86_64_0.kernel\vmlinux.nDo “set use-deprecated-index-sections on” before the file is readnto use the section anyway.”
&”n”
OK
-list-features
^done,features=[“frozen-varobjs”,”pending-breakpoints”,”thread-info”,”data-read-memory-bytes”,”breakpoint-notifications”,”ada-task-info”,”language-option”,”info-gdb-mi-command”,”undefined-command-error-code”,”exec-run-start-option”]
-gdb-set stop-on-solib-events 1
OK
-gdb-set disassembly-flavor intel
OK
-gdb-set print demangle off
OK
-gdb-version
GNU gdb (GDB) 7.7
Copyright (C) 2014 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type “show copying”
and “show warranty” for details.
This GDB was configured as “–host=i686-pc-mingw32 –target=x86_64-linux-gnu”.
Type “show configuration” for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type “help”.
Type “apropos word” to search for commands related to “word”.
OK
info target
&”info targetn”
Symbols from “c:KernelCache2.6.32-431.el6.x86_64_0.kernelvmlinux”.
Local exec file:
`c:KernelCache2.6.32-431.el6.x86_64_0.kernelvmlinux’, file type elf64-x86-64.
&”warning: Cannot find section for the entry point of c:\KernelCache\2.6.32-431.el6.x86_64_0.kernel\vmlinux.n”
Entry point: 0x1000000
0xffffffff81000000 – 0xffffffff81533565 is .text
0xffffffff81533568 – 0xffffffff815336e4 is .notes
0xffffffff815336f0 – 0xffffffff815379a0 is __ex_table
0xffffffff81600000 – 0xffffffff8182abd7 is .rodata
0xffffffff8182abd8 – 0xffffffff8183011c is __bug_table
0xffffffff81830120 – 0xffffffff81832a00 is .pci_fixup
0xffffffff81832a00 – 0xffffffff81840990 is __ksymtab
0xffffffff81840990 – 0xffffffff81848c00 is __ksymtab_gpl
0xffffffff81848c00 – 0xffffffff8184fbc8 is __kcrctab
0xffffffff8184fbc8 – 0xffffffff81853d00 is __kcrctab_gpl
0xffffffff81853d00 – 0xffffffff8186d26f is __ksymtab_strings
0xffffffff8186d280 – 0xffffffff818711d0 is __init_rodata
0xffffffff818711d0 – 0xffffffff81873000 is __param
0xffffffff81a00000 – 0xffffffff81c0cc50 is .data
0xffffffffff600000 – 0xffffffffff600106 is .vsyscall_0
0xffffffffff600140 – 0xffffffffff60017f is .vsyscall_fn
0xffffffffff600180 – 0xffffffffff6001e0 is .vsyscall_gtod_data
0xffffffffff600400 – 0xffffffffff60043d is .vsyscall_1
0xffffffffff600800 – 0xffffffffff600875 is .vsyscall_2
0xffffffffff600880 – 0xffffffffff600884 is .vgetcpu_mode
0xffffffffff6008c0 – 0xffffffffff6008c8 is .jiffies
0x0000000000000000 – 0x0000000000017298 is .data.percpu
0xffffffff81c26000 – 0xffffffff81c6ae04 is .init.text
0xffffffff81c6ae20 – 0xffffffff81d2a208 is .init.data
0xffffffff81d2a208 – 0xffffffff81d2a220 is .x86_cpu_dev.init
0xffffffff81d2a220 – 0xffffffff81d388ac is .parainstructions
0xffffffff81d388b0 – 0xffffffff81d4760c is .altinstructions
0xffffffff81d4760c – 0xffffffff81d4b023 is .altinstr_replacement
0xffffffff81d4b023 – 0xffffffff81d4cfa8 is .exit.text
0xffffffff81d4d000 – 0xffffffff81d57000 is .smp_locks
0xffffffff81d57000 – 0xffffffff81d58000 is .data_nosave
0xffffffff81d58000 – 0xffffffff8201faa4 is .bss
0xffffffff82020000 – 0xffffffff82040000 is .brk
OK
-break-insert -f /tmp/VisualKernel/e/VisualStudio2013_Projects/VMwareLinuxKernelModule/VMwareLinuxKernelModule_main.c:14
&”No source file named /tmp/VisualKernel/e/VisualStudio2013_Projects/VMwareLinuxKernelModule/VMwareLinuxKernelModule_main.c.n”
^done,bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”“,pending=”/tmp/VisualKernel/e/VisualStudio2013_Projects/VMwareLinuxKernelModule/VMwareLinuxKernelModule_main.c:14″,times=”0″,original-location=”/tmp/VisualKernel/e/VisualStudio2013_Projects/VMwareLinuxKernelModule/VMwareLinuxKernelModule_main.c:14”}
-break-info 1
^done,BreakpointTable={nr_rows=”1″,nr_cols=”6″,hdr=[{width=”7″,alignment=”-1″,col_name=”number”,colhdr=”Num”},{width=”14″,alignment=”-1″,col_name=”type”,colhdr=”Type”},{width=”4″,alignment=”-1″,col_name=”disp”,colhdr=”Disp”},{width=”3″,alignment=”-1″,col_name=”enabled”,colhdr=”Enb”},{width=”10″,alignment=”-1″,col_name=”addr”,colhdr=”Address”},{width=”40″,alignment=”2″,col_name=”what”,colhdr=”What”}],body=[bkpt={number=”1″,type=”breakpoint”,disp=”keep”,enabled=”y”,addr=”“,pending=”/tmp/VisualKernel/e/VisualStudio2013_Projects/VMwareLinuxKernelModule/VMwareLinuxKernelModule_main.c:14″,times=”0″,original-location=”/tmp/VisualKernel/e/VisualStudio2013_Projects/VMwareLinuxKernelModule/VMwareLinuxKernelModule_main.c:14”}]}
-break-after 1 0
OKI attach the zipped vmx file for the virtual machine and the setting of virtual machine.
July 2, 2014 at 04:03 #3223nickchengParticipantHi Bazis,
I attach the debug setting on virtualkernel project.
Please take a look.July 2, 2014 at 17:38 #3224supportKeymasterHi,
Your VMX file looks like it contains the “stub” setting, so VMWare should be listening on port 8864 or 8865. Are you able to connect to it manually via gdb (target remote localhost:8864)?
Your GDB log also does not contain the ‘target’ command, so it looks like something breaks before that. Are there any error messages you’re getting?July 3, 2014 at 01:10 #3225nickchengParticipantHi,
I found the response on the vm with “Entering KGDB” then stops.
I seems there is connection between my host OS Windows and guest OS CentOS.
I ever tried to make the connection speed down from 115200 to 38400.
But It made no progress.
I attach the screenshot.
Please check it out.July 3, 2014 at 19:08 #3226supportKeymasterHi,
Sorry, looks like there is a bit of confusion here. Essentially there are 2 totally independent debugging methods:
1. Using the VMWare stub. In this case VMware serves as a back-end for GDB and the Linux kernel does not even know it’s being debugged. This mode is preferred, as the debugging logic is 100% separated from the kernel and it does not involve a slow simulated COM port.
2. Using KGDB via a virtual COM port. In this case VMWare does not know anything about debugging, but the kernel itself runs a debug stub (KGDB) that communicates to GDB via a COM port.We would recommend setting up the first mode, hence please try checking if you can connect to port 8864 or 8865 on the machine where you run your VM (i.e. where vmware-vmx.exe is executing). Your vmware.log file in your VM directory should contain something like this:
2014-06-28T11:25:56.622-07:00| vmx| W110: Debug stub: VMware Workstation is listening for debug connection on port 8864. 2014-06-28T11:25:56.622-07:00| vmx| W110: Debug stub: target remote localhost:8864
Please let us know if that works.
Please note that the COM port settings (e.g. speed) are not relevant in this case, as the debugging mechanisms of the Linux kernel are not being used. -
AuthorPosts
- You must be logged in to reply to this topic.