Skip to content

Commit a6ed94d

Browse files
kyle-elliott-tobkumarak
authored andcommitted
Correct pcode type name for bool
- Not sure if there was an update or this was an invalid assumption - Added generic helper for dumping llvm::json::Object
1 parent fdb6604 commit a6ed94d

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

include/patchestry/Ghidra/PcodeTypes.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ namespace patchestry::ghidra {
3939
static VarnodeType::Kind convertToKind(const std::string &kind) {
4040
static const std::unordered_map< std::string, VarnodeType::Kind > kind_map = {
4141
{ "invalid", VT_INVALID },
42-
{ "bool", VT_BOOLEAN },
42+
{ "boolean", VT_BOOLEAN },
4343
{ "integer", VT_INTEGER },
4444
{ "float", VT_FLOAT },
4545
{ "pointer", VT_POINTER },

lib/patchestry/Ghidra/JsonDeserialize.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,17 @@ namespace patchestry::ghidra {
6464
return default_value;
6565
}
6666

67+
[[maybe_unused]] static std::string
68+
dump_json_object(const JsonObject &object) {
69+
std::string result;
70+
llvm::raw_string_ostream os(result);
71+
72+
llvm::json::Object copy = object; // Make a copy
73+
os << llvm::json::Value(std::move(copy));
74+
75+
return result;
76+
}
77+
6778
std::optional< Program > JsonParser::deserialize_program(const JsonObject &root) {
6879
Program program;
6980
program.arch = get_string_if_valid(root, "architecture");

0 commit comments

Comments
 (0)