|
| 1 | +<?xml version="1.0" encoding="utf-8"?> |
| 2 | +<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010"> |
| 3 | + <!-- GENERIC and GIMPLE tree node. --> |
| 4 | + <Type Name="tree"> |
| 5 | + <AlternativeType Name="const_tree"/> |
| 6 | + |
| 7 | + <!-- This could be used to simplify the expressions bellow but it does not work with |
| 8 | + VSCode GDB integration. Kept here for reference --> |
| 9 | + <Intrinsic Name="TREE_CODE" Expression="base.code" /> |
| 10 | + <Intrinsic Name="TREE_CHAIN" Expression="common.chain" /> |
| 11 | + <Intrinsic Name="TREE_TYPE" Expression="typed.type" /> |
| 12 | + <Intrinsic Name="TREE_PURPOSE" Expression="list.purpose" /> |
| 13 | + <Intrinsic Name="TREE_VALUE" Expression="list.value" /> |
| 14 | + <Intrinsic Name="TREE_OPERAND_LENGTH" Expression="tree_code_length[base.code]" /> |
| 15 | + <Intrinsic Name="TREE_OPERAND" Expression="exp.operands[$i]" /> |
| 16 | + <Intrinsic Name="TREE_CODE_CLASS" Expression="tree_code_type[base.code]" /> |
| 17 | + <Intrinsic Name="TREE_CODE_CLASS_STRING" Expression="tree_code_class_strings[tree_code_type[base.code]]" /> |
| 18 | + <Intrinsic Name="TREE_CODE_NAME" Expression="tree_code_name[base.code]" /> |
| 19 | + <Intrinsic Name="DECL_NAME" Expression="decl_minimal.name" /> |
| 20 | + <Intrinsic Name="DECL_ARGUMENTS" Expression="function_decl.arguments" /> |
| 21 | + <Intrinsic Name="DECL_RESULT" Expression="decl_non_common.result" /> |
| 22 | + <Intrinsic Name="TYPE_NAME" Expression="type_common.name" /> |
| 23 | + <Intrinsic Name="TYPE_ARG_TYPES" Expression="type_non_common.values" /> |
| 24 | + <Intrinsic Name="TYPE_ATTRIBUTES" Expression="type_common.attributes" /> |
| 25 | + <Intrinsic Name="TYPE_NO_NAMED_ARGS_STDARG_P" Expression="type_common.no_named_args_stdarg_p" /> |
| 26 | + <Intrinsic Name="IDENTIFIER_POINTER" Expression="identifier.id.str" /> |
| 27 | + <Intrinsic Name="SSA_VERSION" Expression="base.u.version" /> |
| 28 | + |
| 29 | + <!-- Short displays. --> |
| 30 | + <DisplayString Condition="&base.code == 0">{(void*)&base.code}</DisplayString> |
| 31 | + <DisplayString Condition="base.code == INTEGER_CST">{{ code={base.code} type_size={typed.type.type_common.size.int_cst.val[0]} value_0={int_cst.val[0]} }}</DisplayString> |
| 32 | + <DisplayString Condition="tree_code_type[base.code] == tcc_type">{{ code={base.code} type_size={type_common.size.int_cst.val[0]} identifier={type_common.name.decl_minimal.name.identifier.id.str} }}</DisplayString> |
| 33 | + <DisplayString>{{ code={base.code} }}</DisplayString> |
| 34 | + |
| 35 | + <!-- Detailed displays. --> |
| 36 | + <Expand> |
| 37 | + <!-- Common fields for all nodes. --> |
| 38 | + <Item Name="[code]">base.code</Item> |
| 39 | + <Item Name="[code_class]">tree_code_type[base.code]</Item> |
| 40 | + <Item Name="[code_string]">tree_code_class_strings[tree_code_type[base.code]]</Item> |
| 41 | + <Item Name="[code_name]">tree_code_name[base.code]</Item> |
| 42 | + |
| 43 | + <!-- Tree container. --> |
| 44 | + <Item Name="[purpose]" Condition="base.code == TREE_LIST">list.purpose</Item> |
| 45 | + <Item Name="[value]" Condition="base.code == TREE_LIST">list.value</Item> |
| 46 | + <Item Name="[next]" Condition="base.code == TREE_LIST">common.chain</Item> |
| 47 | + |
| 48 | + <!-- Typed expression and declaration nodes. --> |
| 49 | + <Item Name="[tree_type]" Condition="tree_code_type[base.code] == tcc_declaration || tree_code_type[base.code] == tcc_expression">typed.type</Item> |
| 50 | + |
| 51 | + <!-- Declaration nodes. --> |
| 52 | + <Item Name="[decl_name]" Condition="tree_code_type[base.code] == tcc_declaration">decl_minimal.name</Item> |
| 53 | + <Item Name="[decl_identifier]" Condition="tree_code_type[base.code] == tcc_declaration">decl_minimal.name.identifier.id.str</Item> |
| 54 | + |
| 55 | + <!-- Function declaration. --> |
| 56 | + <Item Name="[arguments]" Condition="base.code == FUNCTION_DECL">function_decl.arguments</Item> |
| 57 | + <Item Name="[result]" Condition="base.code == FUNCTION_DECL">decl_non_common.result</Item> |
| 58 | + |
| 59 | + <!-- Type nodes. --> |
| 60 | + <Item Name="[name]" Condition="tree_code_type[base.code] == tcc_type">type_common.name</Item> |
| 61 | + <Item Name="[size]" Condition="tree_code_type[base.code] == tcc_type">type_common.size.int_cst.val[0]</Item> |
| 62 | + <Item Name="[identifier]" Condition="tree_code_type[base.code] == tcc_type">type_common.name.decl_minimal.name.identifier.id.str</Item> |
| 63 | + <Item Name="[attributes]" Condition="tree_code_type[base.code] == tcc_type">type_common.attributes</Item> |
| 64 | + |
| 65 | + <!-- Identfier nodes. --> |
| 66 | + <Item Name="[pointer]" Condition="base.code == IDENTIFIER_NODE">identifier.id.str</Item> |
| 67 | + <Item Name="[length]" Condition="base.code == IDENTIFIER_NODE">identifier.id.len</Item> |
| 68 | + |
| 69 | + <!-- Expression nodes. --> |
| 70 | + <Item Name="[location]" Condition="tree_code_type[base.code] == tcc_reference || tree_code_type[base.code] == tcc_vl_exp || tree_code_type[base.code] == tcc_expression">expand_location (exp.locus)</Item> |
| 71 | + <Item Name="[operand_0]" Condition="tree_code_length[base.code] > 0 && (tree_code_type[base.code] == tcc_reference || tree_code_type[base.code] == tcc_vl_exp || tree_code_type[base.code] == tcc_expression)">exp.operands[0]</Item> |
| 72 | + <Item Name="[operand_1]" Condition="tree_code_length[base.code] > 1 && (tree_code_type[base.code] == tcc_reference || tree_code_type[base.code] == tcc_vl_exp || tree_code_type[base.code] == tcc_expression)">exp.operands[1]</Item> |
| 73 | + <Item Name="[operand_2]" Condition="tree_code_length[base.code] > 2 && (tree_code_type[base.code] == tcc_reference || tree_code_type[base.code] == tcc_vl_exp || tree_code_type[base.code] == tcc_expression)">exp.operands[2]</Item> |
| 74 | + |
| 75 | + <!-- Call expression nodes. --> |
| 76 | + <Item Name="[function]" Condition="base.code == CALL_EXPR">exp.operands[1]</Item> |
| 77 | + <Item Name="[static_chain]" Condition="base.code == CALL_EXPR">exp.operands[2]</Item> |
| 78 | + <Item Name="[arguments_0]" Condition="base.code == CALL_EXPR">exp.operands[3]</Item> |
| 79 | + <Item Name="[arguments_1]" Condition="base.code == CALL_EXPR">exp.operands[4]</Item> |
| 80 | + <Item Name="[arguments_2]" Condition="base.code == CALL_EXPR">exp.operands[5]</Item> |
| 81 | + <Item Name="[ifn]" Condition="base.code == CALL_EXPR">base.u.ifn</Item> |
| 82 | + |
| 83 | + <!-- Pointer and reference nodes. --> |
| 84 | + <Item Name="[target_type]" Condition="base.code == POINTER_TYPE || base.code == MEM_REF">typed.type</Item> |
| 85 | + |
| 86 | + <!-- Function type. --> |
| 87 | + <Item Name="[arguments]" Condition="base.code == FUNCTION_TYPE">type_non_common.values</Item> |
| 88 | + <Item Name="[stdarg_no_named_arguments]" Condition="base.code == FUNCTION_TYPE">type_common.no_named_args_stdarg_p</Item> |
| 89 | + |
| 90 | + <!-- Constant nodes. --> |
| 91 | + <Item Name="[value_0]" Condition="base.code == INTEGER_CST">int_cst.val[0]</Item> |
| 92 | + |
| 93 | + <Item Name="[ssa_version]" Condition="base.code == SSA_NAME">base.u.version</Item> |
| 94 | + </Expand> |
| 95 | + </Type> |
| 96 | + |
| 97 | + <!-- RTL expression. --> |
| 98 | + <Type Name="rtx"> |
| 99 | + <DisplayString Condition="&code == 0">{(void*)&code}</DisplayString> |
| 100 | + <DisplayString>{{ code={code} name={rtx_name[code]} }}</DisplayString> |
| 101 | + <Expand> |
| 102 | + <Item Name="[code]">code</Item> |
| 103 | + <Item Name="[name]">rtx_name[code]</Item> |
| 104 | + <Item Name="[length]">rtx_length[code]</Item> |
| 105 | + <Item Name="[format]">rtx_format[code]</Item> |
| 106 | + <Item Name="[class]">rtx_class[code]</Item> |
| 107 | + <Item Name="[next]">*(rtx *)(((void*)&code) + rtx_next[code])</Item> |
| 108 | + <IndexListItems Name="[formats]"> |
| 109 | + <Size>rtx_length[code]</Size> |
| 110 | + <ValueNode>*rtx_format[code][$i]</ValueNode> |
| 111 | + </IndexListItems> |
| 112 | + <Item Name="[expr_list]" Condition="code == EXPR_LIST">{(rtx_expr_list*) &code}</Item> |
| 113 | + </Expand> |
| 114 | + </Type> |
| 115 | +</AutoVisualizer> |
0 commit comments