Re: [Lldb-commits] [PATCH] D48049: Add a new SBTarget::LoadCore() overload which surfaces errors if the load fails

2018-06-12 Thread Pavel Labath via lldb-commits
On Mon, 11 Jun 2018 at 22:00, Leonard Mosescu via lldb-commits
 wrote:
>>
>> remove space before (
>
>
> I'd be happy to make the change, but looking at the rest of the file it seems 
> that almost everything uses the opposite convention: Foo (...).
>

I guess that's because the .i files escaped the Great Clang Format. We
should probably reformat them manually.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I like the idea of centralizing the framework code as much as possible. 
However, I am not sure how the dependency management fits into this. More 
details in inline comments.




Comment at: CMakeLists.txt:46
+  if (NOT APPLE)
+message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting 
Apple platforms")
+  endif()

`LLDB.framework can only be generated when targeting Apple platforms` avoids 
double negation



Comment at: cmake/modules/LLDBFramework.cmake:1
+if (LLDB_BUILD_FRAMEWORK)
+  add_custom_target(lldb-framework)

Maybe use early exit here?



Comment at: cmake/modules/LLDBFramework.cmake:45
+
+  add_dependencies(lldb-framework liblldb lldb-argdumper lldb-server 
lldb-framework-headers)
+  add_dependencies(finish_swig lldb-framework)

Maybe lldb-argdumper and lldb-server dependencies should be handled as a part 
of INCLUDE_IN_FRAMEWORK argument to add_lldb_executable? Or do you have other 
plans for that?



Comment at: cmake/modules/LLDBFramework.cmake:46-47
+  add_dependencies(lldb-framework liblldb lldb-argdumper lldb-server 
lldb-framework-headers)
+  add_dependencies(finish_swig lldb-framework)
+  add_dependencies(lldb lldb-framework)
+endif()

It seems a bit weird for a target to manage it's own outgoing dependencies. 
Maybe you could define another dummy target here (`liblldb-suite`?) which would 
depend on lldb-framework or liblldb depending on the build type. Then lldb and 
finish_swig could just always depend on that.


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 150913.
apolyakov added a comment.

Some readability improvements(more comments). I think that we should keep 
`StepOver` signature as

  void StepOver(SBError &error, lldb::RunMode stop_other_threads);

since it seems that in SBThread methods SBError paramater is the last 
non-optional one, as @aprantl said.


https://reviews.llvm.org/D47991

Files:
  include/lldb/API/SBThread.h
  scripts/interface/SBThread.i
  source/API/SBThread.cpp

Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -632,7 +632,14 @@
   return sb_error;
 }
 
-void SBThread::StepOver(lldb::RunMode stop_other_threads) {
+void SBThread::StepOver(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
+  SBError error; // Ignored
+  StepOver(error, stop_other_threads);
+}
+
+void SBThread::StepOver(SBError &error, lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -662,23 +669,25 @@
   }
 }
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
-  }
+error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  } else error.SetErrorString("this SBThread object is invalid");
 }
 
-void SBThread::StepInto(lldb::RunMode stop_other_threads) {
+void SBThread::StepInto(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   StepInto(NULL, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name,
-lldb::RunMode stop_other_threads) {
-  SBError error;
+lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping*/) {
+  SBError error; // Ignored
   StepInto(target_name, LLDB_INVALID_LINE_NUMBER, error, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name, uint32_t end_line,
-SBError &error, lldb::RunMode stop_other_threads) {
+SBError &error, lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -722,10 +731,15 @@
 }
 
 error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
-  }
+  } else error.SetErrorString("this SBThread object is invalid");
 }
 
 void SBThread::StepOut() {
+  SBError error; // Ignored
+  StepOut(error);
+}
+
+void SBThread::StepOut(SBError &error) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -746,12 +760,16 @@
 abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
 eVoteNoOpinion, 0, avoid_no_debug));
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
-  }
+error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  } else error.SetErrorString("this SBThread object is invalid");
+}
+
+void SBThread::StepOutOfFrame(SBFrame &sb_frame) {
+  SBError error; // Ignored
+  StepOutOfFrame(sb_frame, error);
 }
 
