mirror of
				https://github.com/go-delve/delve.git
				synced 2025-10-31 18:57:18 +08:00 
			
		
		
		
	proc: fix hang caused by g.atomicstatus has change to atomic.Uint32 (#3129)
Co-authored-by: weixiecui <weixiecui@futunn.com>
This commit is contained in:
		| @ -27,7 +27,7 @@ type g struct { | |||||||
| 	waitsince int64 | 	waitsince int64 | ||||||
| 	waitreason waitReason (optional) | 	waitreason waitReason (optional) | ||||||
| 	stack stack | 	stack stack | ||||||
| 	atomicstatus uint32 | 	atomicstatus anytype | ||||||
| } | } | ||||||
|  |  | ||||||
| type gobuf struct { | type gobuf struct { | ||||||
|  | |||||||
| @ -918,7 +918,21 @@ func (v *Variable) parseG() (*G, error) { | |||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	status := loadInt64Maybe("atomicstatus") // +rtype uint32 | 	status := uint64(0) | ||||||
|  | 	if atomicStatus := v.loadFieldNamed("atomicstatus"); atomicStatus != nil { | ||||||
|  | 		if constant.Val(atomicStatus.Value) != nil { | ||||||
|  | 			status, _ = constant.Uint64Val(atomicStatus.Value) | ||||||
|  | 		} else { | ||||||
|  | 			vv := atomicStatus.fieldVariable("value") | ||||||
|  | 			if vv == nil { | ||||||
|  | 				unreadable = true | ||||||
|  | 			} else { | ||||||
|  | 				status, _ = constant.Uint64Val(vv.Value) | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
|  | 	} else { | ||||||
|  | 		unreadable = true | ||||||
|  | 	} | ||||||
|  |  | ||||||
| 	if unreadable { | 	if unreadable { | ||||||
| 		return nil, ErrUnreadableG | 		return nil, ErrUnreadableG | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user
	 cui
					cui