+class Process : public AddressSpace {
+public:
+ Process(pid_t pid, int sockfd);
+ ~Process();
+
+ bool is_self() const
+ {
+ return this->process_flags & MC_PROCESS_SELF_FLAG;
+ }
+
+ // Read memory:
+ const void* read_bytes(void* buffer, std::size_t size,
+ remote_ptr<void> address, int process_index = ProcessIndexAny,
+ ReadMode mode = Normal) const override;
+ void read_variable(const char* name, void* target, size_t size) const;
+ char* read_string(remote_ptr<void> address) const;
+
+ // Write memory:
+ void write_bytes(const void* buffer, size_t len, remote_ptr<void> address);
+ void clear_bytes(remote_ptr<void> address, size_t len);
+
+ // Debug information:
+ mc_object_info_t find_object_info(remote_ptr<void> addr) const;
+ mc_object_info_t find_object_info_exec(remote_ptr<void> addr) const;
+ mc_object_info_t find_object_info_rw(remote_ptr<void> addr) const;
+ dw_frame_t find_function(remote_ptr<void> ip) const;
+ dw_variable_t find_variable(const char* name) const;
+
+ // Heap access:
+ xbt_mheap_t get_heap()
+ {
+ if (!(this->cache_flags & MC_PROCESS_CACHE_FLAG_HEAP))
+ this->refresh_heap();
+ return this->heap;
+ }
+ malloc_info* get_malloc_info()
+ {
+ if (!(this->cache_flags & MC_PROCESS_CACHE_FLAG_MALLOC_INFO))
+ this->refresh_malloc_info();
+ return this->heap_info;
+ }
+
+ std::vector<IgnoredRegion> const& ignored_regions() const
+ {
+ return ignored_regions_;
+ }
+ void ignore_region(std::uint64_t address, std::size_t size);
+
+private:
+ void init_memory_map_info();
+ void refresh_heap();
+ void refresh_malloc_info();
+public: // to be private
+ mc_process_flags_t process_flags;