public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug symtab/17003] New: default_iterate_over_objfiles_in_search_order: broken code or broken comment?
@ 2014-05-30 20:45 dje at google dot com
  2023-03-04 18:47 ` [Bug symtab/17003] " tromey at sourceware dot org
  0 siblings, 1 reply; 2+ messages in thread
From: dje at google dot com @ 2014-05-30 20:45 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17003

            Bug ID: 17003
           Summary: default_iterate_over_objfiles_in_search_order: broken
                    code or broken comment?
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: symtab
          Assignee: unassigned at sourceware dot org
          Reporter: dje at google dot com

Which is right, the function comment or the implementation?
If I ignore both and go with what I think the default should be,
current_objfile should be searched first, and then we should iterate over all
objfiles (ignoring current_objfile - already searched).

objfiles.c:

/* The default implementation for the "iterate_over_objfiles_in_search_order"   
   gdbarch method.  It is equivalent to use the ALL_OBJFILES macro,             
   searching the objfiles in the order they are stored internally,              
   ignoring CURRENT_OBJFILE.                                                    

   On most platorms, it should be close enough to doing the best                
   we can without some knowledge specific to the architecture.  */

void
default_iterate_over_objfiles_in_search_order
  (struct gdbarch *gdbarch,
   iterate_over_objfiles_in_search_order_cb_ftype *cb,
   void *cb_data, struct objfile *current_objfile)
{
  int stop = 0;
  struct objfile *objfile;

  ALL_OBJFILES (objfile)
    {
       stop = cb (objfile, cb_data);
       if (stop)
         return;
    }
}

-- 
You are receiving this mail because:
You are on the CC list for the bug.


^ permalink raw reply	[flat|nested] 2+ messages in thread

* [Bug symtab/17003] default_iterate_over_objfiles_in_search_order: broken code or broken comment?
  2014-05-30 20:45 [Bug symtab/17003] New: default_iterate_over_objfiles_in_search_order: broken code or broken comment? dje at google dot com
@ 2023-03-04 18:47 ` tromey at sourceware dot org
  0 siblings, 0 replies; 2+ messages in thread
From: tromey at sourceware dot org @ 2023-03-04 18:47 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=17003

Tom Tromey <tromey at sourceware dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tromey at sourceware dot org

--- Comment #1 from Tom Tromey <tromey at sourceware dot org> ---
Windows starts with the current objfile, which makes the most sense to me.

So does Linux, I think, because it is using
svr4_iterate_over_objfiles_in_search_order.

I tend to think the default implementation should copy the windows one.
However, I don't know a good way to test this.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-03-04 18:47 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-05-30 20:45 [Bug symtab/17003] New: default_iterate_over_objfiles_in_search_order: broken code or broken comment? dje at google dot com
2023-03-04 18:47 ` [Bug symtab/17003] " tromey at sourceware dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).