Handle serialization of cpu context save (#1129)

* Handle the cpu context save in a more pythonic way, so the context can be serialized and reuse in an other process using the same emulator architecture and modes

* Fix type error ; mistakes a size_t uint64_t ; breaks in 32bit...
This commit is contained in:
BAYET
2019-09-07 13:09:17 +02:00
committed by Nguyen Anh Quynh
parent 6c948b43ba
commit 8987ad0fff
3 changed files with 36 additions and 17 deletions

View File

@ -723,6 +723,18 @@ uc_err uc_context_save(uc_engine *uc, uc_context *context);
UNICORN_EXPORT
uc_err uc_context_restore(uc_engine *uc, uc_context *context);
/*
Return the size needed to store the cpu context. Can be used to allocate a buffer
to contain the cpu context and directly call uc_context_save.
@uc: handle returned by uc_open()
@return the size for needed to store the cpu context as as size_t.
*/
UNICORN_EXPORT
size_t uc_context_size(uc_engine *uc);
#ifdef __cplusplus
}
#endif