[Lldb-commits] [PATCH] D79108: [lldb/CommandInterpreter] Move AutoHandleEvents and SpawnThread into CommandInterpreterRunOptions (NFC)

2020-04-30 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added inline comments.



Comment at: lldb/source/API/SBDebugger.cpp:1189-1190
   if (m_opaque_sp) {
+options.SetAutoHandleEvents(auto_handle_events);
+options.SetSpawnThread(spawn_thread);
 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();

Maybe document somewhere that the arguments take precedence over what's present 
in SBCommandInterpreterRunOptions


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79108/new/

https://reviews.llvm.org/D79108



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


[Lldb-commits] [PATCH] D79120: [lldb/API] Add RunCommandInterpreter overload that returns SBCommandInterpreterRunResults (NFC)

2020-04-30 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Here I would be interested to know whether the "stop reasons" are mutually 
exclusive? It sounds like they should be...

And if they are, it seems that a better way to express this would be via 
something like `GetRunResult` which returns `Success`, or `InferiorCrash`, or 
`CommandError`, or `QuitRequested`. Other reasons can be added to the enum 
later, if needed...


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79120/new/

https://reviews.llvm.org/D79120



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


[Lldb-commits] [PATCH] D78801: [LLDB] Add class ProcessWasm for WebAssembly debugging

2020-04-30 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Sorry for the overly long post. I tried to reply to all messages from last 
night. I don't claim that all of my comments are consistent with one another -- 
that's a reflection of the fact that I really don't know what is the right 
solution...

In D78801#2010713 , @paolosev wrote:

> Also, to eliminate `qWasmCallStack` we could maybe add the call stack (a list 
> of PCs) to the stop packet. The format of a stop packet is:
>
>   T AA n1:r1;n2:r2;…
>  
>   The program received signal number AA (a two-digit hexadecimal number). 
> [...] Each ‘n:r’ pair is interpreted as follows:
>   If n is a hexadecimal number, it is a register number, and the 
> corresponding r gives that register’s value. [...]
>   If n is ‘thread’, then r is the thread-id of the stopped thread, as 
> specified in thread-id syntax.
>   If n is ‘core’, then r is the hexadecimal number of the core on which the 
> stop event was detected.
>   Otherwise, GDB should ignore this ‘n:r’ pair and go on to the next; this 
> allows us to extend the protocol in the future.
>
>
> So adding a 'stack:x...xxx' pair should be possible. If we reuse `m`, `M` 
> in place of qWasmLocal, qWasmGlobal and qWasmStackValue and add generic 
> qMemSpaceRead/qMemSpaceWrite for the memory, then there would be no new 
> Wasm-specific command to add to the protocol.


I don't see a real difference between these two options. The only reason the 
`stack:` key is not wasm-specific is because you excluded wasm from the name. 
If we renamed `qWasmCallStack` to `qCallStack`, the effect would be the same. 
For me the question is more fundamendal -- who/how/why should be computing the 
call stack, not the exact protocol details.

It may also be interesting to note that the stop-reply packet kind of also 
includes the call stack information via the `memory` field. The idea there is 
that the stub will walk the FP chain and send over the relevant bits of memory. 
However, there is a big difference -- all of this is just a hint to the client 
and an optimization to reduce packet count. It's still the client who 
determines the final call stack.

In D78801#2010598 , @paolosev wrote:

> I really like the idea of defining generic commands for reading and writing 
> memory on systems with multiple address spaces! In fact there is no reason 
> why that should be Wasm-specific.


I know a lot of people are interested in adding address spaces to lldb. But I 
don't think the problem is adding a gdb-remote extension to the `m` packet -- 
that is the easy part. The same thing could be done to the "memory read" 
command in lldb. The interesting stuff begins when you want to go beyond that: 
If the address space is just an opaque number, then what does that mean? What 
can lldb do with such address spaces? How do they map to the address spaces in 
llvm? How do they relate to addresses in object files (no common format has 
support for them)? How about addresses in debug info? etc.

If dwarf had a notion of address spaces then there'd probably be no need for 
DW_OP_WASM_location. If the dwarf committee hasn't been able to come up with a 
unified way to represent address spaces, then I'm not sure we will do better. 
And we'll still be left with the job of translating dwarf (and other) entries 
into this other concept.

In D78801#2010471 , @paolosev wrote:

> When you say
>
> > translate DW_OP_WASM_location into an appropriate FP+offset combo.
>
> do you mean that LLVM should generate these `FP+offset` combos rather than 
> `DW_OP_WASM_location` or that LLDB should somehow do this translation?


I meant the latter, though if we could somehow achieve the former, it would be 
even better, obviously. :)

> I think the engine can do more to help, here, but not a lot more; I am 
> afraid. Yes, it could expose an implied “SP” and “FP”, and that should be 
> sufficient to represent locals and arguments and make stack walking more 
> orthodox. But DW_OP_WASM_location also describes locations in the set of wasm 
> globals and in the Wasm operand stack, so we would need at least a second. 
> parallel stack to represent the operand stack.
> 
> Also, for C++ LLVM emits code to maintain a “shadow stack” in the linear 
> memory of the module, and location expressions like `DW_OP_fbreg +N` are 
> already used to describe the location of a parameter or a local variable in 
> that shadow stack. The stack frame pointer for that function is described 
> with `DW_AT_frame_base`, expressed as a DW_OP_WASM_location expression.

So, the pointer to this "shadow stack" is one of the function arguments, 
represented as DW_OP_WASM_location 0x0 (local) + constant. And then we get to a 
variable on the shadow stack by "dereferencing" this value, and adding another 
constant. Is that right?

That sound like it should be expressible in standard dwarf. If we set 
DW_AT_frame_ba

[Lldb-commits] [PATCH] D79174: [LLDB] Initialize "ThreadPlanTracer::m_thread" to avoid undefined behavior

2020-04-30 Thread Vangelis Tsiatsianas via Phabricator via lldb-commits
vangelists created this revision.
vangelists added a reviewer: jingham.
vangelists added a project: LLDB.
Herald added a subscriber: lldb-commits.

The `m_thread` field of `ThreadPlanTracer` is not initialized by the 
constructor leading to undefined behavior in `ThreadPlanTracer::GetThread()`.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D79174

Files:
  lldb/source/Target/ThreadPlanTracer.cpp


Index: lldb/source/Target/ThreadPlanTracer.cpp
===
--- lldb/source/Target/ThreadPlanTracer.cpp
+++ lldb/source/Target/ThreadPlanTracer.cpp
@@ -35,11 +35,12 @@
 
 ThreadPlanTracer::ThreadPlanTracer(Thread &thread, lldb::StreamSP &stream_sp)
 : m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
-  m_single_step(true), m_enabled(false), m_stream_sp(stream_sp) {}
+  m_single_step(true), m_enabled(false), m_stream_sp(stream_sp),
+  m_thread(nullptr) {}
 
 ThreadPlanTracer::ThreadPlanTracer(Thread &thread)
 : m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
-  m_single_step(true), m_enabled(false), m_stream_sp() {}
+  m_single_step(true), m_enabled(false), m_stream_sp(), m_thread(nullptr) 
{}
 
 Stream *ThreadPlanTracer::GetLogStream() {
   if (m_stream_sp)


Index: lldb/source/Target/ThreadPlanTracer.cpp
===
--- lldb/source/Target/ThreadPlanTracer.cpp
+++ lldb/source/Target/ThreadPlanTracer.cpp
@@ -35,11 +35,12 @@
 
 ThreadPlanTracer::ThreadPlanTracer(Thread &thread, lldb::StreamSP &stream_sp)
 : m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
-  m_single_step(true), m_enabled(false), m_stream_sp(stream_sp) {}
+  m_single_step(true), m_enabled(false), m_stream_sp(stream_sp),
+  m_thread(nullptr) {}
 
 ThreadPlanTracer::ThreadPlanTracer(Thread &thread)
 : m_process(*thread.GetProcess().get()), m_tid(thread.GetID()),
-  m_single_step(true), m_enabled(false), m_stream_sp() {}
+  m_single_step(true), m_enabled(false), m_stream_sp(), m_thread(nullptr) {}
 
 Stream *ThreadPlanTracer::GetLogStream() {
   if (m_stream_sp)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D78972: Treat hasWeakODRLinkage symbols as external in REPL computations

2020-04-30 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D78972#2011571 , @jingham wrote:

> That one does work all the way, including calling the function.  That should 
> be surprising.   It shouldn't with an unpatched lldb, right?


Yep, I realized that is not the best example after posting that comment.

> We do this whole dance again every time we run this expression.  It looks 
> like we don't look for instances of a template if we know how to make it, we 
> just make it again.  That actually makes sense.  When you are compiling, you 
> don't know if you will find an instantiation, so you have to make it.  Then 
> you leave it to the linker to remove duplicates.

You're describing the "normal" `linkonce` semantics. Things get more complex 
once you start having explicit instantiations: `template void f();` forces 
a compiler to emit an instantiation even though it is not needed (this results 
in the `weak_odr` linkage. `extern template void f();` inhibits 
instantiation -- the compiler will assume you have an explicit instantiation 
elsewhere. The fact that the explicit instantiation is "weak" allows for some 
interesting effects, but it's tricky to demonstrate them, as they all involve 
UB. Once can see some of that with normal compilation like this:

  $ head a.cc b.cc c.cc
  ==> a.cc <==
  #include 
  
  template void f() { printf("Hello T\n"); }
  
  template void f(); // weak
  
  ==> b.cc <==
  #include 
  
  extern "C" void _Z1fIiEvv() { printf("Hello _Z1fIiEvv\n"); } // strong
  
  ==> c.cc <==
  #include 
  
  template void f() { printf("Hello T\n"); }
  
  extern template void f(); // inhibit instantiation
  
  int main() {
f();
  }
  $ c++ a.cc c.cc
  $ ./a.out 
  Hello T
  $ c++ a.cc c.cc b.cc
  $ ./a.out 
  Hello _Z1fIiEvv

I don't know whether any of this is relevant for top-level expressions.

Incidentally it looks like we have a problem with function template 
specializations in top-level expressions, though I don't think that is related 
to this patch in any way:

  (lldb) expr --top-level --
  Enter expressions, then terminate with an empty line to evaluate:
1: template void f() { (void) printf("Hello T\n"); } 
2: template<> void f() { (void) printf("Hello int\n"); } 
3: void g() { f(); } 
  (lldb) p g()
  Hello int
  (lldb) p f()
  Hello T



> Note that this is all about creating new code in a running program, and it 
> almost seems like you really should use the new version you created if it is 
> any different.  Or anyway, it's not entirely clear what the rule should be.  
> And anyway, the thing we have to do is not NOT export these symbols, it is 
> really "figure out if they exist somewhere else and are equivalent" and use 
> those, otherwise export these.  Since I don't yet have an example where there 
> are two versions that would get used, I don't want to try to write code to do 
> that blind.

Yep, at this point I am pretty lost about what should be the correct behavior, 
and whether the change is detectable with c++. However, I don't like the fact 
that the change has no test coverage.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78972/new/

https://reviews.llvm.org/D78972



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


[Lldb-commits] [lldb] b3180d6 - [lldb] Re-add deleted RUN line in module-ownership.mm

2020-04-30 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-04-30T19:29:50+02:00
New Revision: b3180d6a1ad24e890dfe7d97407edc1b3e74b755

URL: 
https://github.com/llvm/llvm-project/commit/b3180d6a1ad24e890dfe7d97407edc1b3e74b755
DIFF: 
https://github.com/llvm/llvm-project/commit/b3180d6a1ad24e890dfe7d97407edc1b3e74b755.diff

LOG: [lldb] Re-add deleted RUN line in module-ownership.mm

This was deleted in 681466f5e6412350a0b066791450e72325c2c074 by accident.

Added: 


Modified: 
lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm

Removed: 




diff  --git a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm 
b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
index f6522e1a808c..b83797f503cd 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
+++ b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
@@ -1,6 +1,7 @@
 // RUN: %clang --target=x86_64-apple-macosx -g -gmodules \
 // RUN:-fmodules -fmodules-cache-path=%t.cache \
 // RUN:-c -o %t.o %s -I%S/Inputs
+// RUN: lldb-test symbols -dump-clang-ast %t.o | FileCheck %s
 // Verify that the owning module information from DWARF is preserved in the 
AST.
 
 @import A;



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


[Lldb-commits] [lldb] ae6d2ff - [lldb] fix RPATH when linking against Python3.framework

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T10:42:03-07:00
New Revision: ae6d2ff633a07a04aad62a0870afe28950472938

URL: 
https://github.com/llvm/llvm-project/commit/ae6d2ff633a07a04aad62a0870afe28950472938
DIFF: 
https://github.com/llvm/llvm-project/commit/ae6d2ff633a07a04aad62a0870afe28950472938.diff

LOG: [lldb] fix RPATH when linking against Python3.framework

The install name for the Python 3 framework in Xcode is relative to
the framework's location and not the dylib itself.

  @rpath/Python3.framework/Versions/3.x/Python3

This means that we need to compute the path to the Python3.framework
and use that as the RPATH instead of the usual dylib's directory.

Added: 


Modified: 
lldb/cmake/modules/FindPythonInterpAndLibs.cmake
lldb/source/API/CMakeLists.txt
lldb/tools/lldb-test/CMakeLists.txt

Removed: 




diff  --git a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake 
b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
index fa7a39185586..5ea7aab63230 100644
--- a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
+++ b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
@@ -17,10 +17,27 @@ else()
 set(PYTHON_LIBRARIES ${Python3_LIBRARIES})
 set(PYTHON_INCLUDE_DIRS ${Python3_INCLUDE_DIRS})
 set(PYTHON_EXECUTABLE ${Python3_EXECUTABLE})
+
+# The install name for the Python 3 framework in Xcode is relative to
+# the framework's location and not the dylib itself.
+#
+#   @rpath/Python3.framework/Versions/3.x/Python3
+#
+# This means that we need to compute the path to the Python3.framework
+# and use that as the RPATH instead of the usual dylib's directory.
+#
+# The check below shouldn't match Homebrew's Python framework as it is
+# called Python.framework instead of Python3.framework.
+if (APPLE AND Python3_LIBRARIES MATCHES "Python3.framework")
+  string(FIND "${Python3_LIBRARIES}" "Python3.framework" 
python_framework_pos)
+  string(SUBSTRING "${Python3_LIBRARIES}" "0" ${python_framework_pos} 
PYTHON_RPATH)
+endif()
+
 mark_as_advanced(
   PYTHON_LIBRARIES
   PYTHON_INCLUDE_DIRS
   PYTHON_EXECUTABLE
+  PYTHON_RPATH
   SWIG_EXECUTABLE)
   elseif(NOT CMAKE_SYSTEM_NAME STREQUAL Windows)
 # Use PYTHON_HOME as a hint to find Python 2.
@@ -34,6 +51,7 @@ else()
 PYTHON_LIBRARIES
 PYTHON_INCLUDE_DIRS
 PYTHON_EXECUTABLE
+PYTHON_RPATH
 SWIG_EXECUTABLE)
 endif()
   endif()
@@ -54,6 +72,7 @@ else()
   PYTHON_LIBRARIES
   PYTHON_INCLUDE_DIRS
   PYTHON_EXECUTABLE
+  PYTHON_RPATH
   SWIG_EXECUTABLE)
   endif()
 endif()
@@ -63,6 +82,7 @@ else()
 message(STATUS "SWIG 2 or later is required for Python support in LLDB but 
could not be found")
   endif()
 
+
   include(FindPackageHandleStandardArgs)
   find_package_handle_standard_args(PythonInterpAndLibs
 FOUND_VAR
@@ -71,5 +91,6 @@ else()
   PYTHON_LIBRARIES
   PYTHON_INCLUDE_DIRS
   PYTHON_EXECUTABLE
+  PYTHON_RPATH
   SWIG_EXECUTABLE)
 endif()

diff  --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index f8ed1b37f4fa..ae6f2e8e3251 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -120,6 +120,10 @@ if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR 
LLVM_LINK_LLVM_DYLIB) AND UNIX A
   set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH 
"\$ORIGIN/../../../../lib${LLVM_LIBDIR_SUFFIX}")
 endif()
 
+if(PYTHON_RPATH)
+  set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}")
+endif()
+
 if (MSVC)
   set_source_files_properties(SBReproducer.cpp PROPERTIES COMPILE_FLAGS 
/bigobj)
 endif()

diff  --git a/lldb/tools/lldb-test/CMakeLists.txt 
b/lldb/tools/lldb-test/CMakeLists.txt
index f3530fd7b859..60b4a7ca8f70 100644
--- a/lldb/tools/lldb-test/CMakeLists.txt
+++ b/lldb/tools/lldb-test/CMakeLists.txt
@@ -24,5 +24,9 @@ add_lldb_tool(lldb-test
 Support
   )
 
+if(PYTHON_RPATH)
+  set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH 
"${PYTHON_RPATH}")
+endif()
+
 target_include_directories(lldb-test PRIVATE ${LLDB_SOURCE_DIR}/source)
 target_include_directories(lldb-test PRIVATE ${LLDB_BINARY_DIR}/source)



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


[Lldb-commits] [lldb] 397e69d - [lldb/CMake] Don't make PYTHON_RPATH a required variable.

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T10:54:47-07:00
New Revision: 397e69dbcb49f89f12afbebf55bfe9db91bb612a

URL: 
https://github.com/llvm/llvm-project/commit/397e69dbcb49f89f12afbebf55bfe9db91bb612a
DIFF: 
https://github.com/llvm/llvm-project/commit/397e69dbcb49f89f12afbebf55bfe9db91bb612a.diff

LOG: [lldb/CMake] Don't make PYTHON_RPATH a required variable.

Added: 


Modified: 
lldb/cmake/modules/FindPythonInterpAndLibs.cmake

Removed: 




diff  --git a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake 
b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
index 5ea7aab63230..aae82a68bcfd 100644
--- a/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
+++ b/lldb/cmake/modules/FindPythonInterpAndLibs.cmake
@@ -51,7 +51,6 @@ else()
 PYTHON_LIBRARIES
 PYTHON_INCLUDE_DIRS
 PYTHON_EXECUTABLE
-PYTHON_RPATH
 SWIG_EXECUTABLE)
 endif()
   endif()
@@ -72,7 +71,6 @@ else()
   PYTHON_LIBRARIES
   PYTHON_INCLUDE_DIRS
   PYTHON_EXECUTABLE
-  PYTHON_RPATH
   SWIG_EXECUTABLE)
   endif()
 endif()
@@ -91,6 +89,5 @@ else()
   PYTHON_LIBRARIES
   PYTHON_INCLUDE_DIRS
   PYTHON_EXECUTABLE
-  PYTHON_RPATH
   SWIG_EXECUTABLE)
 endif()



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


[Lldb-commits] [lldb] 8539588 - [lldb/CMake] Set the PYTHON_RPATH for the unit tests

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T11:05:50-07:00
New Revision: 85395887837bd99689001404adcb08cd1e594cc0

URL: 
https://github.com/llvm/llvm-project/commit/85395887837bd99689001404adcb08cd1e594cc0
DIFF: 
https://github.com/llvm/llvm-project/commit/85395887837bd99689001404adcb08cd1e594cc0.diff

LOG: [lldb/CMake] Set the PYTHON_RPATH for the unit tests

The API and Python script interpreter unit tests also link against
Python and therefore need to set the RPATH when applicable.

Added: 


Modified: 
lldb/source/API/CMakeLists.txt
lldb/tools/lldb-test/CMakeLists.txt
lldb/unittests/API/CMakeLists.txt
lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt

Removed: 




diff  --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index ae6f2e8e3251..e1371fd71c02 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -121,7 +121,7 @@ if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR 
LLVM_LINK_LLVM_DYLIB) AND UNIX A
 endif()
 
 if(PYTHON_RPATH)
-  set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}")
+  set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
 endif()
 
 if (MSVC)

diff  --git a/lldb/tools/lldb-test/CMakeLists.txt 
b/lldb/tools/lldb-test/CMakeLists.txt
index 60b4a7ca8f70..8574150ab918 100644
--- a/lldb/tools/lldb-test/CMakeLists.txt
+++ b/lldb/tools/lldb-test/CMakeLists.txt
@@ -25,7 +25,7 @@ add_lldb_tool(lldb-test
   )
 
 if(PYTHON_RPATH)
-  set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH 
"${PYTHON_RPATH}")
+  set_property(TARGET lldb-test APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
 endif()
 
 target_include_directories(lldb-test PRIVATE ${LLDB_SOURCE_DIR}/source)

diff  --git a/lldb/unittests/API/CMakeLists.txt 
b/lldb/unittests/API/CMakeLists.txt
index 6f71165a8a70..308249b63add 100644
--- a/lldb/unittests/API/CMakeLists.txt
+++ b/lldb/unittests/API/CMakeLists.txt
@@ -4,3 +4,7 @@ add_lldb_unittest(APITests
   LINK_LIBS
 liblldb
   )
+
+if(PYTHON_RPATH)
+  set_property(TARGET APITests APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
+endif()

diff  --git a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt 
b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
index 471f4c6dbc35..913bd629526d 100644
--- a/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
+++ b/lldb/unittests/ScriptInterpreter/Python/CMakeLists.txt
@@ -8,4 +8,8 @@ add_lldb_unittest(ScriptInterpreterPythonTests
 LLVMTestingSupport
   LINK_COMPONENTS
 Support
-  )
\ No newline at end of file
+  )
+
+if(PYTHON_RPATH)
+  set_property(TARGET ScriptInterpreterPythonTests APPEND PROPERTY BUILD_RPATH 
"${PYTHON_RPATH}")
+endif()
\ No newline at end of file



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


[Lldb-commits] [lldb] 8e9fb84 - [lldb] Also set owning module for template specializations

2020-04-30 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2020-04-30T20:40:13+02:00
New Revision: 8e9fb845fcc42648ffa8c0c5f331f9f2f298bc89

URL: 
https://github.com/llvm/llvm-project/commit/8e9fb845fcc42648ffa8c0c5f331f9f2f298bc89
DIFF: 
https://github.com/llvm/llvm-project/commit/8e9fb845fcc42648ffa8c0c5f331f9f2f298bc89.diff

LOG: [lldb] Also set owning module for template specializations

Summary:
This was originally commented out as it broke the data-formatter-stl/libcxx/
tests. However this was fixed by commit ef423a3ba57045f80b0fcafce72121449a8b54d4
(Add Objective-C property accessors loaded from Clang module DWARF to lookup)
which sets the HasExternalVisibleStorage flag for the template specializations.

Reviewers: aprantl

Reviewed By: aprantl

Subscribers: abidh, JDevlieghere

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

Added: 


Modified: 
lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm

Removed: 




diff  --git a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp 
b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
index 7acdad2924fb..de1ce9d36b04 100644
--- a/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ b/lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1563,15 +1563,7 @@ TypeSystemClang::CreateClassTemplateSpecializationDecl(
   ast.getTypeDeclType(class_template_specialization_decl, nullptr);
   class_template_specialization_decl->setDeclName(
   class_template_decl->getDeclName());
-  // FIXME: Turning this on breaks the libcxx data formatter tests.
-  // SetOwningModule marks the Decl as external, which prevents a
-  // LookupPtr from being built. Template instantiations can also not
-  // be found by ExternalASTSource::FindExternalVisibleDeclsByName(),
-  // nor can we lazily build a LookupPtr later, because template
-  // specializations are supposed to be hidden so
-  // makeDeclVisibleInContextWithFlags() is a noop, as well.
-  //
-  // SetOwningModule(class_template_specialization_decl, owning_module);
+  SetOwningModule(class_template_specialization_decl, owning_module);
   decl_ctx->addDecl(class_template_specialization_decl);
 
   class_template_specialization_decl->setSpecializationKind(

diff  --git a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm 
b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
index b83797f503cd..f675c3aa8204 100644
--- a/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
+++ b/lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
@@ -52,10 +52,10 @@ @implementation SomeClass {
 
 // Template specializations are not yet supported, so they lack the ownership 
info:
 Template t2;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct Template
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct 
Template
 
 Namespace::InNamespace t3;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct InNamespace
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct 
InNamespace
 
 Namespace::AlsoInNamespace t4;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct AlsoInNamespace
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A.B struct 
AlsoInNamespace



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


[Lldb-commits] [PATCH] D79168: [lldb] Also set owning module for template specializations

2020-04-30 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG8e9fb845fcc4: [lldb] Also set owning module for template 
specializations (authored by teemperor).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79168/new/

https://reviews.llvm.org/D79168

Files:
  lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
  lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm


Index: lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
===
--- lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
+++ lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
@@ -52,10 +52,10 @@
 
 // Template specializations are not yet supported, so they lack the ownership 
info:
 Template t2;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct Template
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct 
Template
 
 Namespace::InNamespace t3;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct InNamespace
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct 
InNamespace
 
 Namespace::AlsoInNamespace t4;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct AlsoInNamespace
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A.B struct 
AlsoInNamespace
Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
===
--- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1563,15 +1563,7 @@
   ast.getTypeDeclType(class_template_specialization_decl, nullptr);
   class_template_specialization_decl->setDeclName(
   class_template_decl->getDeclName());
-  // FIXME: Turning this on breaks the libcxx data formatter tests.
-  // SetOwningModule marks the Decl as external, which prevents a
-  // LookupPtr from being built. Template instantiations can also not
-  // be found by ExternalASTSource::FindExternalVisibleDeclsByName(),
-  // nor can we lazily build a LookupPtr later, because template
-  // specializations are supposed to be hidden so
-  // makeDeclVisibleInContextWithFlags() is a noop, as well.
-  //
-  // SetOwningModule(class_template_specialization_decl, owning_module);
+  SetOwningModule(class_template_specialization_decl, owning_module);
   decl_ctx->addDecl(class_template_specialization_decl);
 
   class_template_specialization_decl->setSpecializationKind(


Index: lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
===
--- lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
+++ lldb/test/Shell/SymbolFile/DWARF/module-ownership.mm
@@ -52,10 +52,10 @@
 
 // Template specializations are not yet supported, so they lack the ownership info:
 Template t2;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct Template
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct Template
 
 Namespace::InNamespace t3;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct InNamespace
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A struct InNamespace
 
 Namespace::AlsoInNamespace t4;
-// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} struct AlsoInNamespace
+// CHECK-DAG: ClassTemplateSpecializationDecl {{.*}} imported in A.B struct AlsoInNamespace
Index: lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
===
--- lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
+++ lldb/source/Plugins/TypeSystem/Clang/TypeSystemClang.cpp
@@ -1563,15 +1563,7 @@
   ast.getTypeDeclType(class_template_specialization_decl, nullptr);
   class_template_specialization_decl->setDeclName(
   class_template_decl->getDeclName());
-  // FIXME: Turning this on breaks the libcxx data formatter tests.
-  // SetOwningModule marks the Decl as external, which prevents a
-  // LookupPtr from being built. Template instantiations can also not
-  // be found by ExternalASTSource::FindExternalVisibleDeclsByName(),
-  // nor can we lazily build a LookupPtr later, because template
-  // specializations are supposed to be hidden so
-  // makeDeclVisibleInContextWithFlags() is a noop, as well.
-  //
-  // SetOwningModule(class_template_specialization_decl, owning_module);
+  SetOwningModule(class_template_specialization_decl, owning_module);
   decl_ctx->addDecl(class_template_specialization_decl);
 
   class_template_specialization_decl->setSpecializationKind(
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D79108: [lldb/CommandInterpreter] Move AutoHandleEvents and SpawnThread into CommandInterpreterRunOptions (NFC)

2020-04-30 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: lldb/source/API/SBDebugger.cpp:1190
+options.SetAutoHandleEvents(auto_handle_events);
+options.SetSpawnThread(spawn_thread);
 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();

I agree this is a good idea to do in the header doc. Also might be worth 
marking this and other functions RunCommandInterpreter as deprecated and point 
them to the new way of doing things once that patch is in where everything is 
in SBCommandInterpreterRunOptions and SBCommandInterpreterRunResults


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79108/new/

https://reviews.llvm.org/D79108



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


[Lldb-commits] [PATCH] D78972: Treat hasWeakODRLinkage symbols as external in REPL computations

2020-04-30 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D78972#2012796 , @labath wrote:

> In D78972#2011571 , @jingham wrote:
>
> > That one does work all the way, including calling the function.  That 
> > should be surprising.   It shouldn't with an unpatched lldb, right?
>
>
> Yep, I realized that is not the best example after posting that comment.
>
> > We do this whole dance again every time we run this expression.  It looks 
> > like we don't look for instances of a template if we know how to make it, 
> > we just make it again.  That actually makes sense.  When you are compiling, 
> > you don't know if you will find an instantiation, so you have to make it.  
> > Then you leave it to the linker to remove duplicates.
>
> You're describing the "normal" `linkonce` semantics. Things get more complex 
> once you start having explicit instantiations: `template void f();` 
> forces a compiler to emit an instantiation even though it is not needed (this 
> results in the `weak_odr` linkage. `extern template void f();` inhibits 
> instantiation -- the compiler will assume you have an explicit instantiation 
> elsewhere. The fact that the explicit instantiation is "weak" allows for some 
> interesting effects, but it's tricky to demonstrate them, as they all involve 
> UB. Once can see some of that with normal compilation like this:
>
>   $ head a.cc b.cc c.cc
>   ==> a.cc <==
>   #include 
>  
>   template void f() { printf("Hello T\n"); }
>  
>   template void f(); // weak
>  
>   ==> b.cc <==
>   #include 
>  
>   extern "C" void _Z1fIiEvv() { printf("Hello _Z1fIiEvv\n"); } // strong
>  
>   ==> c.cc <==
>   #include 
>  
>   template void f() { printf("Hello T\n"); }
>  
>   extern template void f(); // inhibit instantiation
>  
>   int main() {
> f();
>   }
>   $ c++ a.cc c.cc
>   $ ./a.out 
>   Hello T
>   $ c++ a.cc c.cc b.cc
>   $ ./a.out 
>   Hello _Z1fIiEvv
>
>
> I don't know whether any of this is relevant for top-level expressions.


Thanks for the explanation!

I think if you are bothering to create a template in --top-level your intent 
was to create something new.  So the current setup, which will always emit an 
instantiation from the template that was injected into the Expression 
ASTContext, means subsequent experiments will use this version, which seems 
closest to that intent.  That is certainly what happens today.  If I build 
either version of the example above and do:

  (lldb) expr --top-level -- template void f() { (void) 
printf("Hello EXPR\n"); }
  (lldb) expr f()
  Hello EXPR

That behavior is unsurprisingly not affected by this patch.

I guess another use case might be "change all uses of this template function 
throughout the program to point to this new body".  But can we even do that 
reliably?  The linker has already resolved all the extant references to 
whichever of these symbols it decided should win.  We'd have to interpose on 
that choice after the fact, which we don't do anywhere else, and seems tricky 
to get right.

So I think the current behavior is the best we can do.

> Incidentally it looks like we have a problem with function template 
> specializations in top-level expressions, though I don't think that is 
> related to this patch in any way:
> 
>   (lldb) expr --top-level --
>   Enter expressions, then terminate with an empty line to evaluate:
> 1: template void f() { (void) printf("Hello T\n"); } 
> 2: template<> void f() { (void) printf("Hello int\n"); } 
> 3: void g() { f(); } 
>   (lldb) p g()
>   Hello int
>   (lldb) p f()
>   Hello T

The f() specialization here emitted with external linkage, which makes 
sense.  So that does not seem related.  We need to be a smarter linker but it 
doesn't look like we remember the linkage of symbols made in expressions so we 
don't have the data to do this right as it stands.

>> Note that this is all about creating new code in a running program, and it 
>> almost seems like you really should use the new version you created if it is 
>> any different.  Or anyway, it's not entirely clear what the rule should be.  
>> And anyway, the thing we have to do is not NOT export these symbols, it is 
>> really "figure out if they exist somewhere else and are equivalent" and use 
>> those, otherwise export these.  Since I don't yet have an example where 
>> there are two versions that would get used, I don't want to try to write 
>> code to do that blind.
> 
> Yep, at this point I am pretty lost about what should be the correct 
> behavior, and whether the change is detectable with c++. However, I don't 
> like the fact that the change has no test coverage.

Well, there will be a swift test.  I do have a case there where this is 
detectible.  That's not entirely satisfactory, but it doesn't look like we can 
come up with something in C++ which we can actually use to test this.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.l

[Lldb-commits] [lldb] 32c3224 - [lldb/CommandInterpreter] Move everything into CommandInterpreterRunOptions

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T13:20:06-07:00
New Revision: 32c3224612d84ee7e65907795eaba505f5c90e7c

URL: 
https://github.com/llvm/llvm-project/commit/32c3224612d84ee7e65907795eaba505f5c90e7c
DIFF: 
https://github.com/llvm/llvm-project/commit/32c3224612d84ee7e65907795eaba505f5c90e7c.diff

LOG: [lldb/CommandInterpreter] Move everything into CommandInterpreterRunOptions

This implements Greg's suggestion from D78825 to include "auto handle
events" and "spawn thread" in CommandInterpreterRunOptions. This change
is in preparation for adding a new overload for RunCommandInterpreter
that takes only SBCommandInterpreterRunOptions and returns
SBCommandInterpreterRunResults.

Differential revision: https://reviews.llvm.org/D79108

Added: 


Modified: 
lldb/include/lldb/API/SBCommandInterpreter.h
lldb/include/lldb/API/SBDebugger.h
lldb/include/lldb/Interpreter/CommandInterpreter.h
lldb/source/API/SBCommandInterpreter.cpp
lldb/source/API/SBDebugger.cpp
lldb/source/Interpreter/CommandInterpreter.cpp

Removed: 




diff  --git a/lldb/include/lldb/API/SBCommandInterpreter.h 
b/lldb/include/lldb/API/SBCommandInterpreter.h
index e07eeb58bf6a..9817794ff954 100644
--- a/lldb/include/lldb/API/SBCommandInterpreter.h
+++ b/lldb/include/lldb/API/SBCommandInterpreter.h
@@ -52,6 +52,14 @@ class LLDB_API SBCommandInterpreterRunOptions {
 
   void SetAddToHistory(bool);
 
+  bool GetAutoHandleEvents() const;
+
+  void SetAutoHandleEvents(bool);
+
+  bool GetSpawnThread() const;
+
+  void SetSpawnThread(bool);
+
 private:
   lldb_private::CommandInterpreterRunOptions *get() const;
 

diff  --git a/lldb/include/lldb/API/SBDebugger.h 
b/lldb/include/lldb/API/SBDebugger.h
index 21fe77fa4f15..6f585540dd34 100644
--- a/lldb/include/lldb/API/SBDebugger.h
+++ b/lldb/include/lldb/API/SBDebugger.h
@@ -290,8 +290,42 @@ class LLDB_API SBDebugger {
 
   SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier);
 
+  /// Run the command interpreter.
+  ///
+  /// \param[in] auto_handle_events
+  /// If true, automatically handle resulting events. This takes precedence
+  /// and overrides the corresponding option in
+  /// SBCommandInterpreterRunOptions.
+  ///
+  /// \param[in] spawn_thread
+  /// If true, start a new thread for IO handling. This takes precedence
+  /// and overrides the corresponding option in
+  /// SBCommandInterpreterRunOptions.
   void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread);
 
+  /// Run the command interpreter.
+  ///
+  /// \param[in] auto_handle_events
+  /// If true, automatically handle resulting events. This takes precedence
+  /// and overrides the corresponding option in
+  /// SBCommandInterpreterRunOptions.
+  ///
+  /// \param[in] spawn_thread
+  /// If true, start a new thread for IO handling. This takes precedence
+  /// and overrides the corresponding option in
+  /// SBCommandInterpreterRunOptions.
+  ///
+  /// \param[in] options
+  /// Parameter collection of type SBCommandInterpreterRunOptions.
+  ///
+  /// \param[out] num_errors
+  /// The number of errors.
+  ///
+  /// \param[out] quit_requested
+  /// Whether a quit was requested.
+  ///
+  /// \param[out] stopped_for_crash
+  /// Whether the interpreter stopped for a crash.
   void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread,
  SBCommandInterpreterRunOptions &options,
  int &num_errors, bool &quit_requested,

diff  --git a/lldb/include/lldb/Interpreter/CommandInterpreter.h 
b/lldb/include/lldb/Interpreter/CommandInterpreter.h
index 6a2ffc09cdd7..c65075cad966 100644
--- a/lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ b/lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -144,6 +144,20 @@ class CommandInterpreterRunOptions {
 m_add_to_history = add_to_history ? eLazyBoolYes : eLazyBoolNo;
   }
 
+  bool GetAutoHandleEvents() const {
+return DefaultToYes(m_auto_handle_events);
+  }
+
+  void SetAutoHandleEvents(bool auto_handle_events) {
+m_auto_handle_events = auto_handle_events ? eLazyBoolYes : eLazyBoolNo;
+  }
+
+  bool GetSpawnThread() const { return DefaultToNo(m_spawn_thread); }
+
+  void SetSpawnThread(bool spawn_thread) {
+m_spawn_thread = spawn_thread ? eLazyBoolYes : eLazyBoolNo;
+  }
+
   LazyBool m_stop_on_continue;
   LazyBool m_stop_on_error;
   LazyBool m_stop_on_crash;
@@ -152,6 +166,8 @@ class CommandInterpreterRunOptions {
   LazyBool m_print_results;
   LazyBool m_print_errors;
   LazyBool m_add_to_history;
+  LazyBool m_auto_handle_events;
+  LazyBool m_spawn_thread;
 
 private:
   static bool DefaultToYes(LazyBool flag) {
@@ -426,8 +442,7 @@ class CommandInterpreter : public Broadcaster,
 
   bool IsActive();
 
-  void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread,
- Com

[Lldb-commits] [lldb] 21afedd - [lldb/CMake] Use INSTALL_RPATH for tools and BUILD_RPATH for unittests.

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T13:20:06-07:00
New Revision: 21afeddfb25fbde260f84ee6ceaa61e761c1e48c

URL: 
https://github.com/llvm/llvm-project/commit/21afeddfb25fbde260f84ee6ceaa61e761c1e48c
DIFF: 
https://github.com/llvm/llvm-project/commit/21afeddfb25fbde260f84ee6ceaa61e761c1e48c.diff

LOG: [lldb/CMake] Use INSTALL_RPATH for tools and BUILD_RPATH for unittests.

It seems like only the unittests are building with
BUILD_WITH_INSTALL_RPATH set to OFF. Of course when I did my last change
I only ran check-lldb-unit. Not sure why this difference exists, why
would you even install the unittest?

For the LLDB framework we do need different build and install RPATHs.
Currently that logic lives downstream. I plan to upstream that in the
near future. For now I'm just trying to make it possible to run the
test.

Added: 


Modified: 
lldb/source/API/CMakeLists.txt
lldb/tools/lldb-test/CMakeLists.txt

Removed: 




diff  --git a/lldb/source/API/CMakeLists.txt b/lldb/source/API/CMakeLists.txt
index e1371fd71c02..ae6f2e8e3251 100644
--- a/lldb/source/API/CMakeLists.txt
+++ b/lldb/source/API/CMakeLists.txt
@@ -121,7 +121,7 @@ if(LLDB_ENABLE_PYTHON AND (BUILD_SHARED_LIBS OR 
LLVM_LINK_LLVM_DYLIB) AND UNIX A
 endif()
 
 if(PYTHON_RPATH)
-  set_property(TARGET liblldb APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
+  set_property(TARGET liblldb APPEND PROPERTY INSTALL_RPATH "${PYTHON_RPATH}")
 endif()
 
 if (MSVC)

diff  --git a/lldb/tools/lldb-test/CMakeLists.txt 
b/lldb/tools/lldb-test/CMakeLists.txt
index 8574150ab918..60b4a7ca8f70 100644
--- a/lldb/tools/lldb-test/CMakeLists.txt
+++ b/lldb/tools/lldb-test/CMakeLists.txt
@@ -25,7 +25,7 @@ add_lldb_tool(lldb-test
   )
 
 if(PYTHON_RPATH)
-  set_property(TARGET lldb-test APPEND PROPERTY BUILD_RPATH "${PYTHON_RPATH}")
+  set_property(TARGET lldb-test APPEND PROPERTY INSTALL_RPATH 
"${PYTHON_RPATH}")
 endif()
 
 target_include_directories(lldb-test PRIVATE ${LLDB_SOURCE_DIR}/source)



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


[Lldb-commits] [PATCH] D79108: [lldb/CommandInterpreter] Move AutoHandleEvents and SpawnThread into CommandInterpreterRunOptions (NFC)

2020-04-30 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG32c3224612d8: [lldb/CommandInterpreter] Move everything into 
CommandInterpreterRunOptions (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D79108?vs=260978&id=261334#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79108/new/

https://reviews.llvm.org/D79108

Files:
  lldb/include/lldb/API/SBCommandInterpreter.h
  lldb/include/lldb/API/SBDebugger.h
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/source/API/SBCommandInterpreter.cpp
  lldb/source/API/SBDebugger.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp

Index: lldb/source/Interpreter/CommandInterpreter.cpp
===
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -2951,7 +2951,6 @@
 }
 
 void CommandInterpreter::RunCommandInterpreter(
-bool auto_handle_events, bool spawn_thread,
 CommandInterpreterRunOptions &options) {
   // Always re-create the command interpreter when we run it in case any file
   // handles have changed.
@@ -2959,15 +2958,15 @@
   m_debugger.RunIOHandlerAsync(GetIOHandler(force_create, &options));
   m_stopped_for_crash = false;
 
-  if (auto_handle_events)
+  if (options.GetAutoHandleEvents())
 m_debugger.StartEventHandlerThread();
 
-  if (spawn_thread) {
+  if (options.GetSpawnThread()) {
 m_debugger.StartIOHandlerThread();
   } else {
 m_debugger.RunIOHandlers();
 
-if (auto_handle_events)
+if (options.GetAutoHandleEvents())
   m_debugger.StopEventHandlerThread();
   }
 }
Index: lldb/source/API/SBDebugger.cpp
===
--- lldb/source/API/SBDebugger.cpp
+++ lldb/source/API/SBDebugger.cpp
@@ -1166,9 +1166,9 @@
 
   if (m_opaque_sp) {
 CommandInterpreterRunOptions options;
-
-m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(
-auto_handle_events, spawn_thread, options);
+options.SetAutoHandleEvents(auto_handle_events);
+options.SetSpawnThread(spawn_thread);
+m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
   }
 }
 
@@ -1186,9 +1186,10 @@
  quit_requested, stopped_for_crash);
 
   if (m_opaque_sp) {
+options.SetAutoHandleEvents(auto_handle_events);
+options.SetSpawnThread(spawn_thread);
 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
-interp.RunCommandInterpreter(auto_handle_events, spawn_thread,
- options.ref());
+interp.RunCommandInterpreter(options.ref());
 num_errors = interp.GetNumErrors();
 quit_requested = interp.GetQuitRequested();
 stopped_for_crash = interp.GetStoppedForCrash();
Index: lldb/source/API/SBCommandInterpreter.cpp
===
--- lldb/source/API/SBCommandInterpreter.cpp
+++ lldb/source/API/SBCommandInterpreter.cpp
@@ -137,6 +137,35 @@
   m_opaque_up->SetAddToHistory(add_to_history);
 }
 
+bool SBCommandInterpreterRunOptions::GetAutoHandleEvents() const {
+  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions,
+   GetAutoHandleEvents);
+
+  return m_opaque_up->GetAutoHandleEvents();
+}
+
+void SBCommandInterpreterRunOptions::SetAutoHandleEvents(
+bool auto_handle_events) {
+  LLDB_RECORD_METHOD(void, SBCommandInterpreterRunOptions, SetAutoHandleEvents,
+ (bool), auto_handle_events);
+
+  m_opaque_up->SetAutoHandleEvents(auto_handle_events);
+}
+
+bool SBCommandInterpreterRunOptions::GetSpawnThread() const {
+  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions,
+   GetSpawnThread);
+
+  return m_opaque_up->GetSpawnThread();
+}
+
+void SBCommandInterpreterRunOptions::SetSpawnThread(bool spawn_thread) {
+  LLDB_RECORD_METHOD(void, SBCommandInterpreterRunOptions, SetSpawnThread,
+ (bool), spawn_thread);
+
+  m_opaque_up->SetSpawnThread(spawn_thread);
+}
+
 lldb_private::CommandInterpreterRunOptions *
 SBCommandInterpreterRunOptions::get() const {
   return m_opaque_up.get();
@@ -892,6 +921,14 @@
  GetAddToHistory, ());
   LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetAddToHistory,
(bool));
+  LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions,
+ GetAutoHandleEvents, ());
+  LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions,
+   SetAutoHandleEvents, (bool));
+  LLDB_REGISTER_METHOD_CONST(bool, SBCommandInterpreterRunOptions,
+ GetSpawnThread, ());
+  LLDB_REGISTER_METHOD(void, SBCommandInterpreterRunOptions, SetSpawnThread,
+   (bool));
   LLDB_REGISTER_CONS

[Lldb-commits] [lldb] 4b35403 - [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC)

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T13:41:21-07:00
New Revision: 4b354039423f2a4d50cf70564faf52d8bb8a6fe3

URL: 
https://github.com/llvm/llvm-project/commit/4b354039423f2a4d50cf70564faf52d8bb8a6fe3
DIFF: 
https://github.com/llvm/llvm-project/commit/4b354039423f2a4d50cf70564faf52d8bb8a6fe3.diff

LOG: [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC)

Currently, `SBCommandInterpreterRunOptions` is defined in
`SBCommandInterpreter.h`. Given that the options are always passed by
reference, a forward declaration is sufficient.

That's not the case for `SBCommandInterpreterRunResults`, which we need
for a new overload for `RunCommandInterpreter` and that returns this new
class by value. We can't include `SBCommandInterpreter.h` because
`SBCommandInterpreter::GetDebugger()` returns SBDebugger by value and
therefore needs a full definition.

This patch moves the definition of `SBCommandInterpreterRunOptions` into
a new header. In a later patch,  `SBCommandInterpreterRunResults` will
be defined in there as well, solving the aforementioned problem.

Differential revision: https://reviews.llvm.org/D79115

Added: 
lldb/bindings/interface/SBCommandInterpreterRunOptions.i
lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
lldb/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
lldb/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
lldb/lldb/source/API/SBCommandInterpreterRunOptions.cpp
lldb/source/API/SBCommandInterpreterRunOptions.cpp

Modified: 
lldb/bindings/headers.swig
lldb/bindings/interface/SBCommandInterpreter.i
lldb/bindings/interfaces.swig
lldb/include/lldb/API/SBCommandInterpreter.h
lldb/source/API/CMakeLists.txt
lldb/source/API/SBCommandInterpreter.cpp
lldb/source/API/SBDebugger.cpp
lldb/source/API/SBReproducer.cpp
lldb/tools/driver/Driver.cpp

Removed: 




diff  --git a/lldb/bindings/headers.swig b/lldb/bindings/headers.swig
index 42ccd36c9607..6e1668ea4c42 100644
--- a/lldb/bindings/headers.swig
+++ b/lldb/bindings/headers.swig
@@ -15,6 +15,7 @@
 #include "lldb/API/SBBreakpointName.h"
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandInterpreterRunOptions.h"
 #include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBCommunication.h"
 #include "lldb/API/SBCompileUnit.h"

diff  --git a/lldb/bindings/interface/SBCommandInterpreter.i 
b/lldb/bindings/interface/SBCommandInterpreter.i
index ad2e8f1662cd..498084ae3ab1 100644
--- a/lldb/bindings/interface/SBCommandInterpreter.i
+++ b/lldb/bindings/interface/SBCommandInterpreter.i
@@ -8,70 +8,6 @@
 
 namespace lldb {
 
-%feature("docstring",
-"SBCommandInterpreterRunOptions controls how the RunCommandInterpreter runs 
the code it is fed.
-A default SBCommandInterpreterRunOptions object has:
-StopOnContinue: false
-StopOnError:false
-StopOnCrash:false
-EchoCommands:   true
-PrintResults:   true
-AddToHistory:   true
-
-") SBCommandInterpreterRunOptions;
-class SBCommandInterpreterRunOptions
-{
-friend class SBDebugger;
-public:
-SBCommandInterpreterRunOptions();
-~SBCommandInterpreterRunOptions();
-
-bool
-GetStopOnContinue () const;
-
-void
-SetStopOnContinue (bool);
-
-bool
-GetStopOnError () const;
-
-void
-SetStopOnError (bool);
-
-bool
-GetStopOnCrash () const;
-
-void
-SetStopOnCrash (bool);
-
-bool
-GetEchoCommands () const;
-
-void
-SetEchoCommands (bool);
-
-bool
-GetPrintResults () const;
-
-void
-SetPrintResults (bool);
-
-bool
-GetAddToHistory () const;
-
-void
-SetAddToHistory (bool);
-private:
-lldb_private::CommandInterpreterRunOptions *
-get () const;
-
-lldb_private::CommandInterpreterRunOptions &
-ref () const;
-
-// This is set in the constructor and will always be valid.
-mutable std::unique_ptr 
m_opaque_up;
-};
-
 %feature("docstring",
 "SBCommandInterpreter handles/interprets commands for lldb.  You get the
 command interpreter from the SBDebugger instance. For example (from test/

diff  --git a/lldb/bindings/interface/SBCommandInterpreterRunOptions.i 
b/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
new file mode 100644
index ..f9ccbbd24dbe
--- /dev/null
+++ b/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
@@ -0,0 +1,75 @@
+//===-- SWIG Interface for SBCommandInterpreter -*- C++ 
-*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+namespace lldb {
+
+%feature("docstring",
+"SBCommandInterpreterRunOptions controls how the RunCommandInter

[Lldb-commits] [PATCH] D79115: [lldb/API] Move SBCommandInterpreterRunOption in its own header. (NFC)

2020-04-30 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG4b354039423f: [lldb/API] Move SBCommandInterpreterRunOption 
in its own header. (NFC) (authored by JDevlieghere).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D79115?vs=260984&id=261346#toc

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79115/new/

https://reviews.llvm.org/D79115

Files:
  lldb/bindings/headers.swig
  lldb/bindings/interface/SBCommandInterpreter.i
  lldb/bindings/interface/SBCommandInterpreterRunOptions.i
  lldb/bindings/interfaces.swig
  lldb/include/lldb/API/SBCommandInterpreter.h
  lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
  lldb/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
  lldb/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
  lldb/lldb/source/API/SBCommandInterpreterRunOptions.cpp
  lldb/source/API/CMakeLists.txt
  lldb/source/API/SBCommandInterpreter.cpp
  lldb/source/API/SBCommandInterpreterRunOptions.cpp
  lldb/source/API/SBDebugger.cpp
  lldb/source/API/SBReproducer.cpp
  lldb/tools/driver/Driver.cpp

Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -9,6 +9,7 @@
 #include "Driver.h"
 
 #include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandInterpreterRunOptions.h"
 #include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBFile.h"
Index: lldb/source/API/SBReproducer.cpp
===
--- lldb/source/API/SBReproducer.cpp
+++ lldb/source/API/SBReproducer.cpp
@@ -15,6 +15,7 @@
 #include "lldb/API/SBBlock.h"
 #include "lldb/API/SBBreakpoint.h"
 #include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandInterpreterRunOptions.h"
 #include "lldb/API/SBData.h"
 #include "lldb/API/SBDebugger.h"
 #include "lldb/API/SBDeclaration.h"
@@ -40,6 +41,7 @@
   RegisterMethods(R);
   RegisterMethods(R);
   RegisterMethods(R);
+  RegisterMethods(R);
   RegisterMethods(R);
   RegisterMethods(R);
   RegisterMethods(R);
Index: lldb/source/API/SBDebugger.cpp
===
--- lldb/source/API/SBDebugger.cpp
+++ lldb/source/API/SBDebugger.cpp
@@ -15,6 +15,7 @@
 
 #include "lldb/API/SBBroadcaster.h"
 #include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandInterpreterRunOptions.h"
 #include "lldb/API/SBCommandReturnObject.h"
 #include "lldb/API/SBError.h"
 #include "lldb/API/SBEvent.h"
Index: lldb/source/API/SBCommandInterpreterRunOptions.cpp
===
--- /dev/null
+++ lldb/source/API/SBCommandInterpreterRunOptions.cpp
@@ -0,0 +1,210 @@
+//===-- SBCommandInterpreterRunOptions.cpp ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "lldb/lldb-types.h"
+
+#include "SBReproducerPrivate.h"
+
+#include "lldb/API/SBCommandInterpreterRunOptions.h"
+#include "lldb/Interpreter/CommandInterpreter.h"
+
+#include 
+
+using namespace lldb;
+using namespace lldb_private;
+
+SBCommandInterpreterRunOptions::SBCommandInterpreterRunOptions() {
+  LLDB_RECORD_CONSTRUCTOR_NO_ARGS(SBCommandInterpreterRunOptions);
+
+  m_opaque_up.reset(new CommandInterpreterRunOptions());
+}
+
+SBCommandInterpreterRunOptions::~SBCommandInterpreterRunOptions() = default;
+
+bool SBCommandInterpreterRunOptions::GetStopOnContinue() const {
+  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions,
+   GetStopOnContinue);
+
+  return m_opaque_up->GetStopOnContinue();
+}
+
+void SBCommandInterpreterRunOptions::SetStopOnContinue(bool stop_on_continue) {
+  LLDB_RECORD_METHOD(void, SBCommandInterpreterRunOptions, SetStopOnContinue,
+ (bool), stop_on_continue);
+
+  m_opaque_up->SetStopOnContinue(stop_on_continue);
+}
+
+bool SBCommandInterpreterRunOptions::GetStopOnError() const {
+  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions,
+   GetStopOnError);
+
+  return m_opaque_up->GetStopOnError();
+}
+
+void SBCommandInterpreterRunOptions::SetStopOnError(bool stop_on_error) {
+  LLDB_RECORD_METHOD(void, SBCommandInterpreterRunOptions, SetStopOnError,
+ (bool), stop_on_error);
+
+  m_opaque_up->SetStopOnError(stop_on_error);
+}
+
+bool SBCommandInterpreterRunOptions::GetStopOnCrash() const {
+  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBCommandInterpreterRunOptions,
+   GetStopOnCrash);
+
+  return m_opaque_up->GetStopOnCra

[Lldb-commits] [lldb] c286665 - [lldb] Remove lldb/lldb subdirectory

2020-04-30 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2020-04-30T14:55:24-07:00
New Revision: c286665af337091bf749d881de5792f4fb7bd8e2

URL: 
https://github.com/llvm/llvm-project/commit/c286665af337091bf749d881de5792f4fb7bd8e2
DIFF: 
https://github.com/llvm/llvm-project/commit/c286665af337091bf749d881de5792f4fb7bd8e2.diff

LOG: [lldb] Remove lldb/lldb subdirectory

A patch command with the wrong -p value (strip prefix) created the
nested lldb folder.

Added: 


Modified: 


Removed: 
lldb/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
lldb/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
lldb/lldb/source/API/SBCommandInterpreterRunOptions.cpp



diff  --git a/lldb/lldb/bindings/interface/SBCommandInterpreterRunOptions.i 
b/lldb/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
deleted file mode 100644
index f9ccbbd24dbe..
--- a/lldb/lldb/bindings/interface/SBCommandInterpreterRunOptions.i
+++ /dev/null
@@ -1,75 +0,0 @@
-//===-- SWIG Interface for SBCommandInterpreter -*- C++ 
-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-namespace lldb {
-
-%feature("docstring",
-"SBCommandInterpreterRunOptions controls how the RunCommandInterpreter runs 
the code it is fed.
-A default SBCommandInterpreterRunOptions object has:
-StopOnContinue: false
-StopOnError:false
-StopOnCrash:false
-EchoCommands:   true
-PrintResults:   true
-AddToHistory:   true
-
-") SBCommandInterpreterRunOptions;
-class SBCommandInterpreterRunOptions
-{
-friend class SBDebugger;
-public:
-SBCommandInterpreterRunOptions();
-~SBCommandInterpreterRunOptions();
-
-bool
-GetStopOnContinue () const;
-
-void
-SetStopOnContinue (bool);
-
-bool
-GetStopOnError () const;
-
-void
-SetStopOnError (bool);
-
-bool
-GetStopOnCrash () const;
-
-void
-SetStopOnCrash (bool);
-
-bool
-GetEchoCommands () const;
-
-void
-SetEchoCommands (bool);
-
-bool
-GetPrintResults () const;
-
-void
-SetPrintResults (bool);
-
-bool
-GetAddToHistory () const;
-
-void
-SetAddToHistory (bool);
-private:
-lldb_private::CommandInterpreterRunOptions *
-get () const;
-
-lldb_private::CommandInterpreterRunOptions &
-ref () const;
-
-// This is set in the constructor and will always be valid.
-mutable std::unique_ptr 
m_opaque_up;
-};
-
-} // namespace lldb

diff  --git a/lldb/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h 
b/lldb/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
deleted file mode 100644
index ea23aefb3a01..
--- a/lldb/lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
+++ /dev/null
@@ -1,74 +0,0 @@
-//===-- SBCommandInterpreterRunOptions.h *- C++ 
-*-===//
-//
-// Part of the LLVM Project, under the Apache License v2.0 with LLVM 
Exceptions.
-// See https://llvm.org/LICENSE.txt for license information.
-// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
-//
-//===--===//
-
-#ifndef LLDB_API_SBCOMMANDINTERPRETERRUNOPTIONS_H
-#define LLDB_API_SBCOMMANDINTERPRETERRUNOPTIONS_H
-
-#include 
-
-#include "lldb/API/SBDefines.h"
-
-namespace lldb {
-
-class LLDB_API SBCommandInterpreterRunOptions {
-  friend class SBDebugger;
-  friend class SBCommandInterpreter;
-
-public:
-  SBCommandInterpreterRunOptions();
-  ~SBCommandInterpreterRunOptions();
-
-  bool GetStopOnContinue() const;
-
-  void SetStopOnContinue(bool);
-
-  bool GetStopOnError() const;
-
-  void SetStopOnError(bool);
-
-  bool GetStopOnCrash() const;
-
-  void SetStopOnCrash(bool);
-
-  bool GetEchoCommands() const;
-
-  void SetEchoCommands(bool);
-
-  bool GetEchoCommentCommands() const;
-
-  void SetEchoCommentCommands(bool echo);
-
-  bool GetPrintResults() const;
-
-  void SetPrintResults(bool);
-
-  bool GetAddToHistory() const;
-
-  void SetAddToHistory(bool);
-
-  bool GetAutoHandleEvents() const;
-
-  void SetAutoHandleEvents(bool);
-
-  bool GetSpawnThread() const;
-
-  void SetSpawnThread(bool);
-
-private:
-  lldb_private::CommandInterpreterRunOptions *get() const;
-
-  lldb_private::CommandInterpreterRunOptions &ref() const;
-
-  // This is set in the constructor and will always be valid.
-  mutable std::unique_ptr
-  m_opaque_up;
-};
-
-} // namespace lldb
-
-#endif // LLDB_API_SBCOMMANDINTERPRETERRUNOPTIONS_H

diff  --git a/lldb/lldb/source/API/SBCommandInterpreterRunOptions.cpp 
b/lldb/lldb/source/API/SBCommandInterpreterRunOptions.cpp
deleted file mode 100644
index 9ff017420c4e..
--- a/lldb/lldb/source/API/SBComman

[Lldb-commits] [PATCH] D79209: [lldb/CommandInterpreter] Add CommandInterpreterRunResult (NFC)

2020-04-30 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: clayborg, labath.
JDevlieghere edited the summary of this revision.

This patch adds a new class `CommandInterpreterRunResult` which will be backing 
the `SBCommandInterpreterRunResult`. It keeps track of the number of errors as 
well as the result which is an enum, as proposed by Pavel in D79120 
. The command interpreter now populates the 
results directly, instead of its own member variables.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D79209

Files:
  lldb/include/lldb/Interpreter/CommandInterpreter.h
  lldb/include/lldb/lldb-enumerations.h
  lldb/source/API/SBDebugger.cpp
  lldb/source/Interpreter/CommandInterpreter.cpp

Index: lldb/source/Interpreter/CommandInterpreter.cpp
===
--- lldb/source/Interpreter/CommandInterpreter.cpp
+++ lldb/source/Interpreter/CommandInterpreter.cpp
@@ -116,8 +116,7 @@
   m_skip_lldbinit_files(false), m_skip_app_init_files(false),
   m_command_io_handler_sp(), m_comment_char('#'),
   m_batch_command_mode(false), m_truncation_warning(eNoTruncation),
-  m_command_source_depth(0), m_num_errors(0), m_quit_requested(false),
-  m_stopped_for_crash(false) {
+  m_command_source_depth(0) {
   SetEventName(eBroadcastBitThreadShouldExit, "thread-should-exit");
   SetEventName(eBroadcastBitResetPrompt, "reset-prompt");
   SetEventName(eBroadcastBitQuitCommandReceived, "quit");
@@ -2816,23 +2815,24 @@
 break;
 
   case eReturnStatusFailed:
-m_num_errors++;
+m_result.IncrementNumberOfErrors();
 if (io_handler.GetFlags().Test(eHandleCommandFlagStopOnError))
   io_handler.SetIsDone(true);
 break;
 
   case eReturnStatusQuit:
-m_quit_requested = true;
+m_result.SetResult(lldb::eCommandInterpreterResultQuitRequested);
 io_handler.SetIsDone(true);
 break;
   }
 
   // Finally, if we're going to stop on crash, check that here:
-  if (!m_quit_requested && result.GetDidChangeProcessState() &&
+  if (m_result.IsResult(lldb::eCommandInterpreterResultSuccess) &&
+  result.GetDidChangeProcessState() &&
   io_handler.GetFlags().Test(eHandleCommandFlagStopOnCrash) &&
   DidProcessStopAbnormally()) {
 io_handler.SetIsDone(true);
-m_stopped_for_crash = true;
+m_result.SetResult(lldb::eCommandInterpreterResultInferiorCrash);
   }
 }
 
@@ -2950,13 +2950,13 @@
   return m_command_io_handler_sp;
 }
 
-void CommandInterpreter::RunCommandInterpreter(
+CommandInterpreterRunResult CommandInterpreter::RunCommandInterpreter(
 CommandInterpreterRunOptions &options) {
   // Always re-create the command interpreter when we run it in case any file
   // handles have changed.
   bool force_create = true;
   m_debugger.RunIOHandlerAsync(GetIOHandler(force_create, &options));
-  m_stopped_for_crash = false;
+  m_result = CommandInterpreterRunResult();
 
   if (options.GetAutoHandleEvents())
 m_debugger.StartEventHandlerThread();
@@ -2969,6 +2969,8 @@
 if (options.GetAutoHandleEvents())
   m_debugger.StopEventHandlerThread();
   }
+
+  return m_result;
 }
 
 CommandObject *
Index: lldb/source/API/SBDebugger.cpp
===
--- lldb/source/API/SBDebugger.cpp
+++ lldb/source/API/SBDebugger.cpp
@@ -1190,10 +1190,13 @@
 options.SetAutoHandleEvents(auto_handle_events);
 options.SetSpawnThread(spawn_thread);
 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
-interp.RunCommandInterpreter(options.ref());
-num_errors = interp.GetNumErrors();
-quit_requested = interp.GetQuitRequested();
-stopped_for_crash = interp.GetStoppedForCrash();
+CommandInterpreterRunResult result =
+interp.RunCommandInterpreter(options.ref());
+num_errors = result.GetNumErrors();
+quit_requested =
+result.IsResult(lldb::eCommandInterpreterResultQuitRequested);
+stopped_for_crash =
+result.IsResult(lldb::eCommandInterpreterResultInferiorCrash);
   }
 }
 
Index: lldb/include/lldb/lldb-enumerations.h
===
--- lldb/include/lldb/lldb-enumerations.h
+++ lldb/include/lldb/lldb-enumerations.h
@@ -1081,6 +1081,13 @@
   eTypeSummaryCapped = true,
   eTypeSummaryUncapped = false
 };
+
+enum CommandInterpreterResult {
+  eCommandInterpreterResultSuccess,
+  eCommandInterpreterResultInferiorCrash,
+  eCommandInterpreterResultCommandError,
+  eCommandInterpreterResultQuitRequested,
+};
 } // namespace lldb
 
 #endif // LLDB_LLDB_ENUMERATIONS_H
Index: lldb/include/lldb/Interpreter/CommandInterpreter.h
===
--- lldb/include/lldb/Interpreter/CommandInterpreter.h
+++ lldb/include/lldb/Interpreter/CommandInterpreter.h
@@ -26,6 +26,32 @@
 #include 
 
 namespace lldb_private {
+class CommandInterpreter;
+
+class CommandInterpreterRunResult {

[Lldb-commits] [PATCH] D79120: [lldb/API] Add RunCommandInterpreter overload that returns SBCommandInterpreterRunResults (NFC)

2020-04-30 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 261382.
JDevlieghere marked 2 inline comments as done.

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79120/new/

https://reviews.llvm.org/D79120

Files:
  lldb/include/lldb/API/SBCommandInterpreterRunOptions.h
  lldb/include/lldb/API/SBDebugger.h
  lldb/include/lldb/API/SBDefines.h
  lldb/source/API/SBCommandInterpreterRunOptions.cpp
  lldb/source/API/SBDebugger.cpp
  lldb/tools/driver/Driver.cpp

Index: lldb/tools/driver/Driver.cpp
===
--- lldb/tools/driver/Driver.cpp
+++ lldb/tools/driver/Driver.cpp
@@ -588,10 +588,7 @@
   const char *commands_data = commands_stream.GetData();
   const size_t commands_size = commands_stream.GetSize();
 
-  // The command file might have requested that we quit, this variable will
-  // track that.
-  bool quit_requested = false;
-  bool stopped_for_crash = false;
+  bool go_interactive = true;
   if ((commands_data != nullptr) && (commands_size != 0u)) {
 FILE *commands_file =
 PrepareCommandsForSourcing(commands_data, commands_size);
@@ -603,23 +600,27 @@
 
 m_debugger.SetInputFileHandle(commands_file, true);
 
-// Set the debugger into Sync mode when running the command file.
-// Otherwise command files
-// that run the target won't run in a sensible way.
+// Set the debugger into Sync mode when running the command file. Otherwise
+// command files that run the target won't run in a sensible way.
 bool old_async = m_debugger.GetAsync();
 m_debugger.SetAsync(false);
-int num_errors = 0;
 
 SBCommandInterpreterRunOptions options;
+options.SetAutoHandleEvents(true);
+options.SetSpawnThread(false);
 options.SetStopOnError(true);
-if (m_option_data.m_batch)
-  options.SetStopOnCrash(true);
-
-m_debugger.RunCommandInterpreter(handle_events, spawn_thread, options,
- num_errors, quit_requested,
- stopped_for_crash);
-
-if (m_option_data.m_batch && stopped_for_crash &&
+options.SetStopOnCrash(m_option_data.m_batch);
+
+SBCommandInterpreterRunResult results =
+m_debugger.RunCommandInterpreter(options);
+if (results.GetResult() == lldb::eCommandInterpreterResultQuitRequested)
+  go_interactive = false;
+if (m_option_data.m_batch &&
+results.GetResult() != lldb::eCommandInterpreterResultInferiorCrash)
+  go_interactive = false;
+
+if (m_option_data.m_batch &&
+results.GetResult() == lldb::eCommandInterpreterResultInferiorCrash &&
 !m_option_data.m_after_crash_commands.empty()) {
   SBStream crash_commands_stream;
   WriteCommandsForSourcing(eCommandPlacementAfterCrash,
@@ -629,30 +630,20 @@
   commands_file =
   PrepareCommandsForSourcing(crash_commands_data, crash_commands_size);
   if (commands_file != nullptr) {
-bool local_quit_requested;
-bool local_stopped_for_crash;
 m_debugger.SetInputFileHandle(commands_file, true);
-
-m_debugger.RunCommandInterpreter(handle_events, spawn_thread, options,
- num_errors, local_quit_requested,
- local_stopped_for_crash);
-if (local_quit_requested)
-  quit_requested = true;
+SBCommandInterpreterRunResult local_results =
+m_debugger.RunCommandInterpreter(options);
+if (local_results.GetResult() ==
+lldb::eCommandInterpreterResultQuitRequested)
+  go_interactive = false;
   }
 }
 m_debugger.SetAsync(old_async);
   }
 
-  // Now set the input file handle to STDIN and run the command
-  // interpreter again in interactive mode or repl mode and let the debugger
-  // take ownership of stdin
-
-  bool go_interactive = true;
-  if (quit_requested)
-go_interactive = false;
-  else if (m_option_data.m_batch && !stopped_for_crash)
-go_interactive = false;
-
+  // Now set the input file handle to STDIN and run the command interpreter
+  // again in interactive mode or repl mode and let the debugger take ownership
+  // of stdin.
   if (go_interactive) {
 m_debugger.SetInputFileHandle(stdin, true);
 
Index: lldb/source/API/SBDebugger.cpp
===
--- lldb/source/API/SBDebugger.cpp
+++ lldb/source/API/SBDebugger.cpp
@@ -1200,6 +1200,18 @@
   }
 }
 
+SBCommandInterpreterRunResult SBDebugger::RunCommandInterpreter(
+const SBCommandInterpreterRunOptions &options) {
+  if (!m_opaque_sp)
+return {};
+
+  CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
+  CommandInterpreterRunResult result =
+  interp.RunCommandInterpreter(options.ref());
+
+  return SBCommandInterpreterRunResult(result);
+}
+
 SBError SBDebugger::RunREPL(lldb::LanguageType language,
 const char *repl_options) {
   LLDB_RECORD_METHOD(lldb

[Lldb-commits] [PATCH] D78712: [lldb/Host] Improve error messages on unowned read files

2020-04-30 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib updated this revision to Diff 261384.
mib added a comment.

Removed redundant test.
Refactored PlatformPOSIX following Jonas and Pavel's comments.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D78712/new/

https://reviews.llvm.org/D78712

Files:
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
  lldb/test/API/commands/target/basic/TestTargetCommand.py

Index: lldb/test/API/commands/target/basic/TestTargetCommand.py
===
--- lldb/test/API/commands/target/basic/TestTargetCommand.py
+++ lldb/test/API/commands/target/basic/TestTargetCommand.py
@@ -326,7 +326,7 @@
 @no_debug_info_test
 def test_target_create_nonexistent_core_file(self):
 self.expect("target create -c doesntexist", error=True,
-substrs=["core file 'doesntexist' doesn't exist"])
+substrs=["Cannot open 'doesntexist': No such file or directory"])
 
 # Write only files don't seem to be supported on Windows.
 @skipIfWindows
@@ -335,12 +335,12 @@
 tf = tempfile.NamedTemporaryFile()
 os.chmod(tf.name, stat.S_IWRITE)
 self.expect("target create -c '" + tf.name + "'", error=True,
-substrs=["core file '", "' is not readable"])
+substrs=["Cannot open '", "': Permission denied"])
 
 @no_debug_info_test
 def test_target_create_nonexistent_sym_file(self):
 self.expect("target create -s doesntexist doesntexisteither", error=True,
-substrs=["invalid symbol file path 'doesntexist'"])
+substrs=["Cannot open '", "': No such file or directory"])
 
 @skipIfWindows
 @no_debug_info_test
@@ -357,7 +357,7 @@
 tf = tempfile.NamedTemporaryFile()
 os.chmod(tf.name, stat.S_IWRITE)
 self.expect("target create -s '" + tf.name + "' no_exe", error=True,
-substrs=["symbol file '", "' is not readable"])
+substrs=["Cannot open '", "': Permission denied"])
 
 @no_debug_info_test
 def test_target_delete_all(self):
Index: lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
===
--- lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
+++ lldb/source/Plugins/Platform/POSIX/PlatformPOSIX.cpp
@@ -71,14 +71,16 @@
   Status error;
   // Nothing special to do here, just use the actual file and architecture
 
-  char exe_path[PATH_MAX];
+  std::string exe_path;
   ModuleSpec resolved_module_spec(module_spec);
+  auto resolved_module = FileSystem::Instance().Open(
+  resolved_module_spec.GetFileSpec(), lldb_private::File::eOpenOptionRead);
 
   if (IsHost()) {
 // If we have "ls" as the exe_file, resolve the executable location based
 // on the current path variables
-if (!FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec())) {
-  resolved_module_spec.GetFileSpec().GetPath(exe_path, sizeof(exe_path));
+if (!resolved_module) {
+  exe_path = resolved_module_spec.GetFileSpec().GetPath();
   resolved_module_spec.GetFileSpec().SetFile(exe_path,
  FileSpec::Style::native);
   FileSystem::Instance().Resolve(resolved_module_spec.GetFileSpec());
@@ -91,20 +93,17 @@
 // Resolve any executable within a bundle on MacOSX
 Host::ResolveExecutableInBundle(resolved_module_spec.GetFileSpec());
 
-if (FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec()))
-  error.Clear();
-else {
-  const uint32_t permissions = FileSystem::Instance().GetPermissions(
-  resolved_module_spec.GetFileSpec());
-  if (permissions && (permissions & eFilePermissionsEveryoneR) == 0)
-error.SetErrorStringWithFormat(
-"executable '%s' is not readable",
-resolved_module_spec.GetFileSpec().GetPath().c_str());
-  else
-error.SetErrorStringWithFormat(
-"unable to find executable for '%s'",
-resolved_module_spec.GetFileSpec().GetPath().c_str());
+resolved_module =
+FileSystem::Instance().Open(resolved_module_spec.GetFileSpec(),
+lldb_private::File::eOpenOptionRead);
+
+if (!resolved_module) {
+  error.SetErrorStringWithFormatv(
+  "Cannot open '{0}': {1}.", resolved_module_spec.GetFileSpec(),
+  llvm::toString(resolved_module.takeError()));
+  return error;
 }
+
   } else {
 if (m_remote_platform_sp) {
   error =
@@ -117,89 +116,88 @@
   // Resolve any executable within a bundle on MacOSX
   Host::ResolveExecutableInBundle(resolved_module_spec.GetFileSpec());
 
-  if (FileSystem::Instance().Exists(resolved_module_spec.GetFileSpec()))
-error.Clear();
-  else
-error.SetErrorStringWithFormat("the platform is not currently "
- 

[Lldb-commits] [PATCH] D77843: [lldb/DataFormatters] Delete GetStringPrinterEscapingHelper

2020-04-30 Thread Vedant Kumar via Phabricator via lldb-commits
vsk updated this revision to Diff 261387.
vsk added a comment.

- Avoid heap memory management in "StringPrinterBufferPointer" entirely.
- Rename "StringPrinterBufferPointer" to "DecodedCharBuffer", as that seems to 
more accurately reflect what the class is for.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D77843/new/

https://reviews.llvm.org/D77843

Files:
  lldb/include/lldb/DataFormatters/StringPrinter.h
  lldb/include/lldb/Target/Language.h
  lldb/source/DataFormatters/StringPrinter.cpp
  lldb/source/Plugins/Language/ObjC/NSString.cpp
  lldb/source/Target/Language.cpp
  lldb/unittests/DataFormatter/CMakeLists.txt
  lldb/unittests/DataFormatter/StringPrinterTests.cpp

Index: lldb/unittests/DataFormatter/StringPrinterTests.cpp
===
--- /dev/null
+++ lldb/unittests/DataFormatter/StringPrinterTests.cpp
@@ -0,0 +1,159 @@
+//===-- StringPrinterTests.cpp ===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "lldb/DataFormatters/StringPrinter.h"
+#include "lldb/Utility/DataExtractor.h"
+#include "lldb/Utility/Endian.h"
+#include "lldb/Utility/StreamString.h"
+#include "llvm/ADT/Optional.h"
+#include "llvm/ADT/StringRef.h"
+#include "llvm/Support/raw_ostream.h"
+#include "gtest/gtest.h"
+#include 
+
+using namespace lldb;
+using namespace lldb_private;
+using lldb_private::formatters::StringPrinter;
+using llvm::Optional;
+using llvm::StringRef;
+
+#define QUOTE(x) std::string("\"" x "\"")
+
+/// Format \p input according to the specified string encoding and special char
+/// escape style.
+template 
+static Optional format(StringRef input,
+StringPrinter::EscapeStyle escape_style) {
+  StreamString out;
+  StringPrinter::ReadBufferAndDumpToStreamOptions opts;
+  opts.SetStream(&out);
+  opts.SetSourceSize(input.size());
+  opts.SetNeedsZeroTermination(true);
+  opts.SetEscapeNonPrintables(true);
+  opts.SetIgnoreMaxLength(false);
+  opts.SetEscapeStyle(escape_style);
+  DataExtractor extractor(input.data(), input.size(),
+  endian::InlHostByteOrder(), sizeof(void *));
+  opts.SetData(extractor);
+  const bool success = StringPrinter::ReadBufferAndDumpToStream(opts);
+  if (!success)
+return llvm::None;
+  return out.GetString().str();
+}
+
+// Test ASCII formatting for C++. This behaves exactly like UTF8 formatting for
+// C++, although that's questionable (see FIXME in StringPrinter.cpp).
+TEST(StringPrinterTests, CxxASCII) {
+  auto fmt = [](StringRef str) {
+return format(
+str, StringPrinter::EscapeStyle::CXX);
+  };
+
+  // Special escapes.
+  EXPECT_EQ(fmt({"\0", 1}), QUOTE(""));
+  EXPECT_EQ(fmt("\a"), QUOTE(R"(\a)"));
+  EXPECT_EQ(fmt("\b"), QUOTE(R"(\b)"));
+  EXPECT_EQ(fmt("\f"), QUOTE(R"(\f)"));
+  EXPECT_EQ(fmt("\n"), QUOTE(R"(\n)"));
+  EXPECT_EQ(fmt("\r"), QUOTE(R"(\r)"));
+  EXPECT_EQ(fmt("\t"), QUOTE(R"(\t)"));
+  EXPECT_EQ(fmt("\v"), QUOTE(R"(\v)"));
+  EXPECT_EQ(fmt("\""), QUOTE(R"(\")"));
+  EXPECT_EQ(fmt("\'"), QUOTE(R"(')"));
+  EXPECT_EQ(fmt("\\"), QUOTE(R"(\\)"));
+
+  // Printable characters.
+  EXPECT_EQ(fmt("'"), QUOTE("'"));
+  EXPECT_EQ(fmt("a"), QUOTE("a"));
+  EXPECT_EQ(fmt("Z"), QUOTE("Z"));
+  EXPECT_EQ(fmt("🥑"), QUOTE("🥑"));
+
+  // Octal (\nnn), hex (\xnn), extended octal (\u or \U).
+  EXPECT_EQ(fmt("\uD55C"), QUOTE("한"));
+  EXPECT_EQ(fmt("\U00010348"), QUOTE("𐍈"));
+
+  // FIXME: These strings are all rejected, but shouldn't be AFAICT. LLDB finds
+  // that these are not valid utf8 sequences, but that's OK, the raw values
+  // should still be printed out.
+  EXPECT_NE(fmt("\376"), QUOTE(R"(\xfe)")); // \376 is 254 in decimal.
+  EXPECT_NE(fmt("\xfe"), QUOTE(R"(\xfe)")); // \xfe is 254 in decimal.
+}
+
+// Test UTF8 formatting for C++.
+TEST(StringPrinterTests, CxxUTF8) {
+  auto fmt = [](StringRef str) {
+return format(
+str, StringPrinter::EscapeStyle::CXX);
+  };
+
+  // Special escapes.
+  EXPECT_EQ(fmt({"\0", 1}), QUOTE(""));
+  EXPECT_EQ(fmt("\a"), QUOTE(R"(\a)"));
+  EXPECT_EQ(fmt("\b"), QUOTE(R"(\b)"));
+  EXPECT_EQ(fmt("\f"), QUOTE(R"(\f)"));
+  EXPECT_EQ(fmt("\n"), QUOTE(R"(\n)"));
+  EXPECT_EQ(fmt("\r"), QUOTE(R"(\r)"));
+  EXPECT_EQ(fmt("\t"), QUOTE(R"(\t)"));
+  EXPECT_EQ(fmt("\v"), QUOTE(R"(\v)"));
+  EXPECT_EQ(fmt("\""), QUOTE(R"(\")"));
+  EXPECT_EQ(fmt("\'"), QUOTE(R"(')"));
+  EXPECT_EQ(fmt("\\"), QUOTE(R"(\\)"));
+
+  // Printable characters.
+  EXPECT_EQ(fmt("'"), QUOTE("'"));
+  EXPECT_EQ(fmt("a"), QUOTE("a"));
+  EXPECT_EQ(fmt("Z"), QUOTE("Z"));
+  EXPECT_EQ(fmt("🥑"), QUOTE("🥑"));
+
+  // Octal (\nnn), hex (\xnn), extended octal (\u or \U

[Lldb-commits] [PATCH] D70885: [lldb] Use explicit lldb commands on tests

2020-04-30 Thread Nathan Lanza via Phabricator via lldb-commits
lanza added a comment.

Sorry for bump to this old diff, but I agree with both Jim and Greg -- we 
shouldn't be importing your `~/.lldbinit`, but tests shouldn't depend on there 
never being another `br s`. This change should land as `breakpoint set`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70885/new/

https://reviews.llvm.org/D70885



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


[Lldb-commits] [PATCH] D79209: [lldb/CommandInterpreter] Add CommandInterpreterRunResult (NFC)

2020-04-30 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added inline comments.
This revision is now accepted and ready to land.



Comment at: lldb/include/lldb/lldb-enumerations.h:1084
 };
+
+enum CommandInterpreterResult {

Add some header doc for these to explain a bit maybe since this is a public 
header file?


Repository:
  rLLDB LLDB

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D79209/new/

https://reviews.llvm.org/D79209



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


[Lldb-commits] [PATCH] D70885: [lldb] Use explicit lldb commands on tests

2020-04-30 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: 
lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py:353-354
 'target create "%s"' % (program),
-'br s -f main.c -l %d' % first_line,
-'br s -f main.c -l %d' % second_line,
+'breakpoint s -f main.c -l %d' % first_line,
+'breakpoint s -f main.c -l %d' % second_line,
 'process launch --stop-at-entry'

we might as well spell this out completely as "breakpoint set" just in case and 
nothing can currently replace or alias existing commands.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70885/new/

https://reviews.llvm.org/D70885



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