Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / mc / mc_dwarf_expression.cpp
index 3e4d99e..7bf2335 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2014. The SimGrid Team.
+/* Copyright (c) 2014-2015. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* This program is free software; you can redistribute it and/or modify it
 
 #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;
 
@@ -34,10 +38,10 @@ static int mc_dwarf_push_value(mc_expression_state_t state, Dwarf_Off value)
  */
 static int mc_dwarf_register_to_libunwind(int dwarf_register)
 {
-#if defined(UNW_TARGET_X86_64)
+#if defined(__x86_64__)
   // It seems for this arch, DWARF and libunwind agree in the numbering:
   return dwarf_register;
-#elif defined(UNW_TARGET_X86)
+#elif defined(__i386__)
   // Could't find the authoritative source of information for this.
   // This is inspired from http://source.winehq.org/source/dlls/dbghelp/cpu_i386.c#L517.
   switch (dwarf_register) {
@@ -166,7 +170,7 @@ int mc_dwarf_execute_expression(size_t n, const Dwarf_Op * ops,
         unw_step(&cursor);
 
         unw_word_t res;
-        unw_get_reg(&cursor, UNW_TDEP_SP, &res);
+        unw_get_reg(&cursor, UNW_REG_SP, &res);
         error = mc_dwarf_push_value(state, res);
         break;
       }
@@ -430,10 +434,10 @@ int mc_dwarf_execute_expression(size_t n, const Dwarf_Op * ops,
  */
 void mc_dwarf_resolve_location(mc_location_t location,
                                simgrid::mc::DwarfExpression* expression,
-                               mc_object_info_t object_info,
+                               simgrid::mc::ObjectInformation* object_info,
                                unw_cursor_t * c,
                                void *frame_pointer_address,
-                               mc_address_space_t address_space, int process_index)
+                               simgrid::mc::AddressSpace* address_space, int process_index)
 {
   s_mc_expression_state_t state;
   memset(&state, 0, sizeof(s_mc_expression_state_t));
@@ -480,10 +484,10 @@ static simgrid::mc::DwarfExpression* mc_find_expression(
 
 void mc_dwarf_resolve_locations(mc_location_t location,
                                 simgrid::mc::LocationList* locations,
-                                mc_object_info_t object_info,
+                                simgrid::mc::ObjectInformation* object_info,
                                 unw_cursor_t * c,
                                 void *frame_pointer_address,
-                                mc_address_space_t address_space,
+                                simgrid::mc::AddressSpace* address_space,
                                 int process_index)
 {
 
@@ -508,7 +512,7 @@ void mc_dwarf_resolve_locations(mc_location_t location,
  *  \param frame
  *  \param unw_cursor
  */
-void *mc_find_frame_base(mc_frame_t frame, mc_object_info_t object_info,
+void *mc_find_frame_base(simgrid::mc::Frame* frame, simgrid::mc::ObjectInformation* object_info,
                          unw_cursor_t * unw_cursor)
 {
   s_mc_location_t location;
@@ -537,7 +541,7 @@ void *mc_find_frame_base(mc_frame_t frame, mc_object_info_t object_info,
 }
 
 void mc_dwarf_location_list_init(
-  simgrid::mc::LocationList* list, mc_object_info_t info,
+  simgrid::mc::LocationList* list, simgrid::mc::ObjectInformation* info,
   Dwarf_Die * die, Dwarf_Attribute * attr)
 {
   list->clear();