From 31a461643fe82c00e0fe4efc8941eee20b0838ea Mon Sep 17 00:00:00 2001 From: Gabriel Corona Date: Fri, 24 Jul 2015 14:13:05 +0200 Subject: [PATCH] [mc] Move Frame, ModelChecker, ObjectInformation, Type, Variable in their own files --- buildtools/Cmake/DefinePackages.cmake | 18 +- src/mc/Frame.hpp | 37 ++++ src/mc/ObjectInformation.cpp | 98 +++++++++ src/mc/ObjectInformation.hpp | 104 +++++++++ src/mc/Type.hpp | 72 +++++++ src/mc/Variable.cpp | 0 src/mc/Variable.hpp | 39 ++++ src/mc/mc_checkpoint.cpp | 4 + src/mc/mc_compare.cpp | 4 + src/mc/mc_diff.cpp | 1 + src/mc/mc_dwarf.cpp | 4 + src/mc/mc_dwarf_expression.cpp | 4 + src/mc/mc_dwarf_tagnames.cpp | 1 + src/mc/mc_member.cpp | 1 + src/mc/mc_object_info.cpp | 94 +-------- src/mc/mc_object_info.h | 199 +----------------- src/mc/mc_process.cpp | 5 +- src/mc/mc_unw.cpp | 1 + src/mc/mcer_ignore.cpp | 4 + teshsuite/mc/dwarf/dwarf.cpp | 11 +- .../mc/dwarf_expression/dwarf_expression.cpp | 9 +- tools/generate-dwarf-functions | 1 + 22 files changed, 413 insertions(+), 298 deletions(-) create mode 100644 src/mc/Frame.hpp create mode 100644 src/mc/ObjectInformation.cpp create mode 100644 src/mc/ObjectInformation.hpp create mode 100644 src/mc/Type.hpp create mode 100644 src/mc/Variable.cpp create mode 100644 src/mc/Variable.hpp diff --git a/buildtools/Cmake/DefinePackages.cmake b/buildtools/Cmake/DefinePackages.cmake index dcb025e62e..d72eaf8c7c 100644 --- a/buildtools/Cmake/DefinePackages.cmake +++ b/buildtools/Cmake/DefinePackages.cmake @@ -601,6 +601,18 @@ set(MC_SRC_BASE set(MC_SRC src/mc/AddressSpace.hpp src/mc/AddressSpace.cpp + src/mc/Frame.hpp + src/mc/ModelChecker.hpp + src/mc/ModelChecker.cpp + src/mc/ObjectInformation.hpp + src/mc/ObjectInformation.cpp + src/mc/PageStore.hpp + src/mc/PageStore.cpp + src/mc/RegionSnapshot.cpp + src/mc/RegionSnapshot.hpp + src/mc/Type.hpp + src/mc/Variable.hpp + src/mc/mc_forward.h src/mc/mc_forward.hpp src/mc/mc_process.h @@ -609,17 +621,11 @@ set(MC_SRC src/mc/mc_unw.cpp src/mc/mc_unw_vmread.cpp src/mc/mc_mmalloc.h - src/mc/ModelChecker.hpp - src/mc/ModelChecker.cpp src/mc/mc_object_info.h src/mc/mc_object_info.cpp src/mc/mc_checkpoint.cpp src/mc/mc_snapshot.h src/mc/mc_snapshot.cpp - src/mc/RegionSnapshot.cpp - src/mc/RegionSnapshot.hpp - src/mc/PageStore.hpp - src/mc/PageStore.cpp src/mc/mc_page_snapshot.cpp src/mc/mc_comm_pattern.h src/mc/mc_comm_pattern.cpp diff --git a/src/mc/Frame.hpp b/src/mc/Frame.hpp new file mode 100644 index 0000000000..bdbbbca791 --- /dev/null +++ b/src/mc/Frame.hpp @@ -0,0 +1,37 @@ +/* Copyright (c) 2007-2015. 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. */ + +#ifndef SIMGRID_MC_FRAME_HPP +#define SIMGRID_MC_FRAME_HPP + +#include + +#include "mc_forward.h" +#include "mc_location.h" + +namespace simgrid { +namespace mc { + +class Frame { +public: + Frame(); + + int tag; + std::string name; + void *low_pc; + void *high_pc; + simgrid::mc::LocationList frame_base; + std::vector variables; + unsigned long int id; /* DWARF offset of the subprogram */ + std::vector scopes; + unsigned long int abstract_origin_id; + simgrid::mc::ObjectInformation* object_info; +}; + +} +} + +#endif diff --git a/src/mc/ObjectInformation.cpp b/src/mc/ObjectInformation.cpp new file mode 100644 index 0000000000..0305fd5d2c --- /dev/null +++ b/src/mc/ObjectInformation.cpp @@ -0,0 +1,98 @@ +#include "mc/Frame.hpp" +#include "mc/ObjectInformation.hpp" +#include "mc/Variable.hpp" + +namespace simgrid { +namespace mc { + +ObjectInformation::ObjectInformation() +{ + this->flags = 0; + this->start = nullptr; + this->end = nullptr; + this->start_exec = nullptr; + this->end_exec = nullptr; + this->start_rw = nullptr; + this->end_rw = nullptr; + this->start_ro = nullptr; + this->end_ro = nullptr; +} + +/** Find the DWARF offset for this ELF object + * + * An offset is applied to address found in DWARF: + * + * * for an executable obejct, addresses are virtual address + * (there is no offset) i.e. + * \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 + * object must be used as offset + * i.e. \f$\text{virtual address} = \text{shared object base address} + * + \text{dwarf address}\f$. + */ +void *ObjectInformation::base_address() const +{ + if (this->executable()) + return nullptr; + + void *result = this->start_exec; + if (this->start_rw != NULL && result > (void *) this->start_rw) + result = this->start_rw; + if (this->start_ro != NULL && result > (void *) this->start_ro) + result = this->start_ro; + return result; +} + +/* Find a function by instruction pointer */ +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 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 + * in the index entry. We could use parallel arrays as well. + * + * We cannot really use the std:: alogrithm for this. + * We could use std::binary_search by including the high_pc inside + * the FunctionIndexEntry. + */ + const simgrid::mc::FunctionIndexEntry* base = + this->functions_index.data(); + int i = 0; + int j = this->functions_index.size() - 1; + while (j >= i) { + int k = i + ((j - i) / 2); + + /* In most of the search, we do not dereference the base[k].function. + * This way the memory accesses are located in the base[k] array. */ + if (ip < base[k].low_pc) + j = k - 1; + else if (k < j && ip >= base[k + 1].low_pc) + i = k + 1; + + /* 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) + return base[k].function; + else + return nullptr; + } + return nullptr; +} + +simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const +{ + for (simgrid::mc::Variable& variable : this->global_variables) + if(variable.name == name) + return &variable; + return nullptr; +} + +} +} \ No newline at end of file diff --git a/src/mc/ObjectInformation.hpp b/src/mc/ObjectInformation.hpp new file mode 100644 index 0000000000..8ada283b53 --- /dev/null +++ b/src/mc/ObjectInformation.hpp @@ -0,0 +1,104 @@ +/* Copyright (c) 2007-2015. 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. */ + +#ifndef SIMGRID_MC_OBJECT_INFORMATION_HPP +#define SIMGRID_MC_OBJECT_INFORMATION_HPP + +#include +#include +#include + +#include "mc/mc_forward.h" +#include "mc/Type.hpp" +#include "mc/Frame.hpp" + +#include "smpi/private.h" + +namespace simgrid { +namespace mc { + +/** An entry in the functions index + * + * See the code of ObjectInformation::find_function. + */ +struct FunctionIndexEntry { + void* low_pc; + simgrid::mc::Frame* function; +}; + +/** Information about an (ELF) executable/sharedobject + * + * This contain sall the information we have at runtime about an + * executable/shared object in the target (modelchecked) process: + * - where it is located in the virtual address space; + * - where are located it's different memory mapping in the the + * virtual address space ; + * - all the debugging (DWARF) information, + * - location of the functions, + * - types + * - etc. + * + * It is not copyable because we are taking pointers to Types/Frames. + * We'd have to update/rebuild some data structures in order to copy + * successfully. + */ + +class ObjectInformation { +public: + ObjectInformation(); + + // Not copyable: + ObjectInformation(ObjectInformation const&) = delete; + ObjectInformation& operator=(ObjectInformation const&) = delete; + + // Flag: + static const int Executable = 1; + + /** Bitfield of flags */ + int flags; + std::string file_name; + const void* start; + const void *end; + char *start_exec; + char *end_exec; // Executable segment + char *start_rw; + char *end_rw; // Read-write segment + char *start_ro; + char *end_ro; // read-only segment + std::unordered_map subprograms; + // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere) + mutable std::vector global_variables; + std::unordered_map types; + std::unordered_map full_types_by_name; + + /** Index of functions by IP + * + * The entries are sorted by low_pc and a binary search can be used to look + * them up. Should we used a binary tree instead? + */ + std::vector functions_index; + + bool executable() const + { + return this->flags & simgrid::mc::ObjectInformation::Executable; + } + + bool privatized() const + { + return this->executable() && smpi_privatize_global_variables; + } + + void* base_address() const; + + simgrid::mc::Frame* find_function(const void *ip) const; + simgrid::mc::Variable* find_variable(const char* name) const; + +}; + +} +} + +#endif diff --git a/src/mc/Type.hpp b/src/mc/Type.hpp new file mode 100644 index 0000000000..287a6794b9 --- /dev/null +++ b/src/mc/Type.hpp @@ -0,0 +1,72 @@ +/* Copyright (c) 2007-2015. 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. */ + +#ifndef SIMGRID_MC_TYPE_HPP +#define SIMGRID_MC_TYPE_HPP + +#include +#include + +#include "mc_forward.h" +#include "mc_location.h" + +namespace simgrid { +namespace mc { + +/** Represents a type in the program + * + * It is currently used to represent members of structs and unions as well. + */ +class Type { +public: + Type(); + Type(Type const& type) = default; + Type& operator=(Type const&) = default; + Type(Type&& type) = default; + Type& operator=(Type&&) = default; + + /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */ + int type; + unsigned id; /* Offset in the section (in hexadecimal form) */ + std::string name; /* Name of the type */ + int byte_size; /* Size in bytes */ + int element_count; /* Number of elements for array type */ + unsigned type_id; /* DW_AT_type id */ + std::vector members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/ + int is_pointer_type; + + // Location (for members) is either of: + simgrid::mc::DwarfExpression location_expression; + + simgrid::mc::Type* subtype; // DW_AT_type + simgrid::mc::Type* full_type; // The same (but more complete) type + + bool has_offset_location() const + { + return location_expression.size() == 1 && + location_expression[0].atom == DW_OP_plus_uconst; + } + + // TODO, check if this shortcut is really necessary + int offset() const + { + xbt_assert(this->has_offset_location()); + return this->location_expression[0].number; + } + + void offset(int new_offset) + { + Dwarf_Op op; + op.atom = DW_OP_plus_uconst; + op.number = new_offset; + this->location_expression = { op }; + } +}; + +} +} + +#endif diff --git a/src/mc/Variable.cpp b/src/mc/Variable.cpp new file mode 100644 index 0000000000..e69de29bb2 diff --git a/src/mc/Variable.hpp b/src/mc/Variable.hpp new file mode 100644 index 0000000000..ec1e071764 --- /dev/null +++ b/src/mc/Variable.hpp @@ -0,0 +1,39 @@ +/* Copyright (c) 2007-2014. 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. */ + +#ifndef SIMGRID_MC_VARIABLE_HPP +#define SIMGRID_MC_VARIABLE_HPP + +#include + +#include "mc_forward.h" +#include "mc_location.h" + +namespace simgrid { +namespace mc { + +class Variable { +public: + Variable(); + + unsigned dwarf_offset; /* Global offset of the field. */ + int global; + std::string name; + unsigned type_id; + simgrid::mc::Type* type; + + // Use either of: + simgrid::mc::LocationList location_list; + void* address; + + size_t start_scope; + simgrid::mc::ObjectInformation* object_info; +}; + +} +} + +#endif diff --git a/src/mc/mc_checkpoint.cpp b/src/mc/mc_checkpoint.cpp index 54f04dfa22..f58555585f 100644 --- a/src/mc/mc_checkpoint.cpp +++ b/src/mc/mc_checkpoint.cpp @@ -36,6 +36,10 @@ #include "mc_smx.h" #include "mc_hash.hpp" +#include "mc/ObjectInformation.hpp" +#include "mc/Frame.hpp" +#include "mc/Variable.hpp" + using simgrid::mc::remote; extern "C" { diff --git a/src/mc/mc_compare.cpp b/src/mc/mc_compare.cpp index 9802a17056..4510abbcff 100644 --- a/src/mc/mc_compare.cpp +++ b/src/mc/mc_compare.cpp @@ -17,6 +17,10 @@ #include "mc_private.h" #include "mc_smx.h" +#include "mc/Frame.hpp" +#include "mc/ObjectInformation.hpp" +#include "mc/Variable.hpp" + #ifdef HAVE_SMPI #include "smpi/private.h" #endif diff --git a/src/mc/mc_diff.cpp b/src/mc/mc_diff.cpp index 628bbb61b5..68e13981be 100644 --- a/src/mc/mc_diff.cpp +++ b/src/mc/mc_diff.cpp @@ -14,6 +14,7 @@ #include "mc/datatypes.h" #include "mc/mc_private.h" #include "mc/mc_snapshot.h" +#include "mc/Type.hpp" using simgrid::mc::remote; diff --git a/src/mc/mc_dwarf.cpp b/src/mc/mc_dwarf.cpp index 3ac63ab297..e433de4966 100644 --- a/src/mc/mc_dwarf.cpp +++ b/src/mc/mc_dwarf.cpp @@ -23,6 +23,10 @@ #include "mc_object_info.h" #include "mc_private.h" +#include "mc_process.h" + +#include "mc/ObjectInformation.hpp" +#include "mc/Variable.hpp" XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_dwarf, mc, "DWARF processing"); diff --git a/src/mc/mc_dwarf_expression.cpp b/src/mc/mc_dwarf_expression.cpp index cc4b93076a..15d6631865 100644 --- a/src/mc/mc_dwarf_expression.cpp +++ b/src/mc/mc_dwarf_expression.cpp @@ -12,6 +12,10 @@ #include "mc_object_info.h" #include "mc_private.h" +#include "mc_location.h" +#include "mc/AddressSpace.hpp" +#include "mc/Frame.hpp" +#include "mc/ObjectInformation.hpp" using simgrid::mc::remote; diff --git a/src/mc/mc_dwarf_tagnames.cpp b/src/mc/mc_dwarf_tagnames.cpp index 0ea1de0d6d..af6b526990 100644 --- a/src/mc/mc_dwarf_tagnames.cpp +++ b/src/mc/mc_dwarf_tagnames.cpp @@ -7,6 +7,7 @@ /* Warning: autogenerated, do not edit! */ #include +#include #include #include "mc_object_info.h" diff --git a/src/mc/mc_member.cpp b/src/mc/mc_member.cpp index 59e7e7d06c..228332d336 100644 --- a/src/mc/mc_member.cpp +++ b/src/mc/mc_member.cpp @@ -8,6 +8,7 @@ #include "mc_object_info.h" #include "mc_private.h" +#include "mc/Type.hpp" /** Resolve snapshot in the process address space * diff --git a/src/mc/mc_object_info.cpp b/src/mc/mc_object_info.cpp index 3d3703c3c6..a3895bfddd 100644 --- a/src/mc/mc_object_info.cpp +++ b/src/mc/mc_object_info.cpp @@ -10,6 +10,9 @@ #include "mc_object_info.h" #include "mc_private.h" +#include "mc/Frame.hpp" +#include "mc/Type.hpp" +#include "mc/Variable.hpp" namespace simgrid { namespace mc { @@ -65,96 +68,5 @@ Frame::Frame() this->object_info = nullptr; } -// ObjectInformations - -ObjectInformation::ObjectInformation() -{ - this->flags = 0; - this->start = nullptr; - this->end = nullptr; - this->start_exec = nullptr; - this->end_exec = nullptr; - this->start_rw = nullptr; - this->end_rw = nullptr; - this->start_ro = nullptr; - this->end_ro = nullptr; -} - -/** Find the DWARF offset for this ELF object - * - * An offset is applied to address found in DWARF: - * - * * for an executable obejct, addresses are virtual address - * (there is no offset) i.e. - * \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 - * object must be used as offset - * i.e. \f$\text{virtual address} = \text{shared object base address} - * + \text{dwarf address}\f$. - */ -void *ObjectInformation::base_address() const -{ - if (this->executable()) - return nullptr; - - void *result = this->start_exec; - if (this->start_rw != NULL && result > (void *) this->start_rw) - result = this->start_rw; - if (this->start_ro != NULL && result > (void *) this->start_ro) - result = this->start_ro; - return result; -} - -/* Find a function by instruction pointer */ -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 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 - * in the index entry. We could use parallel arrays as well. - * - * We cannot really use the std:: alogrithm for this. - * We could use std::binary_search by including the high_pc inside - * the FunctionIndexEntry. - */ - const simgrid::mc::FunctionIndexEntry* base = - this->functions_index.data(); - int i = 0; - int j = this->functions_index.size() - 1; - while (j >= i) { - int k = i + ((j - i) / 2); - - /* In most of the search, we do not dereference the base[k].function. - * This way the memory accesses are located in the base[k] array. */ - if (ip < base[k].low_pc) - j = k - 1; - else if (k < j && ip >= base[k + 1].low_pc) - i = k + 1; - - /* 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) - return base[k].function; - else - return nullptr; - } - return nullptr; -} - -simgrid::mc::Variable* ObjectInformation::find_variable(const char* name) const -{ - for (simgrid::mc::Variable& variable : this->global_variables) - if(variable.name == name) - return &variable; - return nullptr; -} - } } \ No newline at end of file diff --git a/src/mc/mc_object_info.h b/src/mc/mc_object_info.h index 2ec4e56fef..c1c6ae4b15 100644 --- a/src/mc/mc_object_info.h +++ b/src/mc/mc_object_info.h @@ -4,208 +4,16 @@ /* 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. */ -/** file - * Debug information for the MC. - */ - #ifndef SIMGRID_MC_OBJECT_INFO_H #define SIMGRID_MC_OBJECT_INFO_H -#include - -#include #include -#include - -#include -#include -#include +#include -#include +#include #include "mc_forward.hpp" -#include "mc_location.h" -#include "mc_process.h" -#include "../smpi/private.h" - -// ***** Type - -namespace simgrid { -namespace mc { - -/** Represents a type in the program - * - * It is currently used to represent members of structs and unions as well. - */ -class Type { -public: - Type(); - Type(Type const& type) = default; - Type& operator=(Type const&) = default; - Type(Type&& type) = default; - Type& operator=(Type&&) = default; - - /** The DWARF TAG of the type (e.g. DW_TAG_array_type) */ - int type; - Dwarf_Off id; /* Offset in the section (in hexadecimal form) */ - std::string name; /* Name of the type */ - int byte_size; /* Size in bytes */ - int element_count; /* Number of elements for array type */ - std::uint64_t type_id; /* DW_AT_type id */ - std::vector members; /* if DW_TAG_structure_type, DW_TAG_class_type, DW_TAG_union_type*/ - int is_pointer_type; - - // Location (for members) is either of: - simgrid::mc::DwarfExpression location_expression; - - simgrid::mc::Type* subtype; // DW_AT_type - simgrid::mc::Type* full_type; // The same (but more complete) type - - bool has_offset_location() const - { - return location_expression.size() == 1 && - location_expression[0].atom == DW_OP_plus_uconst; - } - - // TODO, check if this shortcut is really necessary - int offset() const - { - xbt_assert(this->has_offset_location()); - return this->location_expression[0].number; - } - - void offset(int new_offset) - { - Dwarf_Op op; - op.atom = DW_OP_plus_uconst; - op.number = new_offset; - this->location_expression = { op }; - } -}; - -} -} - -// ***** Object info - -namespace simgrid { -namespace mc { - -class Variable { -public: - Variable(); - - Dwarf_Off dwarf_offset; /* Global offset of the field. */ - int global; - std::string name; - std::uint64_t type_id; - simgrid::mc::Type* type; - - // Use either of: - simgrid::mc::LocationList location_list; - void* address; - - size_t start_scope; - simgrid::mc::ObjectInformation* object_info; -}; - -class Frame { -public: - Frame(); - - int tag; - std::string name; - void *low_pc; - void *high_pc; - simgrid::mc::LocationList frame_base; - std::vector variables; - unsigned long int id; /* DWARF offset of the subprogram */ - std::vector scopes; - Dwarf_Off abstract_origin_id; - simgrid::mc::ObjectInformation* object_info; -}; - -/** An entry in the functions index - * - * See the code of ObjectInformation::find_function. - */ -struct FunctionIndexEntry { - void* low_pc; - simgrid::mc::Frame* function; -}; - -/** Information about an (ELF) executable/sharedobject - * - * This contain sall the information we have at runtime about an - * executable/shared object in the target (modelchecked) process: - * - where it is located in the virtual address space; - * - where are located it's different memory mapping in the the - * virtual address space ; - * - all the debugging (DWARF) information, - * - location of the functions, - * - types - * - etc. - * - * It is not copyable because we are taking pointers to Types/Frames. - * We'd have to update/rebuild some data structures in order to copy - * successfully. - */ - -class ObjectInformation { -public: - ObjectInformation(); - - // Not copyable: - ObjectInformation(ObjectInformation const&) = delete; - ObjectInformation& operator=(ObjectInformation const&) = delete; - - // Flag: - static const int Executable = 1; - - /** Bitfield of flags */ - int flags; - std::string file_name; - const void* start; - const void *end; - char *start_exec; - char *end_exec; // Executable segment - char *start_rw; - char *end_rw; // Read-write segment - char *start_ro; - char *end_ro; // read-only segment - std::unordered_map subprograms; - // TODO, remove the mutable (to remove it we'll have to add a lot of const everywhere) - mutable std::vector global_variables; - std::unordered_map types; - std::unordered_map full_types_by_name; - - /** Index of functions by IP - * - * The entries are sorted by low_pc and a binary search can be used to look - * them up. Should we used a binary tree instead? - */ - std::vector functions_index; - - bool executable() const - { - return this->flags & simgrid::mc::ObjectInformation::Executable; - } - - bool privatized() const - { - return this->executable() && smpi_privatize_global_variables; - } - - void* base_address() const; - - simgrid::mc::Frame* find_function(const void *ip) const; - simgrid::mc::Variable* find_variable(const char* name) const; - -}; - -} -} - +#include "mc_memory_map.h" XBT_INTERNAL std::shared_ptr MC_find_object_info( std::vector const& maps, const char* name, int executable); @@ -213,6 +21,7 @@ XBT_INTERNAL void MC_post_process_object_info(simgrid::mc::Process* process, sim XBT_INTERNAL void MC_dwarf_get_variables(simgrid::mc::ObjectInformation* info); XBT_INTERNAL void MC_dwarf_get_variables_libdw(simgrid::mc::ObjectInformation* info); + XBT_INTERNAL const char* MC_dwarf_attrname(int attr); XBT_INTERNAL const char* MC_dwarf_tagname(int tag); diff --git a/src/mc/mc_process.cpp b/src/mc/mc_process.cpp index 2cc2b04d2c..c29ebcf795 100644 --- a/src/mc/mc_process.cpp +++ b/src/mc/mc_process.cpp @@ -29,13 +29,16 @@ #include "mc_process.h" #include "mc_object_info.h" -#include "AddressSpace.hpp" #include "mc_unw.h" #include "mc_snapshot.h" #include "mc_ignore.h" #include "mc_smx.h" #include "mc_server.h" +#include "mc/AddressSpace.hpp" +#include "mc/ObjectInformation.hpp" +#include "mc/Variable.hpp" + using simgrid::mc::remote; extern "C" { diff --git a/src/mc/mc_unw.cpp b/src/mc/mc_unw.cpp index 0d7830508a..899b4039e2 100644 --- a/src/mc/mc_unw.cpp +++ b/src/mc/mc_unw.cpp @@ -21,6 +21,7 @@ #include "mc_object_info.h" #include "mc_process.h" #include "mc_unw.h" +#include "mc/Frame.hpp" using simgrid::mc::remote; diff --git a/src/mc/mcer_ignore.cpp b/src/mc/mcer_ignore.cpp index 1de7873988..f1fc2a1b6a 100644 --- a/src/mc/mcer_ignore.cpp +++ b/src/mc/mcer_ignore.cpp @@ -13,6 +13,10 @@ #include "mc/mc_protocol.h" #include "mc/mc_client.h" +#include "mc/Frame.hpp" +#include "mc/Variable.hpp" +#include "mc/ObjectInformation.hpp" + extern "C" { XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mcer_ignore, mc, diff --git a/teshsuite/mc/dwarf/dwarf.cpp b/teshsuite/mc/dwarf/dwarf.cpp index 4bd2e89c0f..9aeec324b0 100644 --- a/teshsuite/mc/dwarf/dwarf.cpp +++ b/teshsuite/mc/dwarf/dwarf.cpp @@ -14,9 +14,14 @@ #include #include -#include "../../src/include/mc/datatypes.h" -#include "../../src/mc/mc_object_info.h" -#include "../../src/mc/mc_private.h" +#include "mc/datatypes.h" +#include "mc/mc_object_info.h" +#include "mc/mc_private.h" +#include "mc/mc_process.h" + +#include "mc/Type.hpp" +#include "mc/ObjectInformation.hpp" +#include "mc/Variable.hpp" int test_some_array[4][5][6]; struct some_struct { int first; int second[4][5]; } test_some_struct; diff --git a/teshsuite/mc/dwarf_expression/dwarf_expression.cpp b/teshsuite/mc/dwarf_expression/dwarf_expression.cpp index afd40aa3c7..b586d62c4d 100644 --- a/teshsuite/mc/dwarf_expression/dwarf_expression.cpp +++ b/teshsuite/mc/dwarf_expression/dwarf_expression.cpp @@ -12,8 +12,13 @@ #include #include -#include "../src/mc/mc_private.h" -#include "../src/mc/mc_object_info.h" +#include "mc/mc_process.h" +#include "mc/mc_private.h" +#include "mc/mc_object_info.h" + +#include "mc/Type.hpp" +#include "mc/ObjectInformation.hpp" +#include "mc/Variable.hpp" static simgrid::mc::Process* process; diff --git a/tools/generate-dwarf-functions b/tools/generate-dwarf-functions index fbb496a628..2164ff274c 100755 --- a/tools/generate-dwarf-functions +++ b/tools/generate-dwarf-functions @@ -12,6 +12,7 @@ cat - > src/mc/mc_dwarf_tagnames.cpp < +#include #include #include "mc_object_info.h" -- 2.20.1