1 // Purpose: 2 // Test that address values in a \DexExpectWatchValue are printed with 3 // their address name along with the address' resolved value (if any), and 4 // that when verbose output is enabled the complete map of resolved 5 // addresses and list of unresolved addresses will also be printed. 6 // 7 // Note: Currently "misordered result" is the only penalty that does not 8 // display the address properly; if it is implemented, this test should be 9 // updated. 10 // 11 // The dbgeng driver doesn't support \DexLimitSteps yet. 12 // UNSUPPORTED: system-windows 13 // 14 // RUN: not %dexter_regression_test -v -- %s | FileCheck %s 15 16 // CHECK: Resolved Addresses: 17 // CHECK-NEXT: 'x_2': 0x[[X2_VAL:[0-9a-f]+]] 18 // CHECK-NEXT: 'y': 0x[[Y_VAL:[0-9a-f]+]] 19 // CHECK: Unresolved Addresses: 20 // CHECK-NEXT: ['x_1'] 21 22 // CHECK-LABEL: [x] ExpectValue 23 // CHECK: expected encountered watches: 24 // CHECK-NEXT: address 'x_2' (0x[[X2_VAL]]) 25 // CHECK: missing values: 26 // CHECK-NEXT: address 'x_1' 27 28 // CHECK-LABEL: [z] ExpectValue 29 // CHECK: expected encountered watches: 30 // CHECK-NEXT: address 'x_2' (0x[[X2_VAL]]) 31 // CHECK-NEXT: address 'y' (0x[[Y_VAL]]) 32 // CHECK: misordered result: 33 // CHECK-NEXT: (0x[[Y_VAL]]): step 4 34 // CHECK-NEXT: (0x[[X2_VAL]]): step 5 35 36 int main() { 37 int *x = new int(5); 38 int *y = new int(4); 39 if (false) { 40 (void)0; // DexLabel('unreachable') 41 } 42 int *z = y; 43 z = x; // DexLabel('start_line') 44 delete y; 45 delete x; // DexLabel('end_line') 46 } 47 48 // DexDeclareAddress('x_1', 'x', on_line=ref('unreachable')) 49 // DexDeclareAddress('x_2', 'x', on_line=ref('end_line')) 50 // DexDeclareAddress('y', 'y', on_line=ref('start_line')) 51 // DexExpectWatchValue('x', address('x_1'), address('x_2'), from_line=ref('start_line'), to_line=ref('end_line')) 52 // DexExpectWatchValue('z', address('x_2'), address('y'), from_line=ref('start_line'), to_line=ref('end_line')) 53