X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/dccf1b41e9c7b5a696f01abceaa2779fe65f154f..9acedb4ebce15cd3399fcad4effb3fb79a0ee5ef:/src/mc/ObjectInformation.cpp diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp index 96835b814a..a8de56bb67 100644 --- a/src/mc/ObjectInformation.cpp +++ b/src/mc/ObjectInformation.cpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2014-2015. The SimGrid Team. +/* Copyright (c) 2014-2019. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -15,11 +15,9 @@ namespace simgrid { namespace mc { -ObjectInformation::ObjectInformation() {} - /* For an executable object, addresses are virtual address * (there is no offset) i.e. - * \f$\text{virtual address} = \{dwarf address}\f$; + * \f$\text{virtual address} = \{dwarf address}\f$ * * For a shared object, the addreses are offset from the begining * of the shared object (the base address of the mapped shared @@ -47,7 +45,7 @@ simgrid::mc::Frame* ObjectInformation::find_function(const void *ip) const { /* This is implemented by binary search on a sorted array. * - * We do quite a lot ot those so we want this to be cache efficient. + * We do quite a lot of those so we want this to be cache efficient. * We pack the only information we need in the index entries in order * to successfully do the binary search. We do not need the high_pc * during the binary search (only at the end) so it is not included @@ -108,7 +106,7 @@ void ObjectInformation::remove_global_variable(const char* name) int cmp = current_var.name.compare(name); if (cmp == 0) { - + // Find the whole range: size_type first = cursor; while (first != 0 && this->global_variables[first - 1].name == name) @@ -117,12 +115,12 @@ void ObjectInformation::remove_global_variable(const char* name) size_type last = cursor; while (last != size - 1 && this->global_variables[last + 1].name == name) last++; - + // Remove the whole range: this->global_variables.erase( this->global_variables.begin() + first, this->global_variables.begin() + last + 1); - + return; } else if (cmp < 0) first = cursor + 1; @@ -152,10 +150,8 @@ static void remove_local_variable(simgrid::mc::Frame& scope, typedef std::vector::size_type size_type; // If the current subprogram matches the given name: - if ((subprogram_name == nullptr || - (!subprogram.name.empty() - && subprogram.name == subprogram_name)) - && !scope.variables.empty()) { + if ((subprogram_name == nullptr || (not subprogram.name.empty() && subprogram.name == subprogram_name)) && + not scope.variables.empty()) { // Try to find the variable and remove it: size_type start = 0; @@ -200,4 +196,4 @@ void ObjectInformation::remove_local_variable( } } -} \ No newline at end of file +}