[lldb-dev] RFC: Namespaces in lldb

Abid, Hafiz Hafiz_Abid at mentor.com
Mon Mar 23 04:20:05 PDT 2015


Jim,
The initial developers of lldb-mi perhaps did not want to use the classes from
lldb_private inside lldb-mi. So in some cases, they sort of duplicated the code
for things like Mutex in lld-mi which are already available in host layer. If there
are no objections on using lldb_private inside lldb-mi then I can remove that
code duplication.

Regards,
Abid

> -----Original Message-----
> From: lldb-dev-bounces at cs.uiuc.edu [mailto:lldb-dev-bounces at cs.uiuc.edu]
> On Behalf Of jingham at apple.com
> Sent: 20 March 2015 11:58
> To: Tamas Berghammer
> Cc: lldb-dev at cs.uiuc.edu
> Subject: Re: [lldb-dev] RFC: Namespaces in lldb
> 
> My take:
> 
> Local classes that are in just in .cpp files should go in the anonymous
> namespace.  We didn't start out doing it that way, not all local classes
> follows this rule.  Thats just a bug, feel free to fix that wherever you come
> across it.  Everything else should be in lldb or lldb_private.  Anything that
> might be useful to for the SB API's but is also useful for core lldb should be
> in the lldb namespace.  Everything else should be in lldb_private.
> 
> I don't think we need to split it finer than that at present.  I don't see any
> reason to leave any classes in the global namespace, but again I think where
> we are doing that it is just because we didn't start out putting all our local
> classes in the anonymous namespace.
> 
> Jim
> 
> > On Mar 20, 2015, at 4:58 AM, Tamas Berghammer
> <tberghammer at google.com> wrote:
> >
> > Hi All,
> >
> > In lldb I see that most of the classes are leaving in the lldb or in the
> lldb_private namespace but we have some class in the global scope. What is
> the rule we want to use about placing our classes in namespaces? When we
> want to put a class into lldb, when we want to put it into lldb_private and
> when we want to leave it in the global scope (do we want to leave anything
> in the global namespace)?
> >
> > The current stage is that we have the classes in "lldb/API" and a few other
> files in the lldb namespace, a lot of thing in the lldb_private namespace and
> some class in the global namespace. As a first approximation I would suggest
> to keep the classes in "lldb/API" in the lldb namespace and everything else in
> lldb_private but it might not be sufficient in all cases.
> >
> > I think this issue doesn't cause us any major problem right now, so I don't
> plan to move every class to the proper namespace with a few commits but I
> hope we can make an agreement about what is the preferred location for
> the different classes and then make progress to move them to the right
> place (e.g.: when somebody do bigger changes to a class what is not in the
> correct namespace he/she can also move it to the right place).
> >
> > Tamas
> > _______________________________________________
> > lldb-dev mailing list
> > lldb-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev
> 
> 
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/lldb-dev




More information about the lldb-dev mailing list