X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;f=libdw%2Fdwarf_cu_getdwarf.c;fp=libdw%2Fmemory-access.c;h=f8a2e9b9cef71087c9cfa841b82b6a4ed57e4ff5;hb=a286dd013ef8d46edf013efc0908822a59d8ac81;hp=7666fb60a64c94fe529cebbe1f9e7bad6ca581af;hpb=18a667176dd196f7bc3a9cdf1cbd87d4c7b31c7f;p=platform%2Fupstream%2Felfutils.git diff --git a/libdw/memory-access.c b/libdw/dwarf_cu_getdwarf.c similarity index 68% rename from libdw/memory-access.c rename to libdw/dwarf_cu_getdwarf.c index 7666fb6..f8a2e9b 100644 --- a/libdw/memory-access.c +++ b/libdw/dwarf_cu_getdwarf.c @@ -1,5 +1,5 @@ -/* Out of line functions for memory-access.h macros. - Copyright (C) 2005, 2006 Red Hat, Inc. +/* Retrieve Dwarf descriptor underlying a Dwarf_CU. + Copyright (C) 2014 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -29,22 +29,19 @@ #ifdef HAVE_CONFIG_H # include #endif + +#include + #include "libdwP.h" -#include "memory-access.h" -uint64_t -internal_function -__libdw_get_uleb128 (uint64_t acc, unsigned int i, const unsigned char **addrp) -{ - unsigned char __b; - get_uleb128_rest_return (acc, i, addrp); -} -int64_t -internal_function -__libdw_get_sleb128 (int64_t acc, unsigned int i, const unsigned char **addrp) +Dwarf * +dwarf_cu_getdwarf (cu) + Dwarf_CU *cu; { - unsigned char __b; - int64_t _v = acc; - get_sleb128_rest_return (acc, i, addrp); + if (cu == NULL) + /* Some error occurred before. */ + return NULL; + + return cu->dbg; }