mirror of
				https://github.com/golang/go.git
				synced 2025-11-04 10:40:57 +00:00 
			
		
		
		
	doc/debugging_with_gdb: mention how to disable gc optimization
R=golang-dev, r CC=golang-dev https://golang.org/cl/6353055
This commit is contained in:
		
							parent
							
								
									7b6541a593
								
							
						
					
					
						commit
						d9c4cef670
					
				
					 1 changed files with 8 additions and 0 deletions
				
			
		| 
						 | 
				
			
			@ -23,6 +23,14 @@ Pass the <code>'-s'</code> flag to the linker to omit the debug information
 | 
			
		|||
(for example, <code>go build -ldflags "-s" prog.go</code>).
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<p>
 | 
			
		||||
The code generated by the <code>gc</code> compiler includes inlining of
 | 
			
		||||
function invocations and registerization of variables. These optimizations
 | 
			
		||||
can sometimes make debugging with <code>gdb</code> harder. To disable them
 | 
			
		||||
when debugging, pass the flags <code>-gcflags "-N -l"</code> to the
 | 
			
		||||
<a href="/cmd/go"><code>go</code></a> command used to build the code being
 | 
			
		||||
debugged.
 | 
			
		||||
</p>
 | 
			
		||||
 | 
			
		||||
<h3 id="Common_Operations">Common Operations</h3>
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue