| 923 | |
| 924 | |
| 925 | char* HighLevelILInstructionBase::Dump() const |
| 926 | { |
| 927 | if (!function) |
| 928 | return strdup("<uninit>"); |
| 929 | |
| 930 | vector<InstructionTextToken> tokens; |
| 931 | vector<DisassemblyTextLine> lines = function->GetExprText(*this, new DisassemblySettings()); |
| 932 | if (!lines.empty()) |
| 933 | { |
| 934 | string text; |
| 935 | if (exprIndex != BN_INVALID_EXPR && (exprIndex & 0xffff000000000000) == 0) |
| 936 | { |
| 937 | text += "[expr " + to_string(exprIndex) + "] "; |
| 938 | } |
| 939 | if (instructionIndex != BN_INVALID_EXPR && (instructionIndex & 0xffff000000000000) == 0) |
| 940 | { |
| 941 | text += "[instr " + to_string(instructionIndex) + "] "; |
| 942 | } |
| 943 | Ref<Type> type = GetType(); |
| 944 | if (type) |
| 945 | { |
| 946 | text += "[type: " + type->GetString() + "] "; |
| 947 | } |
| 948 | |
| 949 | for (auto& line: lines) |
| 950 | { |
| 951 | for (auto& token: line.tokens) |
| 952 | { |
| 953 | text += token.text; |
| 954 | } |
| 955 | text += " ; "; |
| 956 | } |
| 957 | return strdup(text.c_str()); |
| 958 | } |
| 959 | else |
| 960 | { |
| 961 | return strdup("???"); |
| 962 | } |
| 963 | } |
| 964 | |
| 965 | |
| 966 | void HighLevelILInstructionBase::Replace(ExprId expr) |
nothing calls this directly
no test coverage detected