From: Gabriel Corona Date: Thu, 20 Feb 2014 10:56:22 +0000 (+0100) Subject: [mc] Move mc_find_frame_base in mc_dwarf.c where it belongs X-Git-Tag: v3_11~199^2~2^2~24^2~3 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/9122d33957bd260d3d5296bc250674d9a4eb4d40?ds=sidebyside [mc] Move mc_find_frame_base in mc_dwarf.c where it belongs --- diff --git a/src/mc/mc_dwarf.c b/src/mc/mc_dwarf.c index 6b7959877d..3107c9d7ba 100644 --- a/src/mc/mc_dwarf.c +++ b/src/mc/mc_dwarf.c @@ -247,6 +247,31 @@ static dw_location_t MC_dwarf_get_location_list(mc_object_info_t info, Dwarf_Die } } +/** \brief Find the frame base of a given frame + * + * \param ip Instruction pointer + * \param frame + * \param unw_cursor + */ +void* mc_find_frame_base(void* ip, dw_frame_t frame, unw_cursor_t* unw_cursor) { + switch(frame->frame_base->type) { + case e_dw_loclist: + { + int loclist_cursor; + for(loclist_cursor=0; loclist_cursor < xbt_dynar_length(frame->frame_base->location.loclist); loclist_cursor++){ + dw_location_entry_t entry = xbt_dynar_get_as(frame->frame_base->location.loclist, loclist_cursor, dw_location_entry_t); + if((ip >= entry->lowpc) && (ip < entry->highpc)){ + return (void*) MC_dwarf_resolve_location(unw_cursor, entry->location, NULL); + } + } + return NULL; + } + // Not handled: + default: + return NULL; + } +} + /** \brief Get the location expression or location list from an attribute * * Processes direct expressions as well as location lists. diff --git a/src/mc/mc_hash.c b/src/mc/mc_hash.c index c46dc4a2f1..4e8c536f39 100644 --- a/src/mc/mc_hash.c +++ b/src/mc/mc_hash.c @@ -247,31 +247,6 @@ static void mc_hash_stack_frame( } } -/** \brief Find the frame base of a given frame - * - * \param ip Instruction pointer - * \param frame - * \param unw_cursor - */ -void* mc_find_frame_base(void* ip, dw_frame_t frame, unw_cursor_t* unw_cursor) { - switch(frame->frame_base->type) { - case e_dw_loclist: - { - int loclist_cursor; - for(loclist_cursor=0; loclist_cursor < xbt_dynar_length(frame->frame_base->location.loclist); loclist_cursor++){ - dw_location_entry_t entry = xbt_dynar_get_as(frame->frame_base->location.loclist, loclist_cursor, dw_location_entry_t); - if((ip >= entry->lowpc) && (ip < entry->highpc)){ - return (void*) MC_dwarf_resolve_location(unw_cursor, entry->location, NULL); - } - } - return NULL; - } - // Not handled: - default: - return NULL; - } -} - static void mc_hash_stack(mc_hash_t *hash, mc_snapshot_stack_t stack, mc_hashing_state* state) { unsigned cursor = 0;