result->fake_loc_cu->version = 4;
result->fake_loc_cu->split = NULL;
eu_search_tree_init (&result->fake_loc_cu->locs_tree);
- rwlock_init (result->fake_loc_cu->abbrev_lock);
rwlock_init (result->fake_loc_cu->split_lock);
mutex_init (result->fake_loc_cu->src_lock);
mutex_init (result->fake_loc_cu->str_off_base_lock);
result->fake_loclists_cu->version = 5;
result->fake_loclists_cu->split = NULL;
eu_search_tree_init (&result->fake_loclists_cu->locs_tree);
- rwlock_init (result->fake_loclists_cu->abbrev_lock);
rwlock_init (result->fake_loclists_cu->split_lock);
mutex_init (result->fake_loclists_cu->src_lock);
mutex_init (result->fake_loclists_cu->str_off_base_lock);
result->fake_addr_cu->version = 5;
result->fake_addr_cu->split = NULL;
eu_search_tree_init (&result->fake_addr_cu->locs_tree);
- rwlock_init (result->fake_addr_cu->abbrev_lock);
rwlock_init (result->fake_addr_cu->split_lock);
mutex_init (result->fake_addr_cu->src_lock);
mutex_init (result->fake_addr_cu->str_off_base_lock);
Don't access directly, call __libdw_cu_locs_base. */
Dwarf_Off locs_base;
- /* Synchronize access to the abbrev member of a Dwarf_Die that
- refers to this Dwarf_CU. Covers __libdw_die_abbrev. */
- rwlock_define(, abbrev_lock);
-
/* Synchronize access to the split member of this Dwarf_CU.
Covers __libdw_find_split_unit. */
rwlock_define(, split_lock);
cu->unit_type);
}
-#define CUDIE(fromcu) \
- ((Dwarf_Die) \
- { \
- .cu = (fromcu), \
- .addr = ((char *) (fromcu)->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf \
- + __libdw_first_die_off_from_cu (fromcu)) \
- })
-
-#define SUBDIE(fromcu) \
- ((Dwarf_Die) \
- { \
- .cu = (fromcu), \
- .addr = ((char *) (fromcu)->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf \
- + (fromcu)->start + (fromcu)->subdie_offset) \
- })
-
-
/* Prototype of a single .debug_macro operator. */
typedef struct
{
__libdw_dieabbrev (Dwarf_Die *die, const unsigned char **readp)
{
if (unlikely (die->cu == NULL))
- {
- die->abbrev = DWARF_END_ABBREV;
- return DWARF_END_ABBREV;
- }
-
- rwlock_wrlock (die->cu->abbrev_lock);
+ return DWARF_END_ABBREV;
/* Do we need to get the abbreviation, or need to read after the code? */
if (die->abbrev == NULL || readp != NULL)
const unsigned char *addr = die->addr;
if (addr >= (const unsigned char *) die->cu->endp)
- {
- die->abbrev = DWARF_END_ABBREV;
- rwlock_unlock (die->cu->abbrev_lock);
- return DWARF_END_ABBREV;
- }
+ return DWARF_END_ABBREV;
get_uleb128 (code, addr, die->cu->endp);
if (readp != NULL)
*readp = addr;
- /* Find the abbreviation. */
+ /* Find the abbreviation. To improve performance, this write is not
+ protected by a lock. It should only be reachable by a single thread
+ when initializing the DIE. */
if (die->abbrev == NULL)
die->abbrev = __libdw_findabbrev (die->cu, code);
}
- Dwarf_Abbrev *result = die->abbrev;
- rwlock_unlock (die->cu->abbrev_lock);
-
- return result;
+ return die->abbrev;
}
/* Helper functions for form handling. */
return cu->sec_idx;
}
+static inline Dwarf_Die
+CUDIE (Dwarf_CU *fromcu)
+{
+ Dwarf_Die res = {0};
+ res.cu = fromcu;
+ res.addr = ((char *) (fromcu)->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf
+ + __libdw_first_die_off_from_cu (fromcu));
+ (void) dwarf_tag (&res); /* Set .abbrev */
+ return res;
+}
+
+static inline Dwarf_Die
+SUBDIE (Dwarf_CU *fromcu)
+{
+ Dwarf_Die res = {0};
+ res.cu = fromcu;
+ res.addr = ((char *) (fromcu)->dbg->sectiondata[cu_sec_idx (fromcu)]->d_buf
+ + (fromcu)->start + (fromcu)->subdie_offset);
+ (void) dwarf_tag (&res); /* Set .abbrev */
+ return res;
+}
+
static inline bool
is_cudie (Dwarf_Die *cudie)
{