-void SBThread::StepOutOfFrame(lldb::SBFrame &sb_frame) {
+void SBThread::StepOutOfFrame(SBFrame &sb_frame, SBError &error) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -789,12 +807,16 @@
 abort_other_plans, NULL, false, stop_other_threads, eVoteYes,
 eVoteNoOpinion, frame_sp->GetFrameIndex()));
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
-  }
+error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  } else error.SetErrorString("this SBThread object is invalid");
 }
 
 void SBThread::StepInstruction(bool step_over) {
+  SBError error; // Ignored
+  StepInstruction(step_over, error);
+}
+
+void SBThread::StepInstruction(bool step_over, SBError &error) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -809,12 +831,16 @@
 ThreadPlanSP new_plan_sp(
 thread->QueueThreadPlanForStepSingleInstruction(step_over, true, true));
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
-  }
+error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  } else error.SetErrorString("this SBThread object is invalid");
 }
 
 void SBThread::RunToAddress(lldb::addr_t addr) {
+  SBError error; // Ignored
+  RunToAddress(addr, error);
+}
+
+void SBThread::RunToAddress(lldb::addr_t addr, SBError &error) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -835,9 +861,8 @@
 ThreadPlanSP new_plan_sp(thread->QueueThreadPlanForRunToAddress(
 abort_other_plans, target_addr, stop_other_thread

[Lldb-commits] [lldb] r334496 - lit/SymbolFile/DWARF: Simplify test RUN lines

2018-06-12 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jun 12 05:43:55 2018
New Revision: 334496

URL: http://llvm.org/viewvc/llvm-project?rev=334496&view=rev
Log:
lit/SymbolFile/DWARF: Simplify test RUN lines

Use -mllvm compiler argument to enable DWARF v5 accelerator tables
instead of piping the IR through llc.

Modified:
lldb/trunk/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp
lldb/trunk/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-type.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-basic-variable.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-function-regex.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-method.cpp

Modified: lldb/trunk/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp?rev=334496&r1=334495&r2=334496&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dwarf5-index-is-used.cpp Tue Jun 12 
05:43:55 2018
@@ -2,8 +2,7 @@
 
 // REQUIRES: lld
 
-// RUN: clang %s -g -c -emit-llvm -o - --target=x86_64-pc-linux | \
-// RUN:   llc -accel-tables=Dwarf -filetype=obj -o %t.o
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Dwarf
 // RUN: ld.lld %t.o -o %t
 // RUN: lldb-test symbols %t | FileCheck %s
 

Modified: lldb/trunk/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp?rev=334496&r1=334495&r2=334496&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/dwarf5-partial-index.cpp Tue Jun 12 
05:43:55 2018
@@ -3,10 +3,8 @@
 
 // REQUIRES: lld
 
-// RUN: clang %s -g -c -emit-llvm -o - --target=x86_64-pc-linux -DONE | \
-// RUN:   llc -accel-tables=Dwarf -filetype=obj -o %t-1.o
-// RUN: clang %s -g -c -emit-llvm -o - --target=x86_64-pc-linux -DTWO | \
-// RUN:   llc -accel-tables=Disable -filetype=obj -o %t-2.o
+// RUN: clang %s -g -c -o %t-1.o --target=x86_64-pc-linux -DONE -mllvm 
-accel-tables=Dwarf
+// RUN: clang %s -g -c -o %t-2.o --target=x86_64-pc-linux -DTWO -mllvm 
-accel-tables=Dwarf
 // RUN: ld.lld %t-1.o %t-2.o -o %t
 // RUN: lldb-test symbols --find=variable --name=foo  %t | FileCheck %s
 

Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp?rev=334496&r1=334495&r2=334496&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-function.cpp Tue Jun 12 05:43:55 
2018
@@ -1,6 +1,6 @@
 // REQUIRES: lld
 
-// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Disable
 // RUN: ld.lld %t.o -o %t
 // RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t 
| \
 // RUN:   FileCheck --check-prefix=BASE %s
@@ -29,8 +29,7 @@
 // RUN: lldb-test symbols --name=not_there --find=function %t | \
 // RUN:   FileCheck --check-prefix=EMPTY %s
 
-// RUN: clang %s -g -c -emit-llvm -o - --target=x86_64-pc-linux | \
-// RUN:   llc -accel-tables=Dwarf -filetype=obj -o %t.o
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Dwarf
 // RUN: ld.lld %t.o -o %t
 // RUN: lldb-test symbols --name=foo --find=function --function-flags=base %t 
| \
 // RUN:   FileCheck --check-prefix=BASE %s

Modified: lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp?rev=334496&r1=334495&r2=334496&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-basic-namespace.cpp Tue Jun 12 
05:43:55 2018
@@ -1,6 +1,6 @@
 // REQUIRES: lld
 
-// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Disable
 // RUN: ld.lld %t.o -o %t
 // RUN: lldb-test symbols --name=foo --find=namespace %t | \
 // RUN:   FileCheck --check-prefix=FOO %s
@@ -17,8 +17,7 @@
 // RUN: lldb-test symbols --name=not_there --find=namespace %t | \
 // RUN:   FileCheck --check-prefix=EMPTY %s
 
-// RUN: clang %s -g -c -emit-llvm -o - --target=x86_64-pc-linux | \
-// RUN:   llc -accel-tables=Dwarf -filetype=obj -o %t.o
+// RUN: clang %s -g -c -o %t.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Dwarf
 // RUN: ld.lld %t.o -o %t
 // RU

[Lldb-commits] [lldb] r334498 - lldb-test symbols: Add -file argument and the ability to dump global variables in a file

2018-06-12 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jun 12 05:57:36 2018
New Revision: 334498

URL: http://llvm.org/viewvc/llvm-project?rev=334498&view=rev
Log:
lldb-test symbols: Add -file argument and the ability to dump global variables 
in a file

The motivation for this is to be able to Dwarf index ability to look up
variables within a given compilation unit. It also fits in with the
patch in progress at D47939, which will add the ability to look up
funtions using file+line pairs.

The verification of which lldb-test options can be used together was
getting a bit unwieldy, so I moved the logic out into a separate
function.

Added:
lldb/trunk/lit/SymbolFile/DWARF/Inputs/
lldb/trunk/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp
lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp
Modified:
lldb/trunk/lit/lit.cfg
lldb/trunk/tools/lldb-test/lldb-test.cpp

Added: lldb/trunk/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp?rev=334498&view=auto
==
--- lldb/trunk/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp (added)
+++ lldb/trunk/lit/SymbolFile/DWARF/Inputs/find-variable-file-2.cpp Tue Jun 12 
05:57:36 2018
@@ -0,0 +1,3 @@
+namespace two {
+int foo;
+}

Added: lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp?rev=334498&view=auto
==
--- lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp (added)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp Tue Jun 12 05:57:36 
2018
@@ -0,0 +1,20 @@
+// REQUIRES: lld
+
+// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux %s
+// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux 
%S/Inputs/find-variable-file-2.cpp
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
+// RUN:   FileCheck --check-prefix=ONE %s
+// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | 
\
+// RUN:   FileCheck --check-prefix=TWO %s
+
+// ONE: Found 1 variables:
+namespace one {
+int foo;
+// ONE-DAG: name = "foo", type = {{.*}} (int), {{.*}} decl = 
find-variable-file.cpp:[[@LINE-1]]
+} // namespace one
+
+extern "C" void _start() {}
+
+// TWO: Found 1 variables:
+// TWO-DAG: name = "foo", {{.*}} decl = find-variable-file-2.cpp:2

Modified: lldb/trunk/lit/lit.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.cfg?rev=334498&r1=334497&r2=334498&view=diff
==
--- lldb/trunk/lit/lit.cfg (original)
+++ lldb/trunk/lit/lit.cfg Tue Jun 12 05:57:36 2018
@@ -28,6 +28,8 @@ config.test_format = lit.formats.ShTest(
 # suffixes: We only support unit tests
 config.suffixes = []
 
+config.excludes = ['Inputs']
+
 # test_source_root: The root path where tests are located.
 config.test_source_root = os.path.dirname(__file__)
 

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=334498&r1=334497&r2=334498&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Tue Jun 12 05:57:36 2018
@@ -148,6 +148,10 @@ static FunctionNameType getFunctionNameF
 static cl::opt Verify("verify", cl::desc("Verify symbol information."),
 cl::sub(SymbolsSubcommand));
 
+static cl::opt File("file",
+ cl::desc("File (compile unit) to search."),
+ cl::sub(SymbolsSubcommand));
+
 static Expected getDeclContext(SymbolVendor &Vendor);
 
 static Error findFunctions(lldb_private::Module &Module);
@@ -157,6 +161,7 @@ static Error findVariables(lldb_private:
 static Error dumpModule(lldb_private::Module &Module);
 static Error verify(lldb_private::Module &Module);
 
+static Expected getAction();
 static int dumpSymbols(Debugger &Dbg);
 }
 
@@ -197,6 +202,13 @@ int evaluateMemoryMapCommands(Debugger &
 
 } // namespace opts
 
+template 
+static Error make_string_error(const char *Format, Args &&... args) {
+  return llvm::make_error(
+  llvm::formatv(Format, std::forward(args)...).str(),
+  llvm::inconvertibleErrorCode());
+}
+
 TargetSP opts::createTarget(Debugger &Dbg, const std::string &Filename) {
   TargetSP Target;
   Status ST =
@@ -312,14 +324,10 @@ opts::symbols::getDeclContext(SymbolVend
 return CompilerDeclContext();
   VariableList List;
   Vendor.FindGlobalVariables(ConstString(Context), nullptr, UINT32_MAX, List);
-  if (List.Empty()) {
-return make_error("Context search didn't find a match.",
-   inconvertibleErrorCode())

[Lldb-commits] [lldb] r334500 - DWARFDebugNames: Implement last GetGlobalVariables overload

2018-06-12 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jun 12 06:11:25 2018
New Revision: 334500

URL: http://llvm.org/viewvc/llvm-project?rev=334500&view=rev
Log:
DWARFDebugNames: Implement last GetGlobalVariables overload

This function implements the search for all global variables within a
given compilation unit.

Modified:
lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h

Modified: lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp?rev=334500&r1=334499&r2=334500&view=diff
==
--- lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp (original)
+++ lldb/trunk/lit/SymbolFile/DWARF/find-variable-file.cpp Tue Jun 12 06:11:25 
2018
@@ -1,7 +1,15 @@
 // REQUIRES: lld
 
-// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux %s
-// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux 
%S/Inputs/find-variable-file-2.cpp
+// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Disable %s
+// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Disable %S/Inputs/find-variable-file-2.cpp
+// RUN: ld.lld %t-1.o %t-2.o -o %t
+// RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
+// RUN:   FileCheck --check-prefix=ONE %s
+// RUN: lldb-test symbols --file=find-variable-file-2.cpp --find=variable %t | 
\
+// RUN:   FileCheck --check-prefix=TWO %s
+
+// RUN: clang -g -c -o %t-1.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Dwarf %s
+// RUN: clang -g -c -o %t-2.o --target=x86_64-pc-linux -mllvm 
-accel-tables=Dwarf %S/Inputs/find-variable-file-2.cpp
 // RUN: ld.lld %t-1.o %t-2.o -o %t
 // RUN: lldb-test symbols --file=find-variable-file.cpp --find=variable %t | \
 // RUN:   FileCheck --check-prefix=ONE %s

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp?rev=334500&r1=334499&r2=334500&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp Tue Jun 
12 06:11:25 2018
@@ -123,6 +123,28 @@ void DebugNamesDWARFIndex::GetGlobalVari
   }
 }
 
+void DebugNamesDWARFIndex::GetGlobalVariables(const DWARFUnit &cu,
+  DIEArray &offsets) {
+  m_fallback.GetGlobalVariables(cu, offsets);
+
+  uint64_t cu_offset = cu.GetOffset();
+  for (const DebugNames::NameIndex &ni: *m_debug_names_up) {
+for (DebugNames::NameTableEntry nte: ni) {
+  uint32_t entry_offset = nte.getEntryOffset();
+  llvm::Expected entry_or = ni.getEntry(&entry_offset);
+  for (; entry_or; entry_or = ni.getEntry(&entry_offset)) {
+if (entry_or->tag() != DW_TAG_variable)
+  continue;
+if (entry_or->getCUOffset() != cu_offset)
+  continue;
+
+Append(*entry_or, offsets);
+  }
+  MaybeLogLookupError(entry_or.takeError(), ni, nte.getString());
+}
+  }
+}
+
 void DebugNamesDWARFIndex::GetTypes(ConstString name, DIEArray &offsets) {
   m_fallback.GetTypes(name, offsets);
 

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h?rev=334500&r1=334499&r2=334500&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h Tue Jun 
12 06:11:25 2018
@@ -28,7 +28,7 @@ public:
   void GetGlobalVariables(ConstString basename, DIEArray &offsets) override;
   void GetGlobalVariables(const RegularExpression ®ex,
   DIEArray &offsets) override;
-  void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override {}
+  void GetGlobalVariables(const DWARFUnit &cu, DIEArray &offsets) override;
   void GetObjCMethods(ConstString class_name, DIEArray &offsets) override {}
   void GetCompleteObjCClass(ConstString class_name, bool 
must_be_implementation,
 DIEArray &offsets) override {}


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334501 - Fix build error introduced in r334498

2018-06-12 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jun 12 06:26:43 2018
New Revision: 334501

URL: http://llvm.org/viewvc/llvm-project?rev=334501&view=rev
Log:
Fix build error introduced in r334498

Some gcc versions (circa 4.9) do not accept initializing Expected
objects containing a reference to a function from a function.

Change the Expected object to contain function pointers to work around
this.

Modified:
lldb/trunk/tools/lldb-test/lldb-test.cpp

Modified: lldb/trunk/tools/lldb-test/lldb-test.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-test/lldb-test.cpp?rev=334501&r1=334500&r2=334501&view=diff
==
--- lldb/trunk/tools/lldb-test/lldb-test.cpp (original)
+++ lldb/trunk/tools/lldb-test/lldb-test.cpp Tue Jun 12 06:26:43 2018
@@ -161,7 +161,7 @@ static Error findVariables(lldb_private:
 static Error dumpModule(lldb_private::Module &Module);
 static Error verify(lldb_private::Module &Module);
 
-static Expected getAction();
+static Expected getAction();
 static int dumpSymbols(Debugger &Dbg);
 }
 
@@ -494,7 +494,7 @@ Error opts::symbols::verify(lldb_private
   return Error::success();
 }
 
-Expected opts::symbols::getAction() {
+Expected opts::symbols::getAction() {
   if (Verify) {
 if (Find != FindType::None)
   return make_string_error(


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modulemap to lldb include directory

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor planned changes to this revision.
teemperor added a comment.

It seems the compilation fails on OS X with this modulemap (or any modulemap). 
The reason seems to be that on OS X we compile Obj-C++ as part of lldb which 
assumes that Clang/LLVM is valid Obj-C++. However, the Obj-C parsing code in 
Clang is *not* valid Obj-C++ as some parts of the code use variables named like 
`IBAction` for describing, well, `IBAction` in Obj-C.

So we either try to disable modules for the Obj-C++ code or we make Clang's 
source code Obj-C++ compatible.


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Hmm.. @lemo 's reasoning




Comment at: scripts/interface/SBThread.i:257
+%feature("autodoc",
+"Do a instruction level single step in the currently selected thread.
+") StepInstruction;

a -> an



Comment at: source/API/SBThread.cpp:703
 
   if (exe_ctx.HasThreadScope()) {
 bool abort_other_plans = false;

Please always prefer early exits 
(https://www.llvm.org/docs/CodingStandards.html#use-early-exits-and-continue-to-simplify-code)

```
if (!exe_ctx.HasThreadScope())
  return error.SetErrorString("SBThread object is invalid");
```



Comment at: source/API/SBThread.cpp:752
 
   if (exe_ctx.HasThreadScope()) {
 bool abort_other_plans = false;

same here



Comment at: source/API/SBThread.cpp:1148
   bool result = false;
   if (exe_ctx.HasThreadScope()) {
 Process::StopLocker stop_locker;

and here.


https://reviews.llvm.org/D47991



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Adrian Prantl via lldb-commits


> On Jun 12, 2018, at 9:08 AM, Adrian Prantl via Phabricator 
>  wrote:
> 
> aprantl added a comment.
> 
> Hmm.. @lemo 's reasoning

What I was going to say here: Just from looking at the API documentation, it 
looks like default arguments are mapped into Python by SWIG, so there doesn't 
seem to be an additional cost to having default arguments. But maybe I'm 
missing something.

-- adrian
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334516 - DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes method

2018-06-12 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Jun 12 09:50:01 2018
New Revision: 334516

URL: http://llvm.org/viewvc/llvm-project?rev=334516&view=rev
Log:
DebugNamesDWARFIndex: Implement DWARFDeclContext variant of GetTypes method

This method is used to find complete definitions of a type when one
parses a compile unit with only forward declaration available.

Since it is only accessed from DWARFASTParserClang, it was not
possible/easy to trigger this codepath from lldb-test. Therefore, I
adapt add a debug-names variant to an existing dotest test to cover this
scenario.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py?rev=334516&r1=334515&r2=334516&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/lang/c/forward/TestForwardDeclaration.py
 Tue Jun 12 09:50:01 2018
@@ -7,6 +7,7 @@ import os
 import time
 import lldb
 from lldbsuite.test.lldbtest import *
+from lldbsuite.test.decorators import *
 import lldbsuite.test.lldbutil as lldbutil
 
 
@@ -14,9 +15,9 @@ class ForwardDeclarationTestCase(TestBas
 
 mydir = TestBase.compute_mydir(__file__)
 
-def test_and_run_command(self):
+def do_test(self, dictionary=None):
 """Display *bar_ptr when stopped on a function with forward 
declaration of struct bar."""
-self.build()
+self.build(dictionary=dictionary)
 exe = self.getBuildArtifact("a.out")
 self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
 
@@ -53,3 +54,15 @@ class ForwardDeclarationTestCase(TestBas
 '(bar)',
 '(int) a = 1',
 '(int) b = 2'])
+
+def test(self):
+self.do_test()
+
+@no_debug_info_test
+@skipIfDarwin
+@skipIf(compiler=no_match("clang"))
+@skipIf(compiler_version=["<", "7.0"])
+def test_debug_names(self):
+"""Test that we are able to find complete types when using DWARF v5
+accelerator tables"""
+self.do_test(dict(CFLAGS_EXTRAS="-mllvm -accel-tables=Dwarf"))

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp?rev=334516&r1=334515&r2=334516&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp Tue Jun 
12 09:50:01 2018
@@ -9,6 +9,7 @@
 
 #include "Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h"
 #include "Plugins/SymbolFile/DWARF/DWARFDebugInfo.h"
+#include "Plugins/SymbolFile/DWARF/DWARFDeclContext.h"
 #include "Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h"
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/Utility/Stream.h"
@@ -154,6 +155,17 @@ void DebugNamesDWARFIndex::GetTypes(Cons
   Append(entry, offsets);
   }
 }
+
+void DebugNamesDWARFIndex::GetTypes(const DWARFDeclContext &context,
+DIEArray &offsets) {
+  m_fallback.GetTypes(context, offsets);
+
+  for (const DebugNames::Entry &entry :
+   m_debug_names_up->equal_range(context[0].name)) {
+if (entry.tag() == context[0].tag)
+  Append(entry, offsets);
+  }
+}
 
 void DebugNamesDWARFIndex::GetNamespaces(ConstString name, DIEArray &offsets) {
   m_fallback.GetNamespaces(name, offsets);

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h?rev=334516&r1=334515&r2=334516&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.h Tue Jun 
12 09:50:01 2018
@@ -33,7 +33,7 @@ public:
   void GetCompleteObjCClass(ConstString class_name, bool 
must_be_implementation,
 DIEArray &offsets) override {}
   void GetTypes(ConstString name, DIEArray &offsets) override;
-  void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override {}
+  void GetTypes(const DWARFDeclContext &context, DIEArray &offsets) override;
   void GetNamespaces(ConstString name, DIEArray &offsets) override;
   void GetFunctions(ConstString name, DWARFDebugInfo &info,
 const CompilerDeclContext &parent_decl_ctx,

[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, zturner, clayborg, davide.
Herald added subscribers: arichardson, emaste.
Herald added a reviewer: espindola.

With the recent changes in FileSpec to use LLVM's path style, it is
possible to delegate a bunch of common path operations to LLVM's path
implementation. This means we only have to maintain a single
implementation and can benefit from the efforts of the rest of the LLVM
community.

This is part one of a set of patches. There was no obvious way to split
this so I just worked from top to bottom.


Repository:
  rL LLVM

https://reviews.llvm.org/D48084

Files:
  include/lldb/Utility/FileSpec.h
  source/Core/Debugger.cpp
  source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
  source/Plugins/Platform/Android/PlatformAndroid.cpp
  source/Plugins/Platform/MacOSX/PlatformDarwinKernel.cpp
  source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Utility/FileSpec.cpp
  unittests/Utility/FileSpecTest.cpp

Index: unittests/Utility/FileSpecTest.cpp
===
--- unittests/Utility/FileSpecTest.cpp
+++ unittests/Utility/FileSpecTest.cpp
@@ -30,6 +30,16 @@
   EXPECT_EQ(nullptr, fs_posix_root.GetDirectory().GetCString());
   EXPECT_STREQ("/", fs_posix_root.GetFilename().GetCString());
 
+  FileSpec fs_net_drive("//net", false, FileSpec::Style::posix);
+  EXPECT_STREQ("//net", fs_net_drive.GetCString());
+  EXPECT_EQ(nullptr, fs_net_drive.GetDirectory().GetCString());
+  EXPECT_STREQ("//net", fs_net_drive.GetFilename().GetCString());
+
+  FileSpec fs_net_root("//net/", false, FileSpec::Style::posix);
+  EXPECT_STREQ("//net/", fs_net_root.GetCString());
+  EXPECT_STREQ("//net", fs_net_root.GetDirectory().GetCString());
+  EXPECT_STREQ("/", fs_net_root.GetFilename().GetCString());
+
   FileSpec fs_windows_drive("F:", false, FileSpec::Style::windows);
   EXPECT_STREQ("F:", fs_windows_drive.GetCString());
   EXPECT_EQ(nullptr, fs_windows_drive.GetDirectory().GetCString());
@@ -281,7 +291,6 @@
 "/a/b",
 "/a/b/",
 "//",
-"//a",
 "//a/",
 "//a/b",
 "//a/b/",
Index: source/Utility/FileSpec.cpp
===
--- source/Utility/FileSpec.cpp
+++ source/Utility/FileSpec.cpp
@@ -15,9 +15,9 @@
 #include "llvm/ADT/SmallString.h" // for SmallString
 #include "llvm/ADT/SmallVector.h" // for SmallVectorTemplat...
 #include "llvm/ADT/StringRef.h"
-#include "llvm/ADT/Triple.h" // for Triple
-#include "llvm/ADT/Twine.h"  // for Twine
-#include "llvm/Support/ErrorOr.h"// for ErrorOr
+#include "llvm/ADT/Triple.h"  // for Triple
+#include "llvm/ADT/Twine.h"   // for Twine
+#include "llvm/Support/ErrorOr.h" // for ErrorOr
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/Program.h"
 #include "llvm/Support/raw_ostream.h" // for raw_ostream, fs
@@ -50,7 +50,7 @@
 }
 
 const char *GetPathSeparators(FileSpec::Style style) {
-  return PathStyleIsPosix(style) ? "/" : "\\/";
+  return llvm::sys::path::get_separator(style).data();
 }
 
 char GetPreferredPathSeparator(FileSpec::Style style) {
@@ -67,30 +67,6 @@
 
   std::replace(path.begin(), path.end(), '/', '\\');
 }
-  
-bool PathIsRelative(llvm::StringRef path, FileSpec::Style style) {
-  
-  if (path.empty())
-return false;
-
-  if (PathStyleIsPosix(style)) {
-// If the path doesn't start with '/' or '~', return true
-switch (path[0]) {
-  case '/':
-  case '~':
-return false;
-  default:
-return true;
-}
-  } else {
-if (path.size() >= 2 && path[1] == ':')
-  return false;
-if (path[0] == '/')
-  return false;
-return true;
-  }
-  return false;
-}
 
 } // end anonymous namespace
 
@@ -239,7 +215,7 @@
   return false;
 }
 
-  
+
 }
 //--
 // Assignment operator.
@@ -259,11 +235,15 @@
 // up into a directory and filename and stored as uniqued string values for
 // quick comparison and efficient memory usage.
 //--
-void FileSpec::SetFile(llvm::StringRef pathname, bool resolve, Style style) {
+void FileSpec::SetFile(llvm::StringRef pathname, bool resolve,
+   llvm::Optional

[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Zachary Turner via Phabricator via lldb-commits
zturner accepted this revision.
zturner added a comment.
This revision is now accepted and ready to land.

Looks like good cleanup to me, thanks!




Comment at: 
source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp:2593-2596
+if (::strcmp(extension.GetCString(), ".py") == 0)
   basename.resize(basename.length() - 3);
-else if (::strcmp(extension.GetCString(), "pyc") == 0)
+else if (::strcmp(extension.GetCString(), ".pyc") == 0)
   basename.resize(basename.length() - 4);

Can you change these `strcmp` operations to `StringRef` calls?  Might as well 
do some cleanup if we're here anyway.


Repository:
  rL LLVM

https://reviews.llvm.org/D48084



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334518 - Refactor ExecuteAndWait to take StringRefs.

2018-06-12 Thread Zachary Turner via lldb-commits
Author: zturner
Date: Tue Jun 12 10:43:52 2018
New Revision: 334518

URL: http://llvm.org/viewvc/llvm-project?rev=334518&view=rev
Log:
Refactor ExecuteAndWait to take StringRefs.

This simplifies some code which had StringRefs to begin with, and
makes other code more complicated which had const char* to begin
with.

In the end, I think this makes for a more idiomatic and platform
agnostic API.  Not all platforms launch process with null terminated
c-string arrays for the environment pointer and argv, but the api
was designed that way because it allowed easy pass-through for
posix-based platforms.  There's a little additional overhead now
since on posix based platforms we'll be takign StringRefs which
were constructed from null terminated strings and then copying
them to null terminate them again, but from a readability and
usability standpoint of the API user, I think this API signature
is strictly better.

Modified:
lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp

Modified: lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp?rev=334518&r1=334517&r2=334518&view=diff
==
--- lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp (original)
+++ lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp Tue Jun 12 
10:43:52 2018
@@ -61,11 +61,12 @@ TEST_F(ObjectFileELFTest, SectionsResolv
   "sections-resolve-consistently-%%", "obj", obj));
 
   llvm::FileRemover remover(obj);
-  const char *args[] = {YAML2OBJ, yaml.c_str(), nullptr};
+  llvm::StringRef args[] = {YAML2OBJ, yaml};
   llvm::StringRef obj_ref = obj;
   const llvm::Optional redirects[] = {llvm::None, obj_ref,
llvm::None};
-  ASSERT_EQ(0, llvm::sys::ExecuteAndWait(YAML2OBJ, args, nullptr, redirects));
+  ASSERT_EQ(0,
+llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects));
   uint64_t size;
   ASSERT_NO_ERROR(llvm::sys::fs::file_size(obj, size));
   ASSERT_GT(size, 0u);

Modified: lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp?rev=334518&r1=334517&r2=334518&view=diff
==
--- lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp (original)
+++ lldb/trunk/unittests/Symbol/TestDWARFCallFrameInfo.cpp Tue Jun 12 10:43:52 
2018
@@ -96,11 +96,12 @@ void DWARFCallFrameInfoTest::TestBasic(D
   "basic-call-frame-info-%%", "obj", obj));
   llvm::FileRemover obj_remover(obj);
 
-  const char *args[] = {YAML2OBJ, yaml.c_str(), nullptr};
+  llvm::StringRef args[] = {YAML2OBJ, yaml};
   llvm::StringRef obj_ref = obj;
   const llvm::Optional redirects[] = {llvm::None, obj_ref,
llvm::None};
-  ASSERT_EQ(0, llvm::sys::ExecuteAndWait(YAML2OBJ, args, nullptr, redirects));
+  ASSERT_EQ(0,
+llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects));
 
   uint64_t size;
   ASSERT_NO_ERROR(llvm::sys::fs::file_size(obj, size));


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 150983.
apolyakov added a comment.

Added early exits.


https://reviews.llvm.org/D47991

Files:
  include/lldb/API/SBThread.h
  scripts/interface/SBThread.i
  source/API/SBThread.cpp

Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -632,7 +632,14 @@
   return sb_error;
 }
 
-void SBThread::StepOver(lldb::RunMode stop_other_threads) {
+void SBThread::StepOver(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
+  SBError error; // Ignored
+  StepOver(error, stop_other_threads);
+}
+
+void SBThread::StepOver(SBError &error, lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -643,42 +650,46 @@
 static_cast(exe_ctx.GetThreadPtr()),
 Thread::RunModeAsCString(stop_other_threads));
 
-  if (exe_ctx.HasThreadScope()) {
-Thread *thread = exe_ctx.GetThreadPtr();
-bool abort_other_plans = false;
-StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-
-ThreadPlanSP new_plan_sp;
-if (frame_sp) {
-  if (frame_sp->HasDebugInformation()) {
-const LazyBool avoid_no_debug = eLazyBoolCalculate;
-SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-new_plan_sp = thread->QueueThreadPlanForStepOverRange(
-abort_other_plans, sc.line_entry, sc, stop_other_threads,
-avoid_no_debug);
-  } else {
-new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
-true, abort_other_plans, stop_other_threads);
-  }
-}
+  if (!exe_ctx.HasThreadScope()) {
+error.SetErrorString("this SBThread object is invalid");
+return;
+  }
+
+  Thread *thread = exe_ctx.GetThreadPtr();
+  bool abort_other_plans = false;
+  StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  ThreadPlanSP new_plan_sp;
+  if (frame_sp) {
+if (frame_sp->HasDebugInformation()) {
+  const LazyBool avoid_no_debug = eLazyBoolCalculate;
+  SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+  new_plan_sp = thread->QueueThreadPlanForStepOverRange(
+  abort_other_plans, sc.line_entry, sc, stop_other_threads,
+  avoid_no_debug);
+} else {
+  new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
+  true, abort_other_plans, stop_other_threads);
+}
   }
+  error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
 }
 
-void SBThread::StepInto(lldb::RunMode stop_other_threads) {
+void SBThread::StepInto(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   StepInto(NULL, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name,
-lldb::RunMode stop_other_threads) {
-  SBError error;
+lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping*/) {
+  SBError error; // Ignored
   StepInto(target_name, LLDB_INVALID_LINE_NUMBER, error, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name, uint32_t end_line,
-SBError &error, lldb::RunMode stop_other_threads) {
+SBError &error, lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -691,41 +702,48 @@
 target_name ? target_name : "",
 Thread::RunModeAsCString(stop_other_threads));
 
-  if (exe_ctx.HasThreadScope()) {
-bool abort_other_plans = false;
-
-Thread *thread = exe_ctx.GetThreadPtr();
-StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-ThreadPlanSP new_plan_sp;
+  if (!exe_ctx.HasThreadScope()) {
+error.SetErrorString("this SBThread object is invalid");
+return;
+  }
 
-if (frame_sp && frame_sp->HasDebugInformation()) {
-  SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-  AddressRange range;
-  if (end_line == LLDB_INVALID_LINE_NUMBER)
-range = sc.line_entry.range;
-  else {
-if (!sc.GetAddressRangeFromHereToEndLine(end_line, range, error.ref()))
-  return;
-  }
+  bool abort_other_plans = false;
 
-  const LazyBool step_out_avoids_code_without_debug_info =
-  eLazyBoolCalculate;
-  const LazyBool step_in_avoids_code_without_debug_info =
-  eLazyBoolCalculate;
-  new_plan_sp = thread->QueueThreadPlanForStepInRange(
-  abort_other_plans, range, sc, target_name, stop_other_threads,
-  step_in_avoids_code_without_debug_info,
-

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

I agree with Leonard, for the StepOver overload that returns errors, just make 
the mode parameter required.  That will reduce confusion.


https://reviews.llvm.org/D47991



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments.



Comment at: source/API/SBThread.cpp:1136
   bool result = false;
   if (exe_ctx.HasThreadScope()) {
 Process::StopLocker stop_locker;

@aprantl do you think that we should use early exit here? There is printing to 
log at the end of the function, so in case of early exit, we must duplicate 
`log->Printf()`. Is it worth it?


https://reviews.llvm.org/D47991



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added inline comments.



Comment at: cmake/modules/LLDBFramework.cmake:1
+if (LLDB_BUILD_FRAMEWORK)
+  add_custom_target(lldb-framework)

labath wrote:
> Maybe use early exit here?
Sounds good



Comment at: cmake/modules/LLDBFramework.cmake:45
+
+  add_dependencies(lldb-framework liblldb lldb-argdumper lldb-server 
lldb-framework-headers)
+  add_dependencies(finish_swig lldb-framework)

labath wrote:
> Maybe lldb-argdumper and lldb-server dependencies should be handled as a part 
> of INCLUDE_IN_FRAMEWORK argument to add_lldb_executable? Or do you have other 
> plans for that?
One of the goals I had in centralizing the framework generation code would be 
to centralize and make explicit which tools went into the framework. The idea I 
had was to get rid of the INCLUDE_IN_FRAMEWORK argument to add_lldb_executable. 
Since add_lldb_executable builds the binary differently when building for the 
framework (modifying the rpath, changing the output destination and symlinking 
it to your build tree's bin dir), it should be sufficient just to check for 
LLDB_BUILD_FRAMEWORK.

What do you think of this?



Comment at: cmake/modules/LLDBFramework.cmake:46-47
+  add_dependencies(lldb-framework liblldb lldb-argdumper lldb-server 
lldb-framework-headers)
+  add_dependencies(finish_swig lldb-framework)
+  add_dependencies(lldb lldb-framework)
+endif()

labath wrote:
> It seems a bit weird for a target to manage it's own outgoing dependencies. 
> Maybe you could define another dummy target here (`liblldb-suite`?) which 
> would depend on lldb-framework or liblldb depending on the build type. Then 
> lldb and finish_swig could just always depend on that.
I think that dummy target is a great idea! I was playing around with that idea, 
but I never thought of as succinctly as you put it. This should make dependency 
management a bit cleaner.

Oh and `liblldb-suite` is a great name. I had trouble thinking of a good name 
for a target like that.


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

> I agree with Leonard, for the StepOver overload that returns errors, just 
> make the mode parameter required. That will reduce confusion.

Works for me, too.




Comment at: source/API/SBThread.cpp:1136
   bool result = false;
   if (exe_ctx.HasThreadScope()) {
 Process::StopLocker stop_locker;

apolyakov wrote:
> @aprantl do you think that we should use early exit here? There is printing 
> to log at the end of the function, so in case of early exit, we must 
> duplicate `log->Printf()`. Is it worth it?
Duplicating the log message is probably not worth it.



Comment at: source/API/SBThread.cpp:1141
   result = true;
 } else {
   if (log)

It looks like the error string should be set here as well?



Comment at: source/API/SBThread.cpp:1146
 }
-  }
+  } else error.SetErrorString("this SBThread object is invalid");
   if (log)

I think clang-format would do this as:

```
} else
   error.SetErrorString("this SBThread object is invalid");
```



Comment at: source/API/SBThread.cpp:1171
 } else {
   if (log)
 log->Printf("SBThread(%p)::Resume() => error: process is running",

same here.



Comment at: source/API/SBThread.cpp:1179
 static_cast(exe_ctx.GetThreadPtr()), result);
   return result;
 }

Looking at the implementation of SBThread::Resume and SBThread::Suspend, the 
only difference seems to be the API called and the log message. If there is a 
third command with a similar implementation, it might be a fun exercise to 
factor that out into a helper function that takes std::function<> and a log 
string argument...


https://reviews.llvm.org/D47991



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: cmake/modules/LLDBFramework.cmake:45
+
+  add_dependencies(lldb-framework liblldb lldb-argdumper lldb-server 
lldb-framework-headers)
+  add_dependencies(finish_swig lldb-framework)

xiaobai wrote:
> labath wrote:
> > Maybe lldb-argdumper and lldb-server dependencies should be handled as a 
> > part of INCLUDE_IN_FRAMEWORK argument to add_lldb_executable? Or do you 
> > have other plans for that?
> One of the goals I had in centralizing the framework generation code would be 
> to centralize and make explicit which tools went into the framework. The idea 
> I had was to get rid of the INCLUDE_IN_FRAMEWORK argument to 
> add_lldb_executable. Since add_lldb_executable builds the binary differently 
> when building for the framework (modifying the rpath, changing the output 
> destination and symlinking it to your build tree's bin dir), it should be 
> sufficient just to check for LLDB_BUILD_FRAMEWORK.
> 
> What do you think of this?
Both of the approaches sound reasonable to me. If you want to go this way, then 
I'm fine with that.


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: source/Utility/FileSpec.cpp:244-246
+  // Only update style if explicitly requested.
+  if (style)
+m_style = (*style == Style::native) ? GetNativeStyle() : *style;

I don't really have a clear opinion on whether the new behaviour here is better 
or not, but it any case this sounds like something worth explicitly calling out.



Comment at: unittests/Utility/FileSpecTest.cpp:284
 "//",
-"//a",
 "//a/",

Any particular reason for removing this?


Repository:
  rL LLVM

https://reviews.llvm.org/D48084



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 150996.
apolyakov added a comment.

Added `StepOver` overload without optional parameters.


https://reviews.llvm.org/D47991

Files:
  include/lldb/API/SBThread.h
  scripts/interface/SBThread.i
  source/API/SBThread.cpp

Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -632,7 +632,13 @@
   return sb_error;
 }
 
-void SBThread::StepOver(lldb::RunMode stop_other_threads) {
+void SBThread::StepOver(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
+  SBError error; // Ignored
+  StepOver(stop_other_threads, error);
+}
+
+void SBThread::StepOver(lldb::RunMode stop_other_threads, SBError &error) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -643,42 +649,46 @@
 static_cast(exe_ctx.GetThreadPtr()),
 Thread::RunModeAsCString(stop_other_threads));
 
-  if (exe_ctx.HasThreadScope()) {
-Thread *thread = exe_ctx.GetThreadPtr();
-bool abort_other_plans = false;
-StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-
-ThreadPlanSP new_plan_sp;
-if (frame_sp) {
-  if (frame_sp->HasDebugInformation()) {
-const LazyBool avoid_no_debug = eLazyBoolCalculate;
-SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-new_plan_sp = thread->QueueThreadPlanForStepOverRange(
-abort_other_plans, sc.line_entry, sc, stop_other_threads,
-avoid_no_debug);
-  } else {
-new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
-true, abort_other_plans, stop_other_threads);
-  }
-}
+  if (!exe_ctx.HasThreadScope()) {
+error.SetErrorString("this SBThread object is invalid");
+return;
+  }
+
+  Thread *thread = exe_ctx.GetThreadPtr();
+  bool abort_other_plans = false;
+  StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  ThreadPlanSP new_plan_sp;
+  if (frame_sp) {
+if (frame_sp->HasDebugInformation()) {
+  const LazyBool avoid_no_debug = eLazyBoolCalculate;
+  SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+  new_plan_sp = thread->QueueThreadPlanForStepOverRange(
+  abort_other_plans, sc.line_entry, sc, stop_other_threads,
+  avoid_no_debug);
+} else {
+  new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
+  true, abort_other_plans, stop_other_threads);
+}
   }
+  error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
 }
 
-void SBThread::StepInto(lldb::RunMode stop_other_threads) {
+void SBThread::StepInto(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   StepInto(NULL, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name,
-lldb::RunMode stop_other_threads) {
-  SBError error;
+lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping*/) {
+  SBError error; // Ignored
   StepInto(target_name, LLDB_INVALID_LINE_NUMBER, error, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name, uint32_t end_line,
-SBError &error, lldb::RunMode stop_other_threads) {
+SBError &error, lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -691,41 +701,48 @@
 target_name ? target_name : "",
 Thread::RunModeAsCString(stop_other_threads));
 
-  if (exe_ctx.HasThreadScope()) {
-bool abort_other_plans = false;
+  if (!exe_ctx.HasThreadScope()) {
+error.SetErrorString("this SBThread object is invalid");
+return;
+  }
 
-Thread *thread = exe_ctx.GetThreadPtr();
-StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-ThreadPlanSP new_plan_sp;
+  bool abort_other_plans = false;
 
-if (frame_sp && frame_sp->HasDebugInformation()) {
-  SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-  AddressRange range;
-  if (end_line == LLDB_INVALID_LINE_NUMBER)
-range = sc.line_entry.range;
-  else {
-if (!sc.GetAddressRangeFromHereToEndLine(end_line, range, error.ref()))
-  return;
-  }
-
-  const LazyBool step_out_avoids_code_without_debug_info =
-  eLazyBoolCalculate;
-  const LazyBool step_in_avoids_code_without_debug_info =
-  eLazyBoolCalculate;
-  new_plan_sp = thread->QueueThreadPlanForStepInRange(
-  abort_other_plans, range, sc, target_name, stop_other_threads,
-  step_in_avoids_code_without_debug_info,
-  step_out_avoids_code_without_debu

[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov added inline comments.



Comment at: source/API/SBThread.cpp:816
+error.SetErrorString("passed a frame from another thread");
+return;
   }

I found this place and added `return`.


https://reviews.llvm.org/D47991



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: source/Utility/FileSpec.cpp:244-246
+  // Only update style if explicitly requested.
+  if (style)
+m_style = (*style == Style::native) ? GetNativeStyle() : *style;

labath wrote:
> I don't really have a clear opinion on whether the new behaviour here is 
> better or not, but it any case this sounds like something worth explicitly 
> calling out.
As far as the FileSpec class is concerned this doesn't change anything, we were 
always explicitly passing the m_style argument which is now implicit. To me 
this seems strictly better than what is was, were you might accidentally end up 
with the host path. 

I'll add a comment in the header.



Comment at: unittests/Utility/FileSpecTest.cpp:284
 "//",
-"//a",
 "//a/",

labath wrote:
> Any particular reason for removing this?
Yup, llvm doesn't consider `C:` or `//net` to be absolute paths (as opposed to 
`C:\` or `//net/`. While this is debatable, it makes things consistent with 
drive names on Windows, which is why I added the net tests above. 


Repository:
  rL LLVM

https://reviews.llvm.org/D48084



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47991: Improve SBThread's stepping API using SBError parameter.

2018-06-12 Thread Alexander Polyakov via Phabricator via lldb-commits
apolyakov updated this revision to Diff 151000.
apolyakov added a comment.

Minor update: moved `error.SetErrorString` to the top of `if` statement to 
increase readability.


https://reviews.llvm.org/D47991

Files:
  include/lldb/API/SBThread.h
  scripts/interface/SBThread.i
  source/API/SBThread.cpp

Index: source/API/SBThread.cpp
===
--- source/API/SBThread.cpp
+++ source/API/SBThread.cpp
@@ -632,7 +632,13 @@
   return sb_error;
 }
 
-void SBThread::StepOver(lldb::RunMode stop_other_threads) {
+void SBThread::StepOver(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
+  SBError error; // Ignored
+  StepOver(stop_other_threads, error);
+}
+
+void SBThread::StepOver(lldb::RunMode stop_other_threads, SBError &error) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -643,42 +649,46 @@
 static_cast(exe_ctx.GetThreadPtr()),
 Thread::RunModeAsCString(stop_other_threads));
 
-  if (exe_ctx.HasThreadScope()) {
-Thread *thread = exe_ctx.GetThreadPtr();
-bool abort_other_plans = false;
-StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-
-ThreadPlanSP new_plan_sp;
-if (frame_sp) {
-  if (frame_sp->HasDebugInformation()) {
-const LazyBool avoid_no_debug = eLazyBoolCalculate;
-SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-new_plan_sp = thread->QueueThreadPlanForStepOverRange(
-abort_other_plans, sc.line_entry, sc, stop_other_threads,
-avoid_no_debug);
-  } else {
-new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
-true, abort_other_plans, stop_other_threads);
-  }
-}
+  if (!exe_ctx.HasThreadScope()) {
+error.SetErrorString("this SBThread object is invalid");
+return;
+  }
+
+  Thread *thread = exe_ctx.GetThreadPtr();
+  bool abort_other_plans = false;
+  StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
 
-// This returns an error, we should use it!
-ResumeNewPlan(exe_ctx, new_plan_sp.get());
+  ThreadPlanSP new_plan_sp;
+  if (frame_sp) {
+if (frame_sp->HasDebugInformation()) {
+  const LazyBool avoid_no_debug = eLazyBoolCalculate;
+  SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
+  new_plan_sp = thread->QueueThreadPlanForStepOverRange(
+  abort_other_plans, sc.line_entry, sc, stop_other_threads,
+  avoid_no_debug);
+} else {
+  new_plan_sp = thread->QueueThreadPlanForStepSingleInstruction(
+  true, abort_other_plans, stop_other_threads);
+}
   }
+  error = ResumeNewPlan(exe_ctx, new_plan_sp.get());
 }
 
-void SBThread::StepInto(lldb::RunMode stop_other_threads) {
+void SBThread::StepInto(lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   StepInto(NULL, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name,
-lldb::RunMode stop_other_threads) {
-  SBError error;
+lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping*/) {
+  SBError error; // Ignored
   StepInto(target_name, LLDB_INVALID_LINE_NUMBER, error, stop_other_threads);
 }
 
 void SBThread::StepInto(const char *target_name, uint32_t end_line,
-SBError &error, lldb::RunMode stop_other_threads) {
+SBError &error, lldb::RunMode stop_other_threads
+/* = lldb::eOnlyDuringStepping */) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_API));
 
   std::unique_lock lock;
@@ -691,41 +701,48 @@
 target_name ? target_name : "",
 Thread::RunModeAsCString(stop_other_threads));
 
-  if (exe_ctx.HasThreadScope()) {
-bool abort_other_plans = false;
+  if (!exe_ctx.HasThreadScope()) {
+error.SetErrorString("this SBThread object is invalid");
+return;
+  }
 
-Thread *thread = exe_ctx.GetThreadPtr();
-StackFrameSP frame_sp(thread->GetStackFrameAtIndex(0));
-ThreadPlanSP new_plan_sp;
+  bool abort_other_plans = false;
 
-if (frame_sp && frame_sp->HasDebugInformation()) {
-  SymbolContext sc(frame_sp->GetSymbolContext(eSymbolContextEverything));
-  AddressRange range;
-  if (end_line == LLDB_INVALID_LINE_NUMBER)
-range = sc.line_entry.range;
-  else {
-if (!sc.GetAddressRangeFromHereToEndLine(end_line, range, error.ref()))
-  return;
-  }
-
-  const LazyBool step_out_avoids_code_without_debug_info =
-  eLazyBoolCalculate;
-  const LazyBool step_in_avoids_code_without_debug_info =
-  eLazyBoolCalculate;
-  new_plan_sp = thread->QueueThreadPlanForStepInRange(
-  abort_other_plans, range, sc, target_name, stop_other_threads,
-  step_in_avoids_code_without_debug_info,
-

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151004.
teemperor retitled this revision from "Add modulemap to lldb include directory" 
to "Add modules support for lldb headers in include/".
teemperor edited the summary of this revision.
teemperor added a comment.
This revision is now accepted and ready to land.
Herald added a subscriber: mgorny.

- All Obj-C files are now in their own subdirectory. This way we can filter out 
the modules flags for them.


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objc/CMakeLists.txt
  source/Host/macosx/objc/Host.mm
  source/Host/macosx/objc/HostInfoMacOSX.mm
  source/Host/macosx/objc/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objc/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objc/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objc/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objc/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjC
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objc)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjC")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objc/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objc/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjC
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely
+# not) and we would have rebuild a second set of modules just for the few
+# Obj-C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[\\S]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objc)
+set(LLDBObjCLibs lldbHostMacOSXObjC)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${L

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added inline comments.



Comment at: include/lldb/module.modulemap:66
+// This big module is necessary to work around the cyclic dependencies
+// between its submodules.
+module lldb {

teemperor wrote:
> bruno wrote:
> > Will this trick be enough for local submodules visibility mode as well? 
> From my (very limited) experience with disabled local submodule visibility I 
> would say yes, but I can't test it on my current system (compilation already 
> fails at the first LLVM module without LSV).
It seems to work!


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added inline comments.



Comment at: source/Utility/FileSpec.cpp:244-246
+  // Only update style if explicitly requested.
+  if (style)
+m_style = (*style == Style::native) ? GetNativeStyle() : *style;

JDevlieghere wrote:
> labath wrote:
> > I don't really have a clear opinion on whether the new behaviour here is 
> > better or not, but it any case this sounds like something worth explicitly 
> > calling out.
> As far as the FileSpec class is concerned this doesn't change anything, we 
> were always explicitly passing the m_style argument which is now implicit. To 
> me this seems strictly better than what is was, were you might accidentally 
> end up with the host path. 
> 
> I'll add a comment in the header.
Yes, but the counterargument to that is: since you're replacing the old 
filespec with a completely unrelated path, who's to say that the old path 
syntax is any better fit than "host".

I think it would be best here to actually make this argument mandatory and 
force everyone to think about the correct syntax when constructing the object, 
but maybe that's a change for another day.



Comment at: unittests/Utility/FileSpecTest.cpp:284
 "//",
-"//a",
 "//a/",

JDevlieghere wrote:
> labath wrote:
> > Any particular reason for removing this?
> Yup, llvm doesn't consider `C:` or `//net` to be absolute paths (as opposed 
> to `C:\` or `//net/`. While this is debatable, it makes things consistent 
> with drive names on Windows, which is why I added the net tests above. 
Ah, I see.. I can certainly understand why `c:` wouldn't be considered 
absolute, but I'm not sure the same thing applies to `//net`. However, I think 
I can live that interpretation right now..


Repository:
  rL LLVM

https://reviews.llvm.org/D48084



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added inline comments.



Comment at: source/Host/CMakeLists.txt:7
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all

ObjC++ or Objective C++



Comment at: source/Host/CMakeLists.txt:107
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objc)
+set(LLDBObjCLibs lldbHostMacOSXObjC)

This is really Objective C++, so `ObjCXX` or `objcxx` would be a more 
appropriate directory name.



Comment at: source/Host/CMakeLists.txt:109
+set(LLDBObjCLibs lldbHostMacOSXObjC)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp

macosx

(technically MacOS X is now macOS, but you don't need to change that)


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47411: Mute some compiler warnings in the generated python wrapper code.

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor abandoned this revision.
teemperor added a comment.

It seems people are also in favor of completely disabling the warnings, so that 
patch will replace this one.


https://reviews.llvm.org/D47411



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151023.
teemperor added a comment.

- Obj-C -> Obj-C++


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCxx
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCxx")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCxx
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely
+# not) and we would have rebuild a second set of modules just for the few
+# Obj-C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[\\S]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCxx)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/null
+++ include/lldb/module.modulemap
@@ -0,0 +1,139 @@
+
+module lldb_API {
+  requires cplusplus
+
+  umb

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151025.
teemperor marked an inline comment as done.
teemperor added a comment.

- Fixed a typo.


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCxx
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCxx")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCxx
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely
+# not) and we would have rebuild a second set of modules just for the few
+# Objective C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[\\S]*" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCxx)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/null
+++ include/lldb/module.modulemap
@@ -0,0 +1,139 @@
+
+m

[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: source/Utility/FileSpec.cpp:244-246
+  // Only update style if explicitly requested.
+  if (style)
+m_style = (*style == Style::native) ? GetNativeStyle() : *style;

labath wrote:
> JDevlieghere wrote:
> > labath wrote:
> > > I don't really have a clear opinion on whether the new behaviour here is 
> > > better or not, but it any case this sounds like something worth 
> > > explicitly calling out.
> > As far as the FileSpec class is concerned this doesn't change anything, we 
> > were always explicitly passing the m_style argument which is now implicit. 
> > To me this seems strictly better than what is was, were you might 
> > accidentally end up with the host path. 
> > 
> > I'll add a comment in the header.
> Yes, but the counterargument to that is: since you're replacing the old 
> filespec with a completely unrelated path, who's to say that the old path 
> syntax is any better fit than "host".
> 
> I think it would be best here to actually make this argument mandatory and 
> force everyone to think about the correct syntax when constructing the 
> object, but maybe that's a change for another day.
Alright, I see your point, I was only thinking about its uses within the 
FileSpec class. I think we can solve both issues by making it mandatory 
publicly, and have a private function that maintains the current style.  


Repository:
  rL LLVM

https://reviews.llvm.org/D48084



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48096: Disable warnings for the generated LLDB wrapper source

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: aprantl.
Herald added a subscriber: mgorny.

This source files emits all kind of compiler warnings on different platforms. 
As the source code
in the file is generated and we therefore can't actually fix the warnings, we 
might as well disable
them.


https://reviews.llvm.org/D48096

Files:
  source/API/CMakeLists.txt


Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -101,13 +101,12 @@
 Support
   )
 
-if (LLVM_ENABLE_WERROR)
-  if (MSVC)
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY 
COMPILE_FLAGS " /W0")
-  else()
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY 
COMPILE_FLAGS " -w")
-  endif()
+if (MSVC)
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS 
" /W0")
+else()
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS 
" -w")
 endif()
+
 set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
 if (CLANG_CL)
   set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING


Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -101,13 +101,12 @@
 Support
   )
 
-if (LLVM_ENABLE_WERROR)
-  if (MSVC)
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
-  else()
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
-  endif()
+if (MSVC)
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
+else()
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
 endif()
+
 set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
 if (CLANG_CL)
   set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D47996: Added modulemap for lldb-mi

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor edited subscribers, added: lldb-commits; removed: cfe-commits.
teemperor added a comment.

- Fixed mailing list subscriber.


https://reviews.llvm.org/D47996



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334549 - Added modulemap for lldb-mi

2018-06-12 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Tue Jun 12 14:22:52 2018
New Revision: 334549

URL: http://llvm.org/viewvc/llvm-project?rev=334549&view=rev
Log:
Added modulemap for lldb-mi

Summary: This patch allows building a C++ module for the lldb-mi headers.

Reviewers: bruno, aprantl

Reviewed By: aprantl

Subscribers: lldb-commits, ki.stfu

Differential Revision: https://reviews.llvm.org/D47996

Added:
lldb/trunk/tools/lldb-mi/module.modulemap

Added: lldb/trunk/tools/lldb-mi/module.modulemap
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-mi/module.modulemap?rev=334549&view=auto
==
--- lldb/trunk/tools/lldb-mi/module.modulemap (added)
+++ lldb/trunk/tools/lldb-mi/module.modulemap Tue Jun 12 14:22:52 2018
@@ -0,0 +1,79 @@
+module lldb_mi {
+  module MICmdArgContext { header "MICmdArgContext.h" export * }
+  module MICmdArgSet { header "MICmdArgSet.h" export * }
+  module MICmdArgValBase { header "MICmdArgValBase.h" export * }
+  module MICmdArgValConsume { header "MICmdArgValConsume.h" export * }
+  module MICmdArgValFile { header "MICmdArgValFile.h" export * }
+  module MICmdArgValListBase { header "MICmdArgValListBase.h" export * }
+  module MICmdArgValListOfN { header "MICmdArgValListOfN.h" export * }
+  module MICmdArgValNumber { header "MICmdArgValNumber.h" export * }
+  module MICmdArgValOptionLong { header "MICmdArgValOptionLong.h" export * }
+  module MICmdArgValOptionShort { header "MICmdArgValOptionShort.h" export * }
+  module MICmdArgValPrintValues { header "MICmdArgValPrintValues.h" export * }
+  module MICmdArgValString { header "MICmdArgValString.h" export * }
+  module MICmdArgValThreadGrp { header "MICmdArgValThreadGrp.h" export * }
+  module MICmdBase { header "MICmdBase.h" export * }
+  module MICmdCmdBreak { header "MICmdCmdBreak.h" export * }
+  module MICmdCmdData { header "MICmdCmdData.h" export * }
+  module MICmdCmdEnviro { header "MICmdCmdEnviro.h" export * }
+  module MICmdCmdExec { header "MICmdCmdExec.h" export * }
+  module MICmdCmdFile { header "MICmdCmdFile.h" export * }
+  module MICmdCmdGdbInfo { header "MICmdCmdGdbInfo.h" export * }
+  module MICmdCmdGdbSet { header "MICmdCmdGdbSet.h" export * }
+  module MICmdCmdGdbShow { header "MICmdCmdGdbShow.h" export * }
+  module MICmdCmdGdbThread { header "MICmdCmdGdbThread.h" export * }
+  module MICmdCmd { header "MICmdCmd.h" export * }
+  module MICmdCmdMiscellanous { header "MICmdCmdMiscellanous.h" export * }
+  module MICmdCmdStack { header "MICmdCmdStack.h" export * }
+  module MICmdCmdSupportInfo { header "MICmdCmdSupportInfo.h" export * }
+  module MICmdCmdSupportList { header "MICmdCmdSupportList.h" export * }
+  module MICmdCmdSymbol { header "MICmdCmdSymbol.h" export * }
+  module MICmdCmdTarget { header "MICmdCmdTarget.h" export * }
+  module MICmdCmdThread { header "MICmdCmdThread.h" export * }
+  module MICmdCmdTrace { header "MICmdCmdTrace.h" export * }
+  module MICmdCmdVar { header "MICmdCmdVar.h" export * }
+  module MICmdCommands { header "MICmdCommands.h" export * }
+  module MICmdData { header "MICmdData.h" export * }
+  module MICmdFactory { header "MICmdFactory.h" export * }
+  module MICmdInterpreter { header "MICmdInterpreter.h" export * }
+  module MICmdInvoker { header "MICmdInvoker.h" export * }
+  module MICmdMgr { header "MICmdMgr.h" export * }
+  module MICmdMgrSetCmdDeleteCallback { header 
"MICmdMgrSetCmdDeleteCallback.h" export * }
+  module MICmnBase { header "MICmnBase.h" export * }
+  module MICmnConfig { header "MICmnConfig.h" export * }
+  module MICmnLLDBBroadcaster { header "MICmnLLDBBroadcaster.h" export * }
+  module MICmnLLDBDebugger { header "MICmnLLDBDebugger.h" export * }
+  module MICmnLLDBDebuggerHandleEvents { header 
"MICmnLLDBDebuggerHandleEvents.h" export * }
+  module MICmnLLDBDebugSessionInfo { header "MICmnLLDBDebugSessionInfo.h" 
export * }
+  module MICmnLLDBDebugSessionInfoVarObj { header 
"MICmnLLDBDebugSessionInfoVarObj.h" export * }
+  module MICmnLLDBProxySBValue { header "MICmnLLDBProxySBValue.h" export * }
+  module MICmnLLDBUtilSBValue { header "MICmnLLDBUtilSBValue.h" export * }
+  module MICmnLog { header "MICmnLog.h" export * }
+  module MICmnLogMediumFile { header "MICmnLogMediumFile.h" export * }
+  module MICmnMIOutOfBandRecord { header "MICmnMIOutOfBandRecord.h" export * }
+  module MICmnMIResultRecord { header "MICmnMIResultRecord.h" export * }
+  module MICmnMIValueConst { header "MICmnMIValueConst.h" export * }
+  module MICmnMIValue { header "MICmnMIValue.h" export * }
+  module MICmnMIValueList { header "MICmnMIValueList.h" export * }
+  module MICmnMIValueResult { header "MICmnMIValueResult.h" export * }
+  module MICmnMIValueTuple { header "MICmnMIValueTuple.h" export * }
+  module MICmnResources { header "MICmnResources.h" export * }
+  module MICmnStreamStderr { header "MICmnStreamStderr.h" export * }
+  module MICmnStreamStdin { header "MICmnStreamStdin.h" export * }
+  m

[Lldb-commits] [PATCH] D47996: Added modulemap for lldb-mi

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL334549: Added modulemap for lldb-mi (authored by teemperor, 
committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D47996?vs=150663&id=151033#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D47996

Files:
  lldb/trunk/tools/lldb-mi/module.modulemap


Index: lldb/trunk/tools/lldb-mi/module.modulemap
===
--- lldb/trunk/tools/lldb-mi/module.modulemap
+++ lldb/trunk/tools/lldb-mi/module.modulemap
@@ -0,0 +1,79 @@
+module lldb_mi {
+  module MICmdArgContext { header "MICmdArgContext.h" export * }
+  module MICmdArgSet { header "MICmdArgSet.h" export * }
+  module MICmdArgValBase { header "MICmdArgValBase.h" export * }
+  module MICmdArgValConsume { header "MICmdArgValConsume.h" export * }
+  module MICmdArgValFile { header "MICmdArgValFile.h" export * }
+  module MICmdArgValListBase { header "MICmdArgValListBase.h" export * }
+  module MICmdArgValListOfN { header "MICmdArgValListOfN.h" export * }
+  module MICmdArgValNumber { header "MICmdArgValNumber.h" export * }
+  module MICmdArgValOptionLong { header "MICmdArgValOptionLong.h" export * }
+  module MICmdArgValOptionShort { header "MICmdArgValOptionShort.h" export * }
+  module MICmdArgValPrintValues { header "MICmdArgValPrintValues.h" export * }
+  module MICmdArgValString { header "MICmdArgValString.h" export * }
+  module MICmdArgValThreadGrp { header "MICmdArgValThreadGrp.h" export * }
+  module MICmdBase { header "MICmdBase.h" export * }
+  module MICmdCmdBreak { header "MICmdCmdBreak.h" export * }
+  module MICmdCmdData { header "MICmdCmdData.h" export * }
+  module MICmdCmdEnviro { header "MICmdCmdEnviro.h" export * }
+  module MICmdCmdExec { header "MICmdCmdExec.h" export * }
+  module MICmdCmdFile { header "MICmdCmdFile.h" export * }
+  module MICmdCmdGdbInfo { header "MICmdCmdGdbInfo.h" export * }
+  module MICmdCmdGdbSet { header "MICmdCmdGdbSet.h" export * }
+  module MICmdCmdGdbShow { header "MICmdCmdGdbShow.h" export * }
+  module MICmdCmdGdbThread { header "MICmdCmdGdbThread.h" export * }
+  module MICmdCmd { header "MICmdCmd.h" export * }
+  module MICmdCmdMiscellanous { header "MICmdCmdMiscellanous.h" export * }
+  module MICmdCmdStack { header "MICmdCmdStack.h" export * }
+  module MICmdCmdSupportInfo { header "MICmdCmdSupportInfo.h" export * }
+  module MICmdCmdSupportList { header "MICmdCmdSupportList.h" export * }
+  module MICmdCmdSymbol { header "MICmdCmdSymbol.h" export * }
+  module MICmdCmdTarget { header "MICmdCmdTarget.h" export * }
+  module MICmdCmdThread { header "MICmdCmdThread.h" export * }
+  module MICmdCmdTrace { header "MICmdCmdTrace.h" export * }
+  module MICmdCmdVar { header "MICmdCmdVar.h" export * }
+  module MICmdCommands { header "MICmdCommands.h" export * }
+  module MICmdData { header "MICmdData.h" export * }
+  module MICmdFactory { header "MICmdFactory.h" export * }
+  module MICmdInterpreter { header "MICmdInterpreter.h" export * }
+  module MICmdInvoker { header "MICmdInvoker.h" export * }
+  module MICmdMgr { header "MICmdMgr.h" export * }
+  module MICmdMgrSetCmdDeleteCallback { header 
"MICmdMgrSetCmdDeleteCallback.h" export * }
+  module MICmnBase { header "MICmnBase.h" export * }
+  module MICmnConfig { header "MICmnConfig.h" export * }
+  module MICmnLLDBBroadcaster { header "MICmnLLDBBroadcaster.h" export * }
+  module MICmnLLDBDebugger { header "MICmnLLDBDebugger.h" export * }
+  module MICmnLLDBDebuggerHandleEvents { header 
"MICmnLLDBDebuggerHandleEvents.h" export * }
+  module MICmnLLDBDebugSessionInfo { header "MICmnLLDBDebugSessionInfo.h" 
export * }
+  module MICmnLLDBDebugSessionInfoVarObj { header 
"MICmnLLDBDebugSessionInfoVarObj.h" export * }
+  module MICmnLLDBProxySBValue { header "MICmnLLDBProxySBValue.h" export * }
+  module MICmnLLDBUtilSBValue { header "MICmnLLDBUtilSBValue.h" export * }
+  module MICmnLog { header "MICmnLog.h" export * }
+  module MICmnLogMediumFile { header "MICmnLogMediumFile.h" export * }
+  module MICmnMIOutOfBandRecord { header "MICmnMIOutOfBandRecord.h" export * }
+  module MICmnMIResultRecord { header "MICmnMIResultRecord.h" export * }
+  module MICmnMIValueConst { header "MICmnMIValueConst.h" export * }
+  module MICmnMIValue { header "MICmnMIValue.h" export * }
+  module MICmnMIValueList { header "MICmnMIValueList.h" export * }
+  module MICmnMIValueResult { header "MICmnMIValueResult.h" export * }
+  module MICmnMIValueTuple { header "MICmnMIValueTuple.h" export * }
+  module MICmnResources { header "MICmnResources.h" export * }
+  module MICmnStreamStderr { header "MICmnStreamStderr.h" export * }
+  module MICmnStreamStdin { header "MICmnStreamStdin.h" export * }
+  module MICmnStreamStdout { header "MICmnStreamStdout.h" export * }
+  module MICmnThreadMgrStd { header "MICmnThreadMgrStd.h" export * }
+  module MIDataTypes { header "MIDataTypes.

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: source/Host/CMakeLists.txt:7
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all

aprantl wrote:
> ObjC++ or Objective C++
s/Obj-C++/Objective C++/



Comment at: source/Host/CMakeLists.txt:8
+# the Obj-C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Obj-C++ would require that all
+# LLVM/Clang modules are Obj-C++ compatible (which they are most likely

s/Obj-C++/Objective C++/



Comment at: source/Host/CMakeLists.txt:108
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCxx)
+add_host_subdirectory(maqcosx

either `...objcxx` or `...ObjCXX` 


https://reviews.llvm.org/D47929



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48084: [FileSpec] Delegate common operations to llvm::sys::path

2018-06-12 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.

LGTM with a nit.




Comment at: source/Utility/FileSpec.cpp:18-21
+#include "llvm/ADT/Triple.h"  // for Triple
+#include "llvm/ADT/Twine.h"   // for Twine
+#include "llvm/Support/ErrorOr.h" // for ErrorOr
 #include "llvm/Support/FileSystem.h"

This comments are really too trivial to be useful. Can you remove them?


Repository:
  rL LLVM

https://reviews.llvm.org/D48084



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48096: Disable warnings for the generated LLDB wrapper source

2018-06-12 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

Unfortunate, but this seems reasonable. lg.


https://reviews.llvm.org/D48096



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added inline comments.



Comment at: cmake/modules/LLDBFramework.cmake:45
+
+  add_dependencies(lldb-framework liblldb lldb-argdumper lldb-server 
lldb-framework-headers)
+  add_dependencies(finish_swig lldb-framework)

labath wrote:
> xiaobai wrote:
> > labath wrote:
> > > Maybe lldb-argdumper and lldb-server dependencies should be handled as a 
> > > part of INCLUDE_IN_FRAMEWORK argument to add_lldb_executable? Or do you 
> > > have other plans for that?
> > One of the goals I had in centralizing the framework generation code would 
> > be to centralize and make explicit which tools went into the framework. The 
> > idea I had was to get rid of the INCLUDE_IN_FRAMEWORK argument to 
> > add_lldb_executable. Since add_lldb_executable builds the binary 
> > differently when building for the framework (modifying the rpath, changing 
> > the output destination and symlinking it to your build tree's bin dir), it 
> > should be sufficient just to check for LLDB_BUILD_FRAMEWORK.
> > 
> > What do you think of this?
> Both of the approaches sound reasonable to me. If you want to go this way, 
> then I'm fine with that.
I've begun refactoring to remove `INCLUDE_IN_FRAMEWORK` but I've started 
thinking about some possibly negative repercussions. I'm wondering what you 
think of this:

`add_lldb_tool` (which invokes `add_lldb_executable`) can be used to add lldb 
executables that won't be included in the framework AFAICT (e.g. lldb-mi). What 
I was going to do was remove `INCLUDE_IN_FRAMEWORK` option so that every tool 
will get put into the framework and symlinked to `$BUILD_DIR/bin` when you run 
cmake with `LLDB_BUILD_FRAMEWORK=1`. This will mean that lldb-mi will be put in 
the framework if you do something like `make lldb-mi` after configuring with 
`LLDB_BUILD_FRAMEWORK=1`.

In that case, do you think it makes sense to keep `INCLUDE_IN_FRAMEWORK` as an 
option and use that to build part of the dependency tree for the lldb-framework 
target? Or do you think this is an unlikely enough example that it shouldn't 
matter?


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Alex Langford via Phabricator via lldb-commits
xiaobai updated this revision to Diff 151049.
xiaobai added a comment.

Minor change I forgot to make


https://reviews.llvm.org/D48060

Files:
  CMakeLists.txt
  cmake/modules/LLDBFramework.cmake
  source/API/CMakeLists.txt
  tools/driver/CMakeLists.txt

Index: tools/driver/CMakeLists.txt
===
--- tools/driver/CMakeLists.txt
+++ tools/driver/CMakeLists.txt
@@ -23,13 +23,3 @@
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   add_definitions( -DIMPORT_LIBLLDB )
 endif()
-
-# Add lldb dependency on lldb-server if we can use it.
-if ( LLDB_CAN_USE_LLDB_SERVER )
-  add_dependencies(lldb lldb-server)
-endif()
-
-# Add lldb dependency on debugserver if we can use it.
-if ( LLDB_CAN_USE_DEBUGSERVER )
-  add_dependencies(lldb debugserver)
-endif()
Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -2,16 +2,6 @@
   add_definitions( -DEXPORT_LIBLLDB )
 endif()
 
-option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
-
-if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7)
-  message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7")
-endif()
-
-if (LLDB_BUILD_FRAMEWORK AND NOT APPLE)
-  message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting Apple platforms.")
-endif()
-
 get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
 
 add_lldb_library(liblldb SHARED
@@ -160,47 +150,3 @@
 if (LLDB_WRAP_PYTHON)
   add_dependencies(liblldb swig_wrapper)
 endif()
-
-if(LLDB_BUILD_FRAMEWORK)
-  file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
-  file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
-  file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
-  list(REMOVE_ITEM root_public_headers ${root_private_headers})
-
-  foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
-get_filename_component(basename ${header} NAME)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
-   DEPENDS ${header}
-   COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
-list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
-  endforeach()
-
-  add_custom_target(lldb-framework-headers DEPENDS ${framework_headers}
-COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION})
-  add_dependencies(liblldb lldb-framework-headers)
-
-  set_target_properties(liblldb PROPERTIES
-OUTPUT_NAME LLDB
-FRAMEWORK On
-FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
-LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
-PUBLIC_HEADER "${framework_headers}")
-
-  if(NOT IOS)
-if (NOT LLDB_BUILT_STANDALONE)
-  add_dependencies(liblldb clang-headers)
-endif()
-add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers
-  COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers
-  COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $/Resources/Clang
-  )
-  else()
-add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers
-  )
-  endif()
-
-endif()
-
Index: cmake/modules/LLDBFramework.cmake
===
--- /dev/null
+++ cmake/modules/LLDBFramework.cmake
@@ -0,0 +1,50 @@
+add_custom_target(lldb-framework)
+
+file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
+file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
+file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private-*.h)
+list(REMOVE_ITEM root_public_headers ${root_private_headers})
+foreach(header
+${public_headers}
+${root_public_headers}
+${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
+  get_filename_component(basename ${header} NAME)
+  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
+ DEPENDS ${header}
+ COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+  list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+endforeach()
+add_custom_target(lldb-framework-headers
+  DEPENDS ${framework_headers}
+ 

[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Alex Langford via Phabricator via lldb-commits
xiaobai updated this revision to Diff 151048.
xiaobai added a comment.

Updated based on feedback. I would like to get more feedback before I'm 
comfortable changing it further and/or committing this.


https://reviews.llvm.org/D48060

Files:
  CMakeLists.txt
  cmake/modules/LLDBFramework.cmake
  source/API/CMakeLists.txt
  tools/driver/CMakeLists.txt

Index: tools/driver/CMakeLists.txt
===
--- tools/driver/CMakeLists.txt
+++ tools/driver/CMakeLists.txt
@@ -23,13 +23,3 @@
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   add_definitions( -DIMPORT_LIBLLDB )
 endif()
-
-# Add lldb dependency on lldb-server if we can use it.
-if ( LLDB_CAN_USE_LLDB_SERVER )
-  add_dependencies(lldb lldb-server)
-endif()
-
-# Add lldb dependency on debugserver if we can use it.
-if ( LLDB_CAN_USE_DEBUGSERVER )
-  add_dependencies(lldb debugserver)
-endif()
Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -2,16 +2,6 @@
   add_definitions( -DEXPORT_LIBLLDB )
 endif()
 
-option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
-
-if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7)
-  message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7")
-endif()
-
-if (LLDB_BUILD_FRAMEWORK AND NOT APPLE)
-  message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting Apple platforms.")
-endif()
-
 get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
 
 add_lldb_library(liblldb SHARED
@@ -160,47 +150,3 @@
 if (LLDB_WRAP_PYTHON)
   add_dependencies(liblldb swig_wrapper)
 endif()
-
-if(LLDB_BUILD_FRAMEWORK)
-  file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
-  file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
-  file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
-  list(REMOVE_ITEM root_public_headers ${root_private_headers})
-
-  foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
-get_filename_component(basename ${header} NAME)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
-   DEPENDS ${header}
-   COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
-list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
-  endforeach()
-
-  add_custom_target(lldb-framework-headers DEPENDS ${framework_headers}
-COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION})
-  add_dependencies(liblldb lldb-framework-headers)
-
-  set_target_properties(liblldb PROPERTIES
-OUTPUT_NAME LLDB
-FRAMEWORK On
-FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
-LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
-PUBLIC_HEADER "${framework_headers}")
-
-  if(NOT IOS)
-if (NOT LLDB_BUILT_STANDALONE)
-  add_dependencies(liblldb clang-headers)
-endif()
-add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers
-  COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers
-  COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $/Resources/Clang
-  )
-  else()
-add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers
-  )
-  endif()
-
-endif()
-
Index: cmake/modules/LLDBFramework.cmake
===
--- /dev/null
+++ cmake/modules/LLDBFramework.cmake
@@ -0,0 +1,50 @@
+add_custom_target(lldb-framework)
+
+file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
+file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
+file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private-*.h)
+list(REMOVE_ITEM root_public_headers ${root_private_headers})
+foreach(header
+${public_headers}
+${root_public_headers}
+${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
+  get_filename_component(basename ${header} NAME)
+  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
+ DEPENDS ${header}
+ COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+  list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${ba

[Lldb-commits] [PATCH] D48096: Disable warnings for the generated LLDB wrapper source

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL334557: Disable warnings for the generated LLDB wrapper 
source (authored by teemperor, committed by ).
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D48096?vs=151026&id=151058#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D48096

Files:
  lldb/trunk/source/API/CMakeLists.txt


Index: lldb/trunk/source/API/CMakeLists.txt
===
--- lldb/trunk/source/API/CMakeLists.txt
+++ lldb/trunk/source/API/CMakeLists.txt
@@ -101,13 +101,12 @@
 Support
   )
 
-if (LLVM_ENABLE_WERROR)
-  if (MSVC)
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY 
COMPILE_FLAGS " /W0")
-  else()
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY 
COMPILE_FLAGS " -w")
-  endif()
+if (MSVC)
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS 
" /W0")
+else()
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS 
" -w")
 endif()
+
 set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
 if (CLANG_CL)
   set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING


Index: lldb/trunk/source/API/CMakeLists.txt
===
--- lldb/trunk/source/API/CMakeLists.txt
+++ lldb/trunk/source/API/CMakeLists.txt
@@ -101,13 +101,12 @@
 Support
   )
 
-if (LLVM_ENABLE_WERROR)
-  if (MSVC)
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
-  else()
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
-  endif()
+if (MSVC)
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " /W0")
+else()
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS " -w")
 endif()
+
 set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
 if (CLANG_CL)
   set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r334557 - Disable warnings for the generated LLDB wrapper source

2018-06-12 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Tue Jun 12 15:51:20 2018
New Revision: 334557

URL: http://llvm.org/viewvc/llvm-project?rev=334557&view=rev
Log:
Disable warnings for the generated LLDB wrapper source

Summary:
This source files emits all kind of compiler warnings on different platforms. 
As the source code
in the file is generated and we therefore can't actually fix the warnings, we 
might as well disable
them.

Reviewers: aprantl, davide

Reviewed By: davide

Subscribers: davide, mgorny, lldb-commits

Differential Revision: https://reviews.llvm.org/D48096

Modified:
lldb/trunk/source/API/CMakeLists.txt

Modified: lldb/trunk/source/API/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=334557&r1=334556&r2=334557&view=diff
==
--- lldb/trunk/source/API/CMakeLists.txt (original)
+++ lldb/trunk/source/API/CMakeLists.txt Tue Jun 12 15:51:20 2018
@@ -101,13 +101,12 @@ add_lldb_library(liblldb SHARED
 Support
   )
 
-if (LLVM_ENABLE_WERROR)
-  if (MSVC)
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY 
COMPILE_FLAGS " /W0")
-  else()
-set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY 
COMPILE_FLAGS " -w")
-  endif()
+if (MSVC)
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS 
" /W0")
+else()
+  set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING PROPERTY COMPILE_FLAGS 
" -w")
 endif()
+
 set_source_files_properties(${LLDB_WRAP_PYTHON} PROPERTIES GENERATED 1)
 if (CLANG_CL)
   set_property(SOURCE ${LLDB_WRAP_PYTHON} APPEND_STRING


___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd added inline comments.



Comment at: CMakeLists.txt:145
+  add_dependencies(lldb-suite lldb-framework)
+elseif()
+  if (LLDB_CAN_USE_LLDB_SERVER)

Shouldn't this be `else()`?



Comment at: CMakeLists.txt:176
+if (LLDB_BUILD_FRAMEWORK)
+  # The target to install libLLDB needs to depend on finish swig so that 
the
+  # framework build properly copies over the Python files.

"finish swig"?



Comment at: cmake/modules/LLDBFramework.cmake:5
+file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
+file(GLOB root_private_headers 
${LLDB_SOURCE_DIR}/include/lldb/lldb-private-*.h)
+list(REMOVE_ITEM root_public_headers ${root_private_headers})

Globs are generally frowned upon for dependency tracking issues.


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added inline comments.



Comment at: CMakeLists.txt:145
+  add_dependencies(lldb-suite lldb-framework)
+elseif()
+  if (LLDB_CAN_USE_LLDB_SERVER)

compnerd wrote:
> Shouldn't this be `else()`?
Yup



Comment at: CMakeLists.txt:176
+if (LLDB_BUILD_FRAMEWORK)
+  # The target to install libLLDB needs to depend on finish swig so that 
the
+  # framework build properly copies over the Python files.

compnerd wrote:
> "finish swig"?
Should be "finish_swig"



Comment at: cmake/modules/LLDBFramework.cmake:5
+file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
+file(GLOB root_private_headers 
${LLDB_SOURCE_DIR}/include/lldb/lldb-private-*.h)
+list(REMOVE_ITEM root_public_headers ${root_private_headers})

compnerd wrote:
> Globs are generally frowned upon for dependency tracking issues.
I see. This code was moved from somewhere else and written by somebody else. My 
CMake is somewhat weak, how would you do this instead?


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Alex Langford via Phabricator via lldb-commits
xiaobai updated this revision to Diff 151067.
xiaobai added a comment.

Minor fixups pointed out by compnerd


https://reviews.llvm.org/D48060

Files:
  CMakeLists.txt
  cmake/modules/LLDBFramework.cmake
  source/API/CMakeLists.txt
  tools/driver/CMakeLists.txt

Index: tools/driver/CMakeLists.txt
===
--- tools/driver/CMakeLists.txt
+++ tools/driver/CMakeLists.txt
@@ -23,13 +23,3 @@
 if ( CMAKE_SYSTEM_NAME MATCHES "Windows" )
   add_definitions( -DIMPORT_LIBLLDB )
 endif()
-
-# Add lldb dependency on lldb-server if we can use it.
-if ( LLDB_CAN_USE_LLDB_SERVER )
-  add_dependencies(lldb lldb-server)
-endif()
-
-# Add lldb dependency on debugserver if we can use it.
-if ( LLDB_CAN_USE_DEBUGSERVER )
-  add_dependencies(lldb debugserver)
-endif()
Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -2,16 +2,6 @@
   add_definitions( -DEXPORT_LIBLLDB )
 endif()
 
-option(LLDB_BUILD_FRAMEWORK "Build the Darwin LLDB.framework" Off)
-
-if(LLDB_BUILD_FRAMEWORK AND CMAKE_VERSION VERSION_LESS 3.7)
-  message(FATAL_ERROR "LLDB_BUILD_FRAMEWORK is not supported on CMake < 3.7")
-endif()
-
-if (LLDB_BUILD_FRAMEWORK AND NOT APPLE)
-  message(FATAL_ERROR "LLDB.framework cannot be generated unless targeting Apple platforms.")
-endif()
-
 get_property(LLDB_ALL_PLUGINS GLOBAL PROPERTY LLDB_PLUGINS)
 
 add_lldb_library(liblldb SHARED
@@ -160,47 +150,3 @@
 if (LLDB_WRAP_PYTHON)
   add_dependencies(liblldb swig_wrapper)
 endif()
-
-if(LLDB_BUILD_FRAMEWORK)
-  file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
-  file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
-  file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private*.h)
-  list(REMOVE_ITEM root_public_headers ${root_private_headers})
-
-  foreach(header ${public_headers} ${root_public_headers} ${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
-get_filename_component(basename ${header} NAME)
-add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
-   DEPENDS ${header}
-   COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
-list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
-  endforeach()
-
-  add_custom_target(lldb-framework-headers DEPENDS ${framework_headers}
-COMMAND ${LLDB_SOURCE_DIR}/scripts/framework-header-fix.sh ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders ${LLDB_VERSION})
-  add_dependencies(liblldb lldb-framework-headers)
-
-  set_target_properties(liblldb PROPERTIES
-OUTPUT_NAME LLDB
-FRAMEWORK On
-FRAMEWORK_VERSION ${LLDB_FRAMEWORK_VERSION}
-LIBRARY_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}
-PUBLIC_HEADER "${framework_headers}")
-
-  if(NOT IOS)
-if (NOT LLDB_BUILT_STANDALONE)
-  add_dependencies(liblldb clang-headers)
-endif()
-add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers
-  COMMAND ${CMAKE_COMMAND} -E create_symlink Versions/Current/Headers ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Headers
-  COMMAND ${CMAKE_COMMAND} -E create_symlink ${LLDB_FRAMEWORK_VERSION} ${CMAKE_BINARY_DIR}/${LLDB_FRAMEWORK_INSTALL_DIR}/LLDB.framework/Versions/Current
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}/clang/${LLDB_VERSION} $/Resources/Clang
-  )
-  else()
-add_custom_command(TARGET liblldb POST_BUILD
-  COMMAND ${CMAKE_COMMAND} -E copy_directory ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders $/Headers
-  )
-  endif()
-
-endif()
-
Index: cmake/modules/LLDBFramework.cmake
===
--- /dev/null
+++ cmake/modules/LLDBFramework.cmake
@@ -0,0 +1,50 @@
+add_custom_target(lldb-framework)
+
+file(GLOB public_headers ${LLDB_SOURCE_DIR}/include/lldb/API/*.h)
+file(GLOB root_public_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-*.h)
+file(GLOB root_private_headers ${LLDB_SOURCE_DIR}/include/lldb/lldb-private-*.h)
+list(REMOVE_ITEM root_public_headers ${root_private_headers})
+foreach(header
+${public_headers}
+${root_public_headers}
+${LLDB_SOURCE_DIR}/include/lldb/Utility/SharingPtr.h)
+  get_filename_component(basename ${header} NAME)
+  add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename}
+ DEPENDS ${header}
+ COMMAND ${CMAKE_COMMAND} -E copy ${header} ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+  list(APPEND framework_headers ${CMAKE_CURRENT_BINARY_DIR}/FrameworkHeaders/${basename})
+endforeach()
+add_custom_target(lldb-framework-headers
+  DEPENDS ${framework_head

[Lldb-commits] [PATCH] D47929: Add modules support for lldb headers in include/

2018-06-12 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor updated this revision to Diff 151077.
teemperor added a comment.

- The regex that removes the modules cache now actually removes the whole flag 
+ path.
- Fixed more typos.


https://reviews.llvm.org/D47929

Files:
  include/lldb/module.modulemap
  source/Host/CMakeLists.txt
  source/Host/common/Terminal.cpp
  source/Host/macosx/Host.mm
  source/Host/macosx/HostInfoMacOSX.mm
  source/Host/macosx/HostThreadMacOSX.mm
  source/Host/macosx/objcxx/CMakeLists.txt
  source/Host/macosx/objcxx/Host.mm
  source/Host/macosx/objcxx/HostInfoMacOSX.mm
  source/Host/macosx/objcxx/HostThreadMacOSX.mm
  source/Plugins/Platform/MacOSX/CMakeLists.txt
  source/Plugins/Platform/MacOSX/PlatformiOSSimulatorCoreSimulatorSupport.mm
  source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
  
source/Plugins/Platform/MacOSX/objcxx/PlatformiOSSimulatorCoreSimulatorSupport.mm

Index: source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Plugins/Platform/MacOSX/objcxx/CMakeLists.txt
@@ -0,0 +1,18 @@
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbPluginPlatformMacOSXObjCXX
+  PlatformiOSSimulatorCoreSimulatorSupport.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Plugins/Platform/MacOSX/CMakeLists.txt
===
--- source/Plugins/Platform/MacOSX/CMakeLists.txt
+++ source/Plugins/Platform/MacOSX/CMakeLists.txt
@@ -11,13 +11,14 @@
 list(APPEND PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES
   PlatformAppleSimulator.cpp
   PlatformiOSSimulator.cpp
-  PlatformiOSSimulatorCoreSimulatorSupport.mm
   PlatformAppleTVSimulator.cpp
   PlatformAppleWatchSimulator.cpp
   )
 
 if(CMAKE_SYSTEM_NAME MATCHES "Darwin")
   include_directories(${LIBXML2_INCLUDE_DIR})
+  add_subdirectory(objcxx)
+  set(OBJC_LIBS "lldbPluginPlatformMacOSXObjCXX")
   list(APPEND PLUGIN_PLATFORM_MACOSX_SOURCES
 ${PLUGIN_PLATFORM_MACOSX_DARWIN_ONLY_SOURCES})
 else()
@@ -38,6 +39,7 @@
 lldbTarget
 lldbUtility
 lldbPluginPlatformPOSIX
+${OBJC_LIBS}
   LINK_COMPONENTS
 Support
 )
Index: source/Host/macosx/objcxx/CMakeLists.txt
===
--- /dev/null
+++ source/Host/macosx/objcxx/CMakeLists.txt
@@ -0,0 +1,21 @@
+
+remove_module_flags()
+include_directories(..)
+
+add_lldb_library(lldbHostMacOSXObjCXX
+  Host.mm
+  HostInfoMacOSX.mm
+  HostThreadMacOSX.mm
+
+  LINK_LIBS
+lldbCore
+lldbSymbol
+lldbTarget
+lldbUtility
+${LLDB_PLUGINS}
+${EXTRA_LIBS}
+
+  LINK_COMPONENTS
+Object
+Support
+  )
Index: source/Host/common/Terminal.cpp
===
--- source/Host/common/Terminal.cpp
+++ source/Host/common/Terminal.cpp
@@ -9,6 +9,7 @@
 
 #include "lldb/Host/Terminal.h"
 
+#include "lldb/Host/Config.h"
 #include "lldb/Host/PosixApi.h"
 #include "llvm/ADT/STLExtras.h"
 
Index: source/Host/CMakeLists.txt
===
--- source/Host/CMakeLists.txt
+++ source/Host/CMakeLists.txt
@@ -3,6 +3,18 @@
   source_group(${group} FILES ${ARGN})
 endmacro()
 
+# Removes all module flags from the current CMAKE_CXX_FLAGS. Used for
+# the Objective C++ code in lldb which we don't want to build with modules.
+# Reasons for this are that modules with Objective C++ would require that
+# all LLVM/Clang modules are Objective C++ compatible (which they are likely
+# not) and we would have rebuild a second set of modules just for the few
+# Objective C++ files in lldb (which slows down the build process).
+macro(remove_module_flags)
+  string(REGEX REPLACE "-fmodules-cache-path=[^ ]+" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fmodules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+  string(REGEX REPLACE "-fcxx-modules" "" CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS}")
+endmacro()
+
 add_host_subdirectory(common
   common/File.cpp
   common/FileCache.cpp
@@ -92,10 +104,9 @@
 
   if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
 include_directories(SYSTEM ${LIBXML2_INCLUDE_DIR})
-add_host_subdirectory(macosx
-  macosx/Host.mm
-  macosx/HostInfoMacOSX.mm
-  macosx/HostThreadMacOSX.mm
+add_subdirectory(macosx/objcxx)
+set(LLDBObjCLibs lldbHostMacOSXObjCXX)
+add_host_subdirectory(maqcosx
   macosx/Symbols.cpp
   macosx/cfcpp/CFCBundle.cpp
   macosx/cfcpp/CFCData.cpp
@@ -177,15 +188,16 @@
 
 add_lldb_library(lldbHost
   ${HOST_SOURCES}
-  
+
   LINK_LIBS
 lldbCore
 lldbSymbol
 lldbTarget
 lldbUtility
 ${LLDB_PLUGINS}
 ${EXTRA_LIBS}
-  
+${LLDBObjCLibs}
+
   LINK_COMPONENTS
 Object
 Support
Index: include/lldb/module.modulemap
===
--- /dev/n

[Lldb-commits] [PATCH] D48060: Introduce lldb-framework CMake target and centralize its logic

2018-06-12 Thread Greg Clayton via Phabricator via lldb-commits
clayborg resigned from this revision.
clayborg added a comment.

I'll defer to the cmake experts. I hope we can produce a LLDB.framework that is 
identical to the Xcode produced version, or at least as close.


https://reviews.llvm.org/D48060



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48114: Add dataformatter for NSDecimalNumber

2018-06-12 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: aprantl, jingham, jasonmolenda.

This patch adds a data formatter for NSDecimalNumber. The latter is a 
Foundation object used for representing and performing arithmetic on base-10 
numbers that bridges to Decimal.


Repository:
  rL LLVM

https://reviews.llvm.org/D48114

Files:
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjC.py
  
packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
  source/Plugins/Language/ObjC/Cocoa.cpp
  source/Plugins/Language/ObjC/Cocoa.h
  source/Plugins/Language/ObjC/ObjCLanguage.cpp

Index: source/Plugins/Language/ObjC/ObjCLanguage.cpp
===
--- source/Plugins/Language/ObjC/ObjCLanguage.cpp
+++ source/Plugins/Language/ObjC/ObjCLanguage.cpp
@@ -763,6 +763,10 @@
   AddCXXSummary(
   objc_category_sp, lldb_private::formatters::NSNumberSummaryProvider,
   "NSNumber summary provider", ConstString("NSCFNumber"), appkit_flags);
+  AddCXXSummary(objc_category_sp,
+lldb_private::formatters::NSNumberSummaryProvider,
+"NSDecimalNumber summary provider",
+ConstString("NSDecimalNumber"), appkit_flags);
 
   AddCXXSummary(objc_category_sp,
 lldb_private::formatters::NSURLSummaryProvider,
Index: source/Plugins/Language/ObjC/Cocoa.h
===
--- source/Plugins/Language/ObjC/Cocoa.h
+++ source/Plugins/Language/ObjC/Cocoa.h
@@ -32,6 +32,9 @@
 bool NSNumberSummaryProvider(ValueObject &valobj, Stream &stream,
  const TypeSummaryOptions &options);
 
+bool NSDecimalNumberSummaryProvider(ValueObject &valobj, Stream &stream,
+ const TypeSummaryOptions &options);
+
 bool NSNotificationSummaryProvider(ValueObject &valobj, Stream &stream,
const TypeSummaryOptions &options);
 
Index: source/Plugins/Language/ObjC/Cocoa.cpp
===
--- source/Plugins/Language/ObjC/Cocoa.cpp
+++ source/Plugins/Language/ObjC/Cocoa.cpp
@@ -459,6 +459,9 @@
   if (!strcmp(class_name, "__NSCFBoolean"))
 return ObjCBooleanSummaryProvider(valobj, stream, options);
 
+  if (!strcmp(class_name, "NSDecimalNumber"))
+return NSDecimalNumberSummaryProvider(valobj, stream, options);
+
   if (!strcmp(class_name, "NSNumber") || !strcmp(class_name, "__NSCFNumber")) {
 uint64_t value = 0;
 uint64_t i_bits = 0;
@@ -626,6 +629,55 @@
   return false;
 }
 
+bool lldb_private::formatters::NSDecimalNumberSummaryProvider(
+ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
+  ProcessSP process_sp = valobj.GetProcessSP();
+  if (!process_sp)
+return false;
+
+  lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);
+  uint32_t ptr_size = process_sp->GetAddressByteSize();
+
+  Status error;
+  int8_t exponent = process_sp->ReadUnsignedIntegerFromMemory(
+  valobj_addr + ptr_size, 1, 0, error);
+  if (error.Fail())
+return false;
+
+  uint8_t length_and_negative = process_sp->ReadUnsignedIntegerFromMemory(
+  valobj_addr + ptr_size + 1, 1, 0, error);
+  if (error.Fail())
+return false;
+
+  // Fifth bit marks negativity.
+  const bool is_negative = (length_and_negative >> 4) & 1;
+
+  // Zero length and negative means NaN.
+  uint8_t length = length_and_negative & 0xf;
+  const bool is_nan = is_negative && (length == 0);
+
+  if (is_nan) {
+stream.Printf("NaN");
+return true;
+  }
+
+  if (length == 0) {
+stream.Printf("0");
+return true;
+  }
+
+  uint64_t mantissa = process_sp->ReadUnsignedIntegerFromMemory(
+  valobj_addr + ptr_size + 4, 8, 0, error);
+  if (error.Fail())
+return false;
+
+  if (is_negative)
+stream.Printf("-");
+
+  stream.Printf("%" PRIu64 " x 10^%" PRIi8, mantissa, exponent);
+  return true;
+}
+
 bool lldb_private::formatters::NSURLSummaryProvider(
 ValueObject &valobj, Stream &stream, const TypeSummaryOptions &options) {
   ProcessSP process_sp = valobj.GetProcessSP();
Index: packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
===
--- packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -169,7 +169,11 @@
 	NSNumber* num_at3 = @12.5;
 	NSNumber* num_at4 = @-12.5;
 
-		NSDecimalNumber* decimal_one = [NSDecimalNumber one];
+	NSDecimalNumber* decimal_number = [NSDecimalNumber decimalNumberWithMantissa:123456 exponent:-10 isNegative:NO];
+	NSDecimalNumber* decimal_number_neg = [NSDecimalNumber decimalNumberWithMantissa:123456 exponent:10 isNegative:YES];
+	NSDecimalNumber* decimal_one = [NSDecim

[Lldb-commits] [PATCH] D48114: Add dataformatter for NSDecimalNumber

2018-06-12 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: source/Plugins/Language/ObjC/Cocoa.cpp:462
 
+  if (!strcmp(class_name, "NSDecimalNumber"))
+return NSDecimalNumberSummaryProvider(valobj, stream, options);

Side note: It would be slightly faster/elegant to use a StringRef instead of 
the char* for the comparisons.



Comment at: source/Plugins/Language/ObjC/Cocoa.cpp:639
+  lldb::addr_t valobj_addr = valobj.GetValueAsUnsigned(0);
+  uint32_t ptr_size = process_sp->GetAddressByteSize();
+

Since the whole structure is one packed bitfield, an alternative implementation 
would be to read all 16b at once and memcpy to a local variable bitfield and 
let the compiler do the unpacking; that might be shorter. This version seems 
fine, too.


Repository:
  rL LLVM

https://reviews.llvm.org/D48114



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D48114: Add dataformatter for NSDecimalNumber

2018-06-12 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

I didn't check whether the representation was correct (although it looks lo). 
The structure of the patch looks fine to me, thanks for adding the comments :)


Repository:
  rL LLVM

https://reviews.llvm.org/D48114



___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits