unsigned long Api::get_maxpid() const
{
- static const char* name = nullptr;
- if (not name) {
- name = "simgrid::kernel::actor::maxpid";
- if (mc_model_checker->get_remote_process().find_variable(name) == nullptr)
- name = "maxpid"; // We seem to miss the namespaces when compiling with GCC
- }
- unsigned long maxpid;
- mc_model_checker->get_remote_process().read_variable(name, &maxpid, sizeof(maxpid));
- return maxpid;
+ return mc_model_checker->get_remote_process().get_maxpid();
}
int Api::get_actors_size() const
_UPT_destroy(context);
unw_destroy_addr_space(as);
}
+
+unsigned long RemoteProcess::get_maxpid() const
+{
+ static const char* name = nullptr;
+ if (not name) {
+ name = "simgrid::kernel::actor::maxpid";
+ if (find_variable(name) == nullptr)
+ name = "maxpid"; // We seem to miss the namespaces when compiling with GCC
+ }
+ unsigned long maxpid;
+ read_variable(name, &maxpid, sizeof(maxpid));
+ return maxpid;
+}
+
} // namespace mc
} // namespace simgrid
RemoteProcess& operator=(RemoteProcess const&) = delete;
RemoteProcess& operator=(RemoteProcess&&) = delete;
+ /* ************* */
+ /* Low-level API */
+ /* ************* */
+
// Read memory:
void* read_bytes(void* buffer, std::size_t size, RemotePtr<void> address,
ReadOptions options = ReadOptions::none()) const override;
void unignore_heap(void* address, size_t size);
void ignore_local_variable(const char* var_name, const char* frame_name) const;
+
+ /* ***************** */
+ /* SIMIX-related API */
+ /* ***************** */
+
std::vector<ActorInformation>& actors();
std::vector<ActorInformation>& dead_actors();
return nullptr;
}
+ unsigned long get_maxpid() const;
+
void dump_stack() const;
private: