X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/ac9197eec3a25524040ce2f55021ba590788c3a3..9ee28948a83efbfd6b4d9d9e7b513932afa40c10:/src/mc/inspect/ObjectInformation.hpp diff --git a/src/mc/inspect/ObjectInformation.hpp b/src/mc/inspect/ObjectInformation.hpp index 6928513aeb..7d1dfa11dc 100644 --- a/src/mc/inspect/ObjectInformation.hpp +++ b/src/mc/inspect/ObjectInformation.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2007-2019. The SimGrid Team. All rights reserved. */ +/* Copyright (c) 2007-2023. The SimGrid Team. All rights reserved. */ /* 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. */ @@ -18,8 +18,7 @@ #include "src/smpi/include/private.hpp" -namespace simgrid { -namespace mc { +namespace simgrid::mc { /** An entry in the functions index * @@ -48,10 +47,13 @@ struct FunctionIndexEntry { * - etc. */ class ObjectInformation { + bool dwarf_loaded = false; // Lazily loads the dwarf info + public: + void ensure_dwarf_loaded(); // Used by functions that need the dwarf ObjectInformation() = default; - // Not copyable: + // Not copiable: ObjectInformation(ObjectInformation const&) = delete; ObjectInformation& operator=(ObjectInformation const&) = delete; @@ -123,13 +125,17 @@ public: void* base_address() const; /** Find a function by instruction address + * + * Loads the dwarf information on need. * * @param ip instruction address * @return corresponding function (if any) or nullptr */ - simgrid::mc::Frame* find_function(const void* ip) const; + simgrid::mc::Frame* find_function(const void* ip); /** Find a global variable by name + * + * Loads the dwarf information on need. * * This is used to ignore global variables and to find well-known variables * (`__mmalloc_default_mdp`). @@ -137,7 +143,7 @@ public: * @param name scopes name of the global variable (`myproject::Foo::count`) * @return corresponding variable (if any) or nullptr */ - const simgrid::mc::Variable* find_variable(const char* name) const; + const simgrid::mc::Variable* find_variable(const char* name); /** Remove a global variable (in order to ignore it) * @@ -156,10 +162,9 @@ public: XBT_PRIVATE std::shared_ptr createObjectInformation(std::vector const& maps, const char* name); -/** Augment the current module with informations about the other ones */ -XBT_PRIVATE void postProcessObjectInformation(const simgrid::mc::RemoteClient* process, +/** Augment the current module with information about the other ones */ +XBT_PRIVATE void postProcessObjectInformation(const simgrid::mc::RemoteProcessMemory* process, simgrid::mc::ObjectInformation* info); -} // namespace mc -} // namespace simgrid +} // namespace simgrid::mc #endif