2015-08-30 22:31:25 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								# Setting Up Symbol Server in Debugger
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Debug symbols allow you to have better debugging sessions. They have information
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								about the functions contained in executables and dynamic libraries and provide
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								you with information to get clean call stacks. A Symbol Server allows the
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								debugger to load the correct symbols, binaries and sources automatically without
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								forcing users to download large debugging files. The server functions like
							 | 
						
					
						
							
								
									
										
										
										
											2018-01-12 12:24:48 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								[Microsoft's symbol server](https://support.microsoft.com/kb/311503) so the
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								documentation there can be useful.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-04-16 11:31:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								Note that because released Electron builds are heavily optimized, debugging is
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								not always easy. The debugger will not be able to show you the content of all
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								variables and the execution path can seem strange because of inlining, tail
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								calls, and other compiler optimizations. The only workaround is to build an
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								unoptimized local build.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-04-16 11:31:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								The official symbol server URL for Electron is
							 | 
						
					
						
							
								
									
										
										
										
											2016-11-07 10:26:48 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								https://electron-symbols.githubapp.com.
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-30 22:31:25 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								You cannot visit this URL directly, you must add it to the symbol path of your
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								debugging tool. In the examples below, a local cache directory is used to avoid
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-30 22:31:25 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								repeatedly fetching the PDB from the server. Replace `c:\code\symbols` with an
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								appropriate cache directory on your machine.
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2015-08-30 22:31:25 -07:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								## Using the Symbol Server in Windbg
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								The Windbg symbol path is configured with a string value delimited with asterisk
							 | 
						
					
						
							
								
									
										
										
										
											2015-04-16 11:31:12 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								characters. To use only the Electron symbol server, add the following entry to
							 | 
						
					
						
							
								
									
										
										
										
											2016-03-31 14:17:50 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								your symbol path (**Note:** you can replace `c:\code\symbols` with any writable
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								directory on your computer, if you'd prefer a different location for downloaded
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								symbols):
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-20 14:18:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								```powershell
							 | 
						
					
						
							
								
									
										
										
										
											2016-11-07 10:26:48 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								SRV*c:\code\symbols\*https://electron-symbols.githubapp.com
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								```
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Set this string as `_NT_SYMBOL_PATH` in the environment, using the Windbg menus,
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								or by typing the `.sympath` command. If you would like to get symbols from
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Microsoft's symbol server as well, you should list that first:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-20 14:18:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								```powershell
							 | 
						
					
						
							
								
									
										
										
										
											2018-01-12 12:24:48 -03:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								SRV*c:\code\symbols\*https://msdl.microsoft.com/download/symbols;SRV*c:\code\symbols\*https://electron-symbols.githubapp.com
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								```
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Using the symbol server in Visual Studio
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-02-28 21:24:31 -08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								<img src='https://mdn.mozillademos.org/files/733/symbol-server-vc8express-menu.jpg'>
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								<img src='https://mdn.mozillademos.org/files/2497/2005_options.gif'>
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								## Troubleshooting: Symbols will not load
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								Type the following commands in Windbg to print why symbols are not loading:
							 | 
						
					
						
							| 
								
							 | 
							
								
							 | 
							
								
							 | 
							
							
								
							 | 
						
					
						
							
								
									
										
										
										
											2017-11-20 14:18:24 +08:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								```powershell
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								> !sym noisy
							 | 
						
					
						
							
								
									
										
										
										
											2016-07-07 10:17:49 +09:00
										 
									 
								 
							 | 
							
								
									
										
									
								
							 | 
							
								
							 | 
							
							
								> .reload /f electron.exe
							 | 
						
					
						
							
								
									
										
										
										
											2014-11-10 16:09:13 +08:00
										 
									 
								 
							 | 
							
								
							 | 
							
								
							 | 
							
							
								```
							 |