X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c894ea3fd013477a63da527161127566d17e350a..fec14532fe6d78b5a7a56cb53b886b6658b4e223:/src/mc/ObjectInformation.cpp diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp index 08a75fa583..59280f996f 100644 --- a/src/mc/ObjectInformation.cpp +++ b/src/mc/ObjectInformation.cpp @@ -4,6 +4,10 @@ /* 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. */ +#include + +#include + #include "src/mc/Frame.hpp" #include "src/mc/ObjectInformation.hpp" #include "src/mc/Variable.hpp" @@ -28,7 +32,7 @@ ObjectInformation::ObjectInformation() * * An offset is applied to address found in DWARF: * - * * for an executable obejct, addresses are virtual address + * * for an executable object, addresses are virtual address * (there is no offset) i.e. * \f$\text{virtual address} = \{dwarf address}\f$; * @@ -44,9 +48,9 @@ void *ObjectInformation::base_address() const return nullptr; void *result = this->start_exec; - if (this->start_rw != NULL && result > (void *) this->start_rw) + if (this->start_rw != nullptr && result > (void *) this->start_rw) result = this->start_rw; - if (this->start_ro != NULL && result > (void *) this->start_ro) + if (this->start_ro != nullptr && result > (void *) this->start_ro) result = this->start_ro; return result; } @@ -62,7 +66,7 @@ simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const * during the binary search (only at the end) so it is not included * in the index entry. We could use parallel arrays as well. * - * We cannot really use the std:: alogrithm for this. + * We cannot really use the std:: algorithm for this. * We could use std::binary_search by including the high_pc inside * the FunctionIndexEntry. */ @@ -83,8 +87,8 @@ simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const /* At this point, the search is over. * Either we have found the correct function or we do not know * any function corresponding to this instruction address. - * Only at the point do we derefernce the function pointer. */ - else if (ip < base[k].function->high_pc) + * Only at the point do we dereference the function pointer. */ + else if ((std::uint64_t) ip < base[k].function->range.end()) return base[k].function; else return nullptr; @@ -149,7 +153,7 @@ void ObjectInformation::remove_global_variable(const char* name) * name. * * \param var_name Name of the local variable (or parameter to ignore) - * \param subprogram_name Name of the subprogram fo ignore (NULL for any) + * \param subprogram_name Name of the subprogram to ignore (nullptr for any) * \param subprogram (possibly inlined) Subprogram of the scope * \param scope Current scope */