/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
-static ssize_t pread_whole(int fd, void *buf, size_t count, off_t offset)
+static ssize_t pread_whole(int fd, void *buf, size_t count, std::uint64_t offset)
- ssize_t res = pread(fd, buffer, count, offset);
+ ssize_t res = pread(fd, buffer, count, (std::int64_t) offset);
if (addr.address() >= (std::uint64_t) info->start_exec
&& addr.address() <= (std::uint64_t) info->end_exec) {
return info;
if (addr.address() >= (std::uint64_t) info->start_exec
&& addr.address() <= (std::uint64_t) info->end_exec) {
return info;
if (addr.address() >= (std::uint64_t)info->start_rw
&& addr.address() <= (std::uint64_t)info->end_rw) {
return info;
if (addr.address() >= (std::uint64_t)info->start_rw
&& addr.address() <= (std::uint64_t)info->end_rw) {
return info;
{
// First lookup the variable in the executable shared object.
// A global variable used directly by the executable code from a library
{
// First lookup the variable in the executable shared object.
// A global variable used directly by the executable code from a library
// We need to look up the variable in the execvutable first.
if (this->binary_info) {
std::shared_ptr<s_mc_object_info_t> const& info = this->binary_info;
// We need to look up the variable in the execvutable first.
if (this->binary_info) {
std::shared_ptr<s_mc_object_info_t> const& info = this->binary_info;
std::shared_ptr<s_mc_object_info_t> const& info =
this->find_object_info_rw((void*)address.address());
// Segment overlap is not handled.
std::shared_ptr<s_mc_object_info_t> const& info =
this->find_object_info_rw((void*)address.address());
// Segment overlap is not handled.
- if (pread_whole(this->memory_file, buffer, size, (off_t) address.address()) < 0)
+ if (pread_whole(this->memory_file, buffer, size, address.address()) < 0)