"windbg+vmware+win7 dual-machine debugging" setting in win10

Original address: https://blog.csdn.net/Sagittarius_Warrior/article/details/51305046

Not original, only for collection

This article mainly introduces how to set up windbg+vmware under win10 for dual-machine debugging. This article mainly refers to: Sir Li's blog , and browsed a lot of web articles, as well as the help documents and MSDN that come with windbg. In addition to synthesizing the experience of various companies, I also shared the problems and solutions I encountered in practice.

1. Installation environment

1. Host OS: win10 X64

2. Windbg: 10.0.10586.567 ADM64 (I installed wdk10+VS2015)

3,VMWare:11.0.0

4,Guest OS:win7 X64

 

2. Virtual machine configuration

1. Open the corresponding virtual machine, select "Edit virtual machine settings", and open the virtual machine settings dialog box, as follows

 

2. Observe the "Hardware" -> "Device Bar" of the "Virtual Machine Settings" dialog box to see if there is a "Printer" or "Printer", if so, delete the device.

3. Select "Add", then select "Serial Port", then select "Use Named Pipes", and set as follows

Note:

1) Use a named pipe, the name can be defaulted.

2) Select the application on the other end, that is, link windbg.

3) IO mode, optional or not.

4) After completion, you need to confirm that the newly added device is "com1" (if it is a Chinese interface, it will display "serial port"). For comparison, when not com1, "serial port 2" is displayed.

If the COM port number is wrong in this place, and after opening windbg, "debuggee not connected" will be displayed. Attached online solution to this problem:

"- -I also encountered this problem and just solved it.
You can check whether your serial port is called Serial port 2 in Edit virtual machine settings. If it is, the problem is here, it is the extra 2. You put this serial port Delete it, then delete the printer, and then add a serial port again, this time the serial port is called Serial port."

 

Three, Windbg settings

1. Add a shortcut to windbg on the desktop;

2. Right-click the shortcut, open the "Properties" dialog box, and add "-b -k com:pipe,port=\\.\pipe\com_1,resets=0" at the end of the target column.

Note: Li sir's blog is set like this, but when I open windbg in this way (right click and "open as administrator"), it has always been "Debuggee not connected". Accidentally tried the following settings, which solved the problem:

3. In the "Shortcut" tab, select "Advanced" and check "Run as administrator".

 

Fourth, GeustOS settings (this part is completely the same as "Li sir's blog")

1. Open "cmd" as an administrator.

2. Enter "bcdedit"

3. Set port 1, the command is as follows:

 

[cpp]  view plain copy  
 
  1. bcdedit /dbgsettings serial baudrate:115200 debugport:1  

"1" here corresponds to com port 1.

4. Copy a boot option and name it "DebugEntry", which can be named arbitrarily. The command is as follows:

 

[cpp]  view plain copy  
 
  1. bcdedit /copy {current} /d DebugEntry  

 

5. Add a boot boot item

 

[cpp]  view plain copy  
 
  1. bcdedit /displayorder {current} {ID}  

Note: This ID needs to be filled with a string of numbers or letters generated by the previous command.

 

6. Activate debug

 

[cpp]  view plain copy  
 
  1. bcdedit /debug {ID} ON  


Note: The ID is replaced by a generated string of numbers or letters.

 

7. Restart the virtual machine and select "DebugEntry[debug]" as the startup item.

 

8. After selecting the startup item, immediately return to the host and start windbg. It can only be connected during the startup process of GuestOS.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324738961&siteId=291194637