[Lldb-commits] [PATCH] Move LLDB initialization / shutdown to Application

Zachary Turner zturner at google.com
Wed Mar 18 16:16:59 PDT 2015


Hi clayborg,

Move LLDB initialization/shutdown to Application.

This creates a new top-level folder called Application which is intended to hold code specific to using LLDB as an application.  Currently this holds the Initialize() and Terminate() functions,
as well as the fatal error handler.

This provides a means to break the massive dependency cycle which is caused by the fact that Debugger calls Initialize and Terminate which bring in the entire LLDB project.  So linking against Core forces a link against all of LLDB, instead of against just Core.

With the structure here, applications invoke lldb_private::Initialize() directly, and that invokes Debugger::Initialize.  This way Application depends on Debugger, but Debugger doesn't depend on Application.

I think this organization makes better sense anyway.  Having a bunch of functionality in source/lldb.cpp with an ambiguous name doesn't really make it clear how the functionality is related or what it is.  By creating an Application folder, it makes more sense that we can put other stuff in there which is of interest specifically to program startup and initialization.  There's probably some duplicated logic already between lldb-server, lldb, and other applications that link against LLDB which could be put here someday.

http://reviews.llvm.org/D8428

Files:
  cmake/LLDBDependencies.cmake
  include/lldb/Application/InitializeLLDB.h
  include/lldb/Core/Debugger.h
  include/lldb/Host/Host.h
  include/lldb/lldb-forward.h
  include/lldb/lldb-private-types.h
  include/lldb/lldb-private.h
  lldb.xcodeproj/project.pbxproj
  source/Application/CMakeLists.txt
  source/Application/InitializeLLDB.cpp
  source/Application/Makefile
  source/CMakeLists.txt
  source/Core/Debugger.cpp
  source/Host/common/Host.cpp
  source/Makefile
  source/lldb.cpp
  tools/lldb-server/lldb-server.cpp

EMAIL PREFERENCES
  http://reviews.llvm.org/settings/panel/emailpreferences/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D8428.22225.patch
Type: text/x-patch
Size: 43691 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20150318/aad549ea/attachment.bin>


More information about the lldb-commits mailing list