Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Step:15-SP4
gdb
gdb-symtab-refactor-condition-in-scan_attribute...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File gdb-symtab-refactor-condition-in-scan_attributes.patch of Package gdb
From 0bba1c5bdbcb404327ba4d5f35254b96d2e48108 Mon Sep 17 00:00:00 2001 From: Tom de Vries <tdevries@suse.de> Date: Mon, 11 Dec 2023 15:41:26 +0100 Subject: [PATCH 01/11] [gdb/symtab] Refactor condition in scan_attributes In scan_attributes there's code: ... if (new_reader->cu == reader->cu && new_info_ptr > watermark_ptr && *parent_entry == nullptr) ... else if (*parent_entry == nullptr) ... ... that uses the "*parent_entry == nullptr" condition twice. Make this somewhat more readable by factoring out the condition: ... if (*parent_entry == nullptr) { if (new_reader->cu == reader->cu && new_info_ptr > watermark_ptr) ... else ... } ... This also allows us to factor out "form_addr (origin_offset, origin_is_dwz)". Tested on x86_64-linux. --- gdb/dwarf2/read.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index 2339cceb829..00471d20d41 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -18315,15 +18315,17 @@ cooked_indexer::scan_attributes (dwarf2_per_cu_data *scanning_per_cu, const gdb_byte *new_info_ptr = (new_reader->buffer + to_underlying (origin_offset)); - if (new_reader->cu == reader->cu - && new_info_ptr > watermark_ptr - && *parent_entry == nullptr) - *maybe_defer = form_addr (origin_offset, origin_is_dwz); - else if (*parent_entry == nullptr) + if (*parent_entry == nullptr) { - CORE_ADDR lookup = form_addr (origin_offset, origin_is_dwz); - *parent_entry - = (cooked_index_entry *) m_die_range_map.find (lookup); + CORE_ADDR addr = form_addr (origin_offset, origin_is_dwz); + if (new_reader->cu == reader->cu + && new_info_ptr > watermark_ptr) + *maybe_defer = addr; + else + { + void *obj = m_die_range_map.find (addr); + *parent_entry = static_cast <cooked_index_entry *> (obj); + } } unsigned int bytes_read; base-commit: d445b7300b129a4886132ec31a23c7c2c894fa75 -- 2.35.3
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor