From patchwork Wed May 1 18:10:28 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Tromey X-Patchwork-Id: 32476 Received: (qmail 12356 invoked by alias); 1 May 2019 18:30:02 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 12273 invoked by uid 89); 1 May 2019 18:30:01 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-17.6 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS autolearn=ham version=3.3.1 spammy=routinely, H*f:sk:ee6c5cb, core_addr, minsyms.c X-HELO: gateway30.websitewelcome.com Received: from gateway30.websitewelcome.com (HELO gateway30.websitewelcome.com) (192.185.148.2) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 01 May 2019 18:29:59 +0000 Received: from cm13.websitewelcome.com (cm13.websitewelcome.com [100.42.49.6]) by gateway30.websitewelcome.com (Postfix) with ESMTP id 2C04CD89C for ; Wed, 1 May 2019 13:10:29 -0500 (CDT) Received: from box5379.bluehost.com ([162.241.216.53]) by cmsmtp with SMTP id Ltgbhm3Q3YTGMLtgbhqlTC; Wed, 01 May 2019 13:10:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=tromey.com; s=default; h=Content-Type:MIME-Version:Message-ID:In-Reply-To:Date: References:Subject:Cc:To:From:Sender:Reply-To:Content-Transfer-Encoding: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help:List-Unsubscribe: List-Subscribe:List-Post:List-Owner:List-Archive; bh=sx1Xor+vkprQF3P8siaE/PNN95VpdIXFFcO+nvJ0zjI=; b=Kic/rueZX+hoeuKitIBCd+Ud97 O22EydJ6yujohv4HvpKauPKtw19VgGpIilaRgp/xT2DOzk53v3qWRsP05t5+zPiYC3RTAPTGvswu0 WCrImVfQWAc+54N4utgmL3qKt; Received: from 97-122-168-123.hlrn.qwest.net ([97.122.168.123]:59422 helo=murgatroyd) by box5379.bluehost.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.91) (envelope-from ) id 1hLtga-001QPH-VO; Wed, 01 May 2019 13:10:29 -0500 From: Tom Tromey To: Tom Tromey Cc: Sandra Loosemore , Subject: Re: [PATCH 3/3] Introduce a separate debug objfile iterator References: <20190409180945.21621-1-tom@tromey.com> <20190409180945.21621-4-tom@tromey.com> <87a7g73306.fsf@tromey.com> Date: Wed, 01 May 2019 12:10:28 -0600 In-Reply-To: <87a7g73306.fsf@tromey.com> (Tom Tromey's message of "Tue, 30 Apr 2019 09:51:37 -0600") Message-ID: <87ef5iyrjf.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Sandra> FYI, this series of patches has broken builds with older versions of Sandra> GCC (we've got 5.2.1 installed on our build system here). Multiple Sandra> failures like: Tom> I think that's a bug in that version of gcc, but gdb has routinely Tom> worked around it in the past. [...] Tom> If you can send me a full list, I can send you a patch to test. I did a grep and came up with the appended. If you try it, and it works, I will check it in. thanks, Tom diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index 1a566635b2d..2b4445ee185 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -12483,7 +12483,7 @@ create_excep_cond_exprs (struct ada_catchpoint *c, because the expression may hold the addresses of multiple symbols in some cases. */ std::multimap loc_map; - for (struct bp_location *bl = c->loc; bl != NULL; bl = bl->next) + for (bp_location *bl = c->loc; bl != NULL; bl = bl->next) loc_map.emplace (bl->pspace, bl); scoped_restore_current_program_space save_pspace; diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c index 8282ef27e61..e3368ce6471 100644 --- a/gdb/darwin-nat.c +++ b/gdb/darwin-nat.c @@ -1706,7 +1706,7 @@ darwin_attach_pid (struct inferior *inf) static struct thread_info * thread_info_from_private_thread_info (darwin_thread_info *pti) { - for (struct thread_info *it : all_threads ()) + for (thread_info *it : all_threads ()) { darwin_thread_info *iter_pti = get_darwin_thread_info (it); diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index b0bdecf96fc..b5ea9e3cc0a 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -15962,7 +15962,7 @@ handle_struct_member_die (struct die_info *child_die, struct type *type, field for our sole member child. */ struct attribute *discr = dwarf2_attr (child_die, DW_AT_discr_value, cu); - for (struct die_info *variant_child = child_die->child; + for (die_info *variant_child = child_die->child; variant_child != NULL; variant_child = sibling_die (variant_child)) { diff --git a/gdb/minsyms.c b/gdb/minsyms.c index 8037329a862..9d29d880aab 100644 --- a/gdb/minsyms.c +++ b/gdb/minsyms.c @@ -721,7 +721,7 @@ lookup_minimal_symbol_by_pc_section (CORE_ADDR pc_in, struct obj_section *sectio gdb_assert (section != NULL); - for (struct objfile *objfile : section->objfile->separate_debug_objfiles ()) + for (objfile *objfile : section->objfile->separate_debug_objfiles ()) { CORE_ADDR pc = pc_in; diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 1b0ea29980d..30823c2d889 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -864,7 +864,7 @@ objfile_relocate (struct objfile *objfile, changed |= objfile_relocate1 (objfile, new_offsets); - for (struct objfile *debug_objfile : objfile->separate_debug_objfiles ()) + for (::objfile *debug_objfile : objfile->separate_debug_objfiles ()) { if (debug_objfile == objfile) continue; @@ -919,7 +919,7 @@ objfile_rebase (struct objfile *objfile, CORE_ADDR slide) { int changed = 0; - for (struct objfile *debug_objfile : objfile->separate_debug_objfiles ()) + for (::objfile *debug_objfile : objfile->separate_debug_objfiles ()) changed |= objfile_rebase1 (debug_objfile, slide); /* Relocate breakpoints as necessary, after things are relocated. */ @@ -960,7 +960,7 @@ objfile_has_full_symbols (struct objfile *objfile) int objfile_has_symbols (struct objfile *objfile) { - for (struct objfile *o : objfile->separate_debug_objfiles ()) + for (::objfile *o : objfile->separate_debug_objfiles ()) if (objfile_has_partial_symbols (o) || objfile_has_full_symbols (o)) return 1; return 0; diff --git a/gdb/ser-tcp.c b/gdb/ser-tcp.c index 039b0432231..6ba95107918 100644 --- a/gdb/ser-tcp.c +++ b/gdb/ser-tcp.c @@ -323,7 +323,7 @@ net_open (struct serial *scb, const char *name) { got_connrefused = false; - for (struct addrinfo *iter = ainfo; iter != NULL; iter = iter->ai_next) + for (addrinfo *iter = ainfo; iter != NULL; iter = iter->ai_next) { /* Iterate over the list of possible addresses to connect to. For each, we'll try to connect and see if it diff --git a/gdb/symtab.c b/gdb/symtab.c index 16e641a830b..0e1f7ead294 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2246,7 +2246,7 @@ lookup_global_symbol_from_objfile (struct objfile *main_objfile, const char *name, const domain_enum domain) { - for (struct objfile *objfile : main_objfile->separate_debug_objfiles ()) + for (objfile *objfile : main_objfile->separate_debug_objfiles ()) { struct block_symbol result = lookup_symbol_in_objfile (objfile, GLOBAL_BLOCK, name, domain); @@ -2333,7 +2333,7 @@ lookup_symbol_in_objfile_from_linkage_name (struct objfile *objfile, else main_objfile = objfile; - for (struct objfile *cur_objfile : main_objfile->separate_debug_objfiles ()) + for (::objfile *cur_objfile : main_objfile->separate_debug_objfiles ()) { struct block_symbol result;