mirror of
				https://github.com/go-delve/delve.git
				synced 2025-11-01 03:42:59 +08:00 
			
		
		
		
	Move print goroutine info into command
* DebuggedProcess method: `PrintGoroutinesInfo` -> `GoroutinesInfo` * `goroutines` command in command/command.go now responsible for printing info.
This commit is contained in:
		| @ -158,7 +158,21 @@ func thread(p *proctl.DebuggedProcess, args ...string) error { | ||||
| } | ||||
|  | ||||
| func goroutines(p *proctl.DebuggedProcess, args ...string) error { | ||||
| 	return p.PrintGoroutinesInfo() | ||||
| 	var fname string | ||||
| 	gs, err := p.GoroutinesInfo() | ||||
| 	if err != nil { | ||||
| 		return err | ||||
| 	} | ||||
|  | ||||
| 	fmt.Printf("[%d goroutines]\n", len(gs)) | ||||
| 	for _, g := range gs { | ||||
| 		if g.Func != nil { | ||||
| 			fname = g.Func.Name | ||||
| 		} | ||||
| 		fmt.Printf("Goroutine %d - %s:%d %s\n", g.Id, g.File, g.Line, fname) | ||||
| 	} | ||||
|  | ||||
| 	return nil | ||||
| } | ||||
|  | ||||
| func cont(p *proctl.DebuggedProcess, args ...string) error { | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 Derek Parker
					Derek Parker