X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/4b6ea22affbf2fb45a2e80779c789047121ceff6..1b8f849b45ded567cf10c7da022447a775270a0e:/src/mc/mc_location.h diff --git a/src/mc/mc_location.h b/src/mc/mc_location.h index 7f603281a8..06be71b1ed 100644 --- a/src/mc/mc_location.h +++ b/src/mc/mc_location.h @@ -1,4 +1,4 @@ -/* Copyright (c) 2004-2014. The SimGrid Team. +/* Copyright (c) 2004-2015. The SimGrid Team. * All rights reserved. */ /* This program is free software; you can redistribute it and/or modify it @@ -17,19 +17,18 @@ #include #include "mc_base.h" -#include "mc_forward.h" -#include "AddressSpace.hpp" +#include "mc_forward.hpp" +#include "mc/AddressSpace.hpp" +#include "mc/DwarfExpression.hpp" namespace simgrid { namespace mc { -typedef std::vector DwarfExpression; - /** \brief A DWARF expression with optional validity contraints */ class LocationListEntry { public: - DwarfExpression expression; + simgrid::dwarf::DwarfExpression expression; void* lowpc, *highpc; LocationListEntry() : lowpc(nullptr), highpc(nullptr) {} @@ -90,61 +89,35 @@ enum mc_location_type mc_get_location_type(mc_location_t location) { } } -XBT_INTERNAL void mc_dwarf_resolve_location( - mc_location_t location, simgrid::mc::DwarfExpression* expression, - mc_object_info_t object_info, unw_cursor_t* c, - void* frame_pointer_address, mc_address_space_t address_space, - int process_index); -MC_SHOULD_BE_INTERNAL void mc_dwarf_resolve_locations( - mc_location_t location, simgrid::mc::LocationList* locations, - mc_object_info_t object_info, unw_cursor_t* c, - void* frame_pointer_address, mc_address_space_t address_space, - int process_index); +SG_END_DECL() -XBT_INTERNAL void mc_dwarf_location_list_init( - simgrid::mc::LocationList*, mc_object_info_t info, Dwarf_Die* die, - Dwarf_Attribute* attr); +namespace simgrid { +namespace dwarf { -#define MC_EXPRESSION_STACK_SIZE 64 +XBT_PRIVATE void resolve_location( + mc_location_t location, simgrid::dwarf::DwarfExpression const& expression, + simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c, + void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, + int process_index); -#define MC_EXPRESSION_OK 0 -#define MC_EXPRESSION_E_UNSUPPORTED_OPERATION 1 -#define MC_EXPRESSION_E_STACK_OVERFLOW 2 -#define MC_EXPRESSION_E_STACK_UNDERFLOW 3 -#define MC_EXPRESSION_E_MISSING_STACK_CONTEXT 4 -#define MC_EXPRESSION_E_MISSING_FRAME_BASE 5 -#define MC_EXPRESSION_E_NO_BASE_ADDRESS 6 +} +} -typedef struct s_mc_expression_state { - uintptr_t stack[MC_EXPRESSION_STACK_SIZE]; - size_t stack_size; +SG_BEGIN_DECL() - unw_cursor_t* cursor; - void* frame_base; - mc_address_space_t address_space; - mc_object_info_t object_info; - int process_index; -} s_mc_expression_state_t, *mc_expression_state_t; +void mc_dwarf_resolve_locations( + mc_location_t location, simgrid::mc::LocationList* locations, + simgrid::mc::ObjectInformation* object_info, unw_cursor_t* c, + void* frame_pointer_address, simgrid::mc::AddressSpace* address_space, + int process_index); -MC_SHOULD_BE_INTERNAL int mc_dwarf_execute_expression( - size_t n, const Dwarf_Op* ops, mc_expression_state_t state); +XBT_PRIVATE void mc_dwarf_location_list_init( + simgrid::mc::LocationList*, simgrid::mc::ObjectInformation* info, Dwarf_Die* die, + Dwarf_Attribute* attr); -MC_SHOULD_BE_INTERNAL void* mc_find_frame_base( - mc_frame_t frame, mc_object_info_t object_info, unw_cursor_t* unw_cursor); +void* mc_find_frame_base( + simgrid::mc::Frame* frame, simgrid::mc::ObjectInformation* object_info, unw_cursor_t* unw_cursor); SG_END_DECL() -namespace simgrid { -namespace mc { - -inline -int execute(DwarfExpression const& expression, mc_expression_state_t state) -{ - return mc_dwarf_execute_expression( - expression.size(), expression.data(), state); -} - -} -} - #endif