comment out unfinished str hook api

This commit is contained in:
Richard Holland
2023-01-04 10:56:52 +00:00
parent e0533cae8d
commit 75f3b93c78
4 changed files with 33 additions and 25 deletions

View File

@@ -578,10 +578,12 @@ namespace hook_api
"hook_skip",
"hook_again",
"meta_slot",
/*
"str_find",
"str_replace",
"str_concat",
"str_compare"
*/
};
};
#endif

View File

@@ -202,7 +202,7 @@ namespace hook_api
DECLARE_HOOK_FUNCTION(int64_t, meta_slot, uint32_t slot_no );
/*
DECLARE_HOOK_FUNCTION(int64_t, str_find, uint32_t hread_ptr, uint32_t hread_len,
uint32_t nread_ptr, uint32_t nread_len,
uint32_t mode, uint32_t n);
@@ -217,7 +217,7 @@ namespace hook_api
DECLARE_HOOK_FUNCTION(int64_t, str_concat, uint32_t write_ptr, uint32_t write_len,
uint32_t read_ptr, uint32_t read_len,
uint64_t operand, uint32_t operand_type);
*/
} /* end namespace hook_api */
namespace hook
@@ -619,11 +619,12 @@ namespace hook
ADD_HOOK_FUNCTION(meta_slot, ctx);
/*
ADD_HOOK_FUNCTION(str_find, ctx);
ADD_HOOK_FUNCTION(str_replace, ctx);
ADD_HOOK_FUNCTION(str_compare, ctx);
ADD_HOOK_FUNCTION(str_concat, ctx);
*/
WasmEdge_TableInstanceContext* hostTable = WasmEdge_TableInstanceCreate(tableType);
WasmEdge_ModuleInstanceAddTable(importObj, tableName, hostTable);

View File

@@ -5092,6 +5092,7 @@ DEFINE_HOOK_FUNCTION(
return slot_into;
}
/*
DEFINE_HOOK_FUNCTION(
int64_t,
@@ -5269,28 +5270,26 @@ findNul(const void* vptr, size_t len)
return found;
}
/*
Overloaded API:
If operand_type == 0:
Copy read_ptr/len to write_ptr/len, do nothing else.
If operand_type > 0:
Copy read_ptr/len to write_ptr/len up to nul terminator, then
If operand_type == 1:
Concatenate operand as an i32 to the end of the string in write_ptr
If operand_type == 2:
Concatenate operand as an u32 to the end of the string in write_ptr
If operand_type == 3/4:
As above with i/u64
If operand_type == 5:
As above with operand interpreted as an XFL. Top 4 bits of operand_type are
precision for this type.
If operand_type == 6:
Interpret the four most significant bytes of operand as a ptr, and the
four least significant bytes as a length.
Write the bytes at this location to the end of write_ptr.
Finally:
Add a nul terminator to the end of write_ptr.
*/
// Overloaded API:
// If operand_type == 0:
// Copy read_ptr/len to write_ptr/len, do nothing else.
// If operand_type > 0:
// Copy read_ptr/len to write_ptr/len up to nul terminator, then
// If operand_type == 1:
// Concatenate operand as an i32 to the end of the string in write_ptr
// If operand_type == 2:
// Concatenate operand as an u32 to the end of the string in write_ptr
// If operand_type == 3/4:
// As above with i/u64
// If operand_type == 5:
// As above with operand interpreted as an XFL. Top 4 bits of operand_type are
// precision for this type.
// If operand_type == 6:
// Interpret the four most significant bytes of operand as a ptr, and the
// four least significant bytes as a length.
// Write the bytes at this location to the end of write_ptr.
// Finally:
// Add a nul terminator to the end of write_ptr.
DEFINE_HOOK_FUNCTION(
int64_t,
str_concat,
@@ -5433,3 +5432,5 @@ DEFINE_HOOK_FUNCTION(
return INVALID_ARGUMENT;
}
}
*/

View File

@@ -7807,6 +7807,7 @@ public:
env(pay(bob, alice, XRP(1)), M("test sto_validate"), fee(XRP(1)));
}
/*
void
test_str_compare()
{
@@ -7826,6 +7827,7 @@ public:
test_str_replace()
{
}
*/
void
test_trace()
@@ -9723,10 +9725,12 @@ public:
test_sto_subfield(); //
test_sto_validate(); //
/*
test_str_compare();
test_str_concat();
test_str_find();
test_str_replace();
*/
test_trace();
test_trace_float();