Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sandra Loosemore <sandra@codesourcery.com>
To: Tom Tromey <tom@tromey.com>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH 3/3] Introduce a separate debug objfile iterator
Date: Fri, 03 May 2019 18:23:00 -0000	[thread overview]
Message-ID: <28398247-e959-c206-8ab0-1af1c6fa98cd@codesourcery.com> (raw)
In-Reply-To: <87ef5iyrjf.fsf@tromey.com>

[-- Attachment #1: Type: text/plain, Size: 683 bytes --]

On 5/1/19 12:10 PM, Tom Tromey wrote:
> 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.

I found one more use in ada-lang.c that you'd missed.  Things build with 
the attached version of the patch, but I haven't done any testing beyond 
that.

-Sandra

[-- Attachment #2: objfile.patch --]
[-- Type: text/x-patch, Size: 4945 bytes --]

diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c
index 1a56663..20fb349 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<program_space *, struct bp_location *> 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;
@@ -13231,7 +13231,7 @@ ada_exception_catchpoint_cond_string (const char *excep_string,
   excep_string = ada_encode (excep_string);
   std::vector<struct bound_minimal_symbol> symbols
     = ada_lookup_simple_minsyms (excep_string);
-  for (const struct bound_minimal_symbol &msym : symbols)
+  for (const bound_minimal_symbol &msym : symbols)
     {
       if (!result.empty ())
 	result += " or ";
diff --git a/gdb/darwin-nat.c b/gdb/darwin-nat.c
index 8282ef2..e3368ce 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 b0bdecf..b5ea9e3 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 8037329..9d29d88 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 1b0ea29..30823c2 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 927a285..5aa7105 100644
--- a/gdb/ser-tcp.c
+++ b/gdb/ser-tcp.c
@@ -319,7 +319,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 16e641a..0e1f7ea 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;
 

  reply	other threads:[~2019-05-03 18:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-09 18:11 [PATCH 0/3] some minor objfile iteration improvements Tom Tromey
2019-04-09 18:09 ` [PATCH 1/3] Remove some uses of "object_files" Tom Tromey
2019-04-10  1:49   ` Simon Marchi
2019-04-10  2:26     ` Tom Tromey
2019-04-10  2:50       ` Simon Marchi
2019-04-10 14:08         ` Tom Tromey
2019-04-09 18:09 ` [PATCH 3/3] Introduce a separate debug objfile iterator Tom Tromey
2019-04-10  2:01   ` Simon Marchi
2019-04-10 14:08     ` Tom Tromey
2019-04-30 15:44   ` Sandra Loosemore
2019-04-30 15:51     ` Tom Tromey
2019-05-01 18:30       ` Tom Tromey
2019-05-03 18:23         ` Sandra Loosemore [this message]
2019-05-03 23:28           ` Tom Tromey
2019-05-15  9:45             ` John Marshall
2019-05-15 15:45               ` Tom Tromey
2019-05-15 20:00                 ` John Marshall
2019-04-09 18:09 ` [PATCH 2/3] Fix a couple of comments Tom Tromey
2019-04-10  1:51   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=28398247-e959-c206-8ab0-1af1c6fa98cd@codesourcery.com \
    --to=sandra@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tom@tromey.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox