Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Revert "[mc] Remove remaining bits of libdw outside of mc_libdw.{h,c}pp"
[simgrid.git] / src / mc / mc_location.h
index 76a2a26..289cb73 100644 (file)
@@ -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
 namespace simgrid {
 namespace mc {
 
-typedef std::vector<Dwarf_Op> DwarfExpression;
+typedef struct
+{
+  uint8_t atom;
+  std::uint64_t number;
+  std::uint64_t number2;
+  std::uint64_t offset;
+} DwarfInstruction;
 
+typedef std::vector<DwarfInstruction> DwarfExpression;
 
 /** \brief A DWARF expression with optional validity contraints */
 class LocationListEntry {
@@ -90,21 +97,17 @@ enum mc_location_type mc_get_location_type(mc_location_t location) {
   }
 }
 
-XBT_INTERNAL void mc_dwarf_resolve_location(
+XBT_PRIVATE void mc_dwarf_resolve_location(
   mc_location_t location, simgrid::mc::DwarfExpression* expression,
   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 void mc_dwarf_resolve_locations(
+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);
 
-XBT_INTERNAL void mc_dwarf_location_list_init(
-  simgrid::mc::LocationList*, simgrid::mc::ObjectInformation* info, Dwarf_Die* die,
-  Dwarf_Attribute* attr);
-
 #define MC_EXPRESSION_STACK_SIZE 64
 
 #define MC_EXPRESSION_OK 0
@@ -126,10 +129,10 @@ typedef struct s_mc_expression_state {
   int process_index;
 } s_mc_expression_state_t, *mc_expression_state_t;
 
-MC_SHOULD_BE_INTERNAL int mc_dwarf_execute_expression(
-  size_t n, const Dwarf_Op* ops, mc_expression_state_t state);
+int mc_dwarf_execute_expression(
+  size_t n, const simgrid::mc::DwarfInstruction* ops, mc_expression_state_t state);
 
-MC_SHOULD_BE_INTERNAL void* mc_find_frame_base(
+void* mc_find_frame_base(
   simgrid::mc::Frame* frame, simgrid::mc::ObjectInformation* object_info, unw_cursor_t* unw_cursor);
 
 SG_END_DECL()
@@ -137,7 +140,7 @@ SG_END_DECL()
 namespace simgrid {
 namespace mc {
 
-inline
+static inline
 int execute(DwarfExpression const& expression, mc_expression_state_t state)
 {
   return mc_dwarf_execute_expression(