This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 3/3] Replace home-grown linked-lists in FreeBSD's native target with std::list.


On Tuesday, August 08, 2017 11:21:16 AM Simon Marchi wrote:
> Hi John,
> 
> > --- a/gdb/fbsd-nat.c
> > +++ b/gdb/fbsd-nat.c
> > @@ -40,6 +40,8 @@
> >  #include "elf-bfd.h"
> >  #include "fbsd-nat.h"
> > 
> > +#include <list>
> > +
> >  /* Return the name of a file that can be opened to get the symbols for
> >     the child process identified by PID.  */
> > 
> > @@ -711,13 +713,7 @@ fbsd_update_thread_list (struct target_ops *ops)
> >    sake.  FreeBSD versions newer than 9.1 contain both fixes.
> >  */
> > 
> > -struct fbsd_fork_info
> > -{
> > -  struct fbsd_fork_info *next;
> > -  ptid_t ptid;
> > -};
> > -
> > -static struct fbsd_fork_info *fbsd_pending_children;
> > +static std::list<ptid_t> fbsd_pending_children;
> 
> If you only need a singly linked list with push/pop at the front, you 
> can use std::forward_list.

Oh, yes, and the old list was a singly-linked list as well.

> Otherwise, LGTM.
> 
> Simon


-- 
John Baldwin


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]