Revert "page_cache: auto-create workdir files or resume based on existing files"

This reverts commit b8995723775c5ee75355ef4e87922cec359245e5.
This commit is contained in:
Steffen Schulz 2022-05-25 01:06:50 +02:00
parent c93998e817
commit 6a336d0d3a
2 changed files with 27 additions and 3 deletions

View File

@ -262,6 +262,30 @@ static bool verify_workdir_state(nyx_interface_state *s, Error **errp){
} }
free(tmp); free(tmp);
assert(asprintf(&tmp, "%s/page_cache.lock", workdir) != -1);
if (!file_exits(tmp)){
fprintf(stderr, "%s does not exist...", tmp);
free(tmp);
return false;
}
free(tmp);
assert(asprintf(&tmp, "%s/page_cache.addr", workdir) != -1);
if (!file_exits(tmp)){
fprintf(stderr, "%s does not exist...\n", tmp);
free(tmp);
return false;
}
free(tmp);
assert(asprintf(&tmp, "%s/page_cache.dump", workdir) != -1);
if (!file_exits(tmp)){
fprintf(stderr, "%s does not exist...\n", tmp);
free(tmp);
return false;
}
free(tmp);
assert(asprintf(&tmp, "%s/page_cache", workdir) != -1); assert(asprintf(&tmp, "%s/page_cache", workdir) != -1);
init_page_cache(tmp); init_page_cache(tmp);

View File

@ -359,12 +359,12 @@ page_cache_t* page_cache_new(const char* cache_file, uint8_t disassembler_word_w
self->lookup = kh_init(PC_CACHE); self->lookup = kh_init(PC_CACHE);
self->fd_page_file = open(tmp1, O_CLOEXEC | O_CREAT | O_RDWR, 0644); self->fd_page_file = open(tmp1, O_CLOEXEC | O_RDWR, S_IRWXU);
self->fd_address_file = open(tmp2, O_CLOEXEC | O_CREAT | O_RDWR, 0644); self->fd_address_file = open(tmp2, O_CLOEXEC | O_RDWR, S_IRWXU);
#ifndef STANDALONE_DECODER #ifndef STANDALONE_DECODER
self->cpu = cpu; self->cpu = cpu;
self->fd_lock = open(tmp3, O_CLOEXEC | O_CREAT, 0644); self->fd_lock = open(tmp3, O_CLOEXEC);
assert(self->fd_lock > 0); assert(self->fd_lock > 0);
#else #else
if(self->fd_page_file == -1 || self->fd_address_file == -1){ if(self->fd_page_file == -1 || self->fd_address_file == -1){