mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	proc: use original PC for Call position (#736)
The PC we have is relative to the first instruction after the CALL instruction currently being executed. Anyone watching a disassembly will understand what's happening if we report the return PC, but reporting the first PC of the current line is useless and confusing.
This commit is contained in:
		 Alessandro Arzilli
					Alessandro Arzilli
				
			
				
					committed by
					
						 Derek Parker
						Derek Parker
					
				
			
			
				
	
			
			
			 Derek Parker
						Derek Parker
					
				
			
						parent
						
							cd2a875459
						
					
				
				
					commit
					dd3cc63d8f
				
			| @ -230,7 +230,7 @@ func (dbp *Process) frameInfo(pc, sp uint64, top bool) (Stackframe, error) { | |||||||
| 	r := Stackframe{Current: Location{PC: pc, File: f, Line: l, Fn: fn}, CFA: cfa, FDE: fde, Ret: binary.LittleEndian.Uint64(data), addrret: uint64(retaddr)} | 	r := Stackframe{Current: Location{PC: pc, File: f, Line: l, Fn: fn}, CFA: cfa, FDE: fde, Ret: binary.LittleEndian.Uint64(data), addrret: uint64(retaddr)} | ||||||
| 	if !top { | 	if !top { | ||||||
| 		r.Call.File, r.Call.Line, r.Call.Fn = dbp.PCToLine(pc - 1) | 		r.Call.File, r.Call.Line, r.Call.Fn = dbp.PCToLine(pc - 1) | ||||||
| 		r.Call.PC, _, _ = dbp.goSymTable.LineToPC(r.Call.File, r.Call.Line) | 		r.Call.PC = r.Current.PC | ||||||
| 	} else { | 	} else { | ||||||
| 		r.Call = r.Current | 		r.Call = r.Current | ||||||
| 	} | 	} | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user