X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/51103b4c6fa48b0be6a54f7cf2ec35ca7c228c2c..121e1dc6ee0462b6f6f1f1570b0f48c61ee4ff9a:/src/mc/Process.cpp diff --git a/src/mc/Process.cpp b/src/mc/Process.cpp index df7ef3cc28..5b1f3c9314 100644 --- a/src/mc/Process.cpp +++ b/src/mc/Process.cpp @@ -248,8 +248,10 @@ Process::~Process() close(this->memory_file); if (this->unw_underlying_addr_space != unw_local_addr_space) { - unw_destroy_addr_space(this->unw_underlying_addr_space); - _UPT_destroy(this->unw_underlying_context); + if (this->unw_underlying_addr_space) + unw_destroy_addr_space(this->unw_underlying_addr_space); + if (this->unw_underlying_context) + _UPT_destroy(this->unw_underlying_context); } unw_destroy_addr_space(this->unw_addr_space); @@ -498,8 +500,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size, } #endif } - - if (pread_whole(this->memory_file, buffer, size, (off_t) address.address()) < 0) + if (pread_whole(this->memory_file, buffer, size, (size_t) address.address()) < 0) xbt_die("Read at %p from process %lli failed", (void*)address.address(), (long long)this->pid_); return buffer; } @@ -512,7 +513,7 @@ const void *Process::read_bytes(void* buffer, std::size_t size, */ void Process::write_bytes(const void* buffer, size_t len, RemotePtr address) { - if (pwrite_whole(this->memory_file, buffer, len, address.address()) < 0) + if (pwrite_whole(this->memory_file, buffer, len, (size_t)address.address()) < 0) xbt_die("Write to process %lli failed", (long long) this->pid_); }