mirror of
				https://github.com/go-delve/delve.git
				synced 2025-11-01 03:42:59 +08:00 
			
		
		
		
	proc/variables: Split address calculations from value extraction
Refactored variables.go to separate calculation of a variable's address from reading its value. This change is useful to implement the 'set' command as well as the evaluation of more complex expressions (in the future).
This commit is contained in:
		| @ -58,8 +58,8 @@ func TestVariableEvaluation(t *testing.T) { | ||||
| 		{"baz", "bazburzum", "struct string", nil}, | ||||
| 		{"neg", "-1", "int", nil}, | ||||
| 		{"f32", "1.2", "float32", nil}, | ||||
| 		{"c64", "(1, 2i)", "complex64", nil}, | ||||
| 		{"c128", "(2, 3i)", "complex128", nil}, | ||||
| 		{"c64", "(1 + 2i)", "complex64", nil}, | ||||
| 		{"c128", "(2 + 3i)", "complex128", nil}, | ||||
| 		{"a6.Baz", "8", "int", nil}, | ||||
| 		{"a7.Baz", "5", "int", nil}, | ||||
| 		{"a8.Baz", "feh", "struct string", nil}, | ||||
| @ -181,8 +181,8 @@ func TestLocalVariables(t *testing.T) { | ||||
| 				{"b1", "true", "bool", nil}, | ||||
| 				{"b2", "false", "bool", nil}, | ||||
| 				{"ba", "[]int len: 200, cap: 200, [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,...+136 more]", "struct []int", nil}, | ||||
| 				{"c128", "(2, 3i)", "complex128", nil}, | ||||
| 				{"c64", "(1, 2i)", "complex64", nil}, | ||||
| 				{"c128", "(2 + 3i)", "complex128", nil}, | ||||
| 				{"c64", "(1 + 2i)", "complex64", nil}, | ||||
| 				{"f", "main.barfoo", "func()", nil}, | ||||
| 				{"f32", "1.2", "float32", nil}, | ||||
| 				{"i32", "[2]int32 [1,2]", "[2]int32", nil}, | ||||
|  | ||||
		Reference in New Issue
	
	Block a user
	 aarzilli
					aarzilli