-/* 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
#ifdef HAVE_CONFIG_H
# include <config.h>
#endif
+
+#include <stddef.h>
+
#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;
}