[Lldb-commits] [PATCH] D61687: Update Python tests for lldb-server on Windows

2019-05-15 Thread Hui Huang via Phabricator via lldb-commits
Hui added inline comments.



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py:208-212
+# In current implementation of llgs on Windows, as a response to '\x03' 
packet, the debugger
+# of the native process will trigger a call to DebugBreakProcess that will 
create a new thread
+# to handle the exception debug event. So one more stop thread will be 
notified to the
+# delegate, e.g. llgs.  So tests below to assert the stop threads number 
will all fail.
+@expectedFailureAll(oslist=["windows"])

labath wrote:
> labath wrote:
> > Is this something that we consider to be a bug, or is it just how debugging 
> > is supposed to work on windows? If it's a bug then fine, but if not then we 
> > might consider adjusting the expectations in the test (or just skipping it).
> You marked this as done, but it's not obvious how is this comment resolved 
> (or indeed, if it needs to be resolved). Can you elaborate?
DebugBreakProcess is supposed to spawn a new thread in the debugged process and 
then the thread exits after the irq is handled.

See below thread #1 is main thread of the debugged process and thread #2 is the 
newly spawned.
json string contains two stopped threads information.

looks like the stopped threads number is supposed to +1, but in order to be 
consistent with Visual Studio,
it shall be possible to only report the thread #1 stop info.

To modify the python script for Windows is at some cost. Maybe just skip them?

```
(lldb) process interrupt
 GDBRemoteClientBase::Lock::Lock sent packet: \x03
...
 <  16> send packet: $jThreadsInfo#c1
 < 354> read packet: 
$[{"name":"main.exe","reason":"trace","registers":{"16":"dc6b5a9af77f","6":"","7":"80fa1e8aca00"}],"tid":23108}],{"description":"Exception
 0x8003 encountered at address 
0x7ffa1701e370","name":"main.exe","reason":"exception","registers":{"16":"71e30117fa7f","6":"","7":"28fa4f8aca00"}],"tid":23716}]]#f0

Process 27544 stopped
* thread #1, name = 'main.exe', stop reason = trace
frame #0: 0x7ff79a5a6bdc main.exe`main at main.cpp:7
   4{
   5
   6  printf("abc");
-> 7  while(1);
   8  return 1;
   9}
  thread #2, name = 'main.exe', stop reason = Exception 0x8003 encountered 
at address 0x7ffa1701e370
frame #0: 0x7ffa1701e371
->  0x7ffa1701e371: retq
0x7ffa1701e372: int3
0x7ffa1701e373: int3
0x7ffa1701e374: int3
```



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

https://reviews.llvm.org/D61687



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


[Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

2019-05-15 Thread Fangrui Song via Phabricator via lldb-commits
MaskRay added a comment.

In D54747#1459175 , @rocallahan wrote:

> Updated results for the rusoto test in 
> https://github.com/rust-lang/rust/issues/56068#issue-382175735. The test 
> changed a bit because I'm using an updated Rust toolchain and `rusoto_core` 
> 0.37.0.
>
> | Linker | Size (bytes) | Real time (ms) |
> | GNU ld version 2.29.1-23.fc28  | 48,554,736   | 2234   |
> | GNU gold (version 2.29.1-23.fc28) 1.14 | 49,888,392   | 813|
> | lld-6.0.1-1.fc28.x86_64| 49,800,824   | 247|
> | lld d918d74461724a22cedd0b76dc1237392f295656
>   | 49,873,960   | 224|
> | lld d918d74461724a22cedd0b76dc1237392f295656 + this patch   
>   | 5,390,632| 158|
> |


@rocallahan
Can you also share the linker command line? You may execute `export 
LLD_REPRODUCE=/tmp/reproduce.tar` before the linking stage. After unpacking, 
there is a `response.txt` file that contains the full command line. I know 
little about Rust crates but I worry some component doesn't use static archives 
.a correctly. If you don't have .a but you have a bunch of .o files, you may 
place them inside a `--start-lib ... --end-lib` to get the archive semantic.

If all debug information of an object file is discarded, it sounds like if you 
switch the build system to use archives, the member in the archive will just 
get discarded, i.e.

If you do `ld.lld main.o a.o b.o c.o d1.o d2.o d3.o` before, you should 
probably switch to

`ld.lld main.o --start-lib a.o b.o c.o --end-lib --start-lib d1.o d2.o d3.o 
--end-lib`


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54747



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


[Lldb-commits] [PATCH] D61956: [CMake] Add first CMake cache files

2019-05-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

No objections from me to checking in caches for common configurations.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61956



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


[Lldb-commits] [PATCH] D61687: Update Python tests for lldb-server on Windows

2019-05-15 Thread Hui Huang via Phabricator via lldb-commits
Hui added inline comments.



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py:40
 
+@skipIfWindows # For now the signo in T* packet is always 0.
 @llgs_test

labath wrote:
> labath wrote:
> > Do you have any plans for changing this? Given that windows does not 
> > support signals, maybe it should stay 0...
> I'd like to hear your thoughts on this...
> 
> If the idea is for the signal number to stay zero, then the comment shouldn't 
> say "for now" but instead say something to the effect that abort() does not 
> cause a signal to be raised on windows because windows doesn't have signals. 
> If the idea is to change this later, then I'd like to understand how/why.
I think the signal number can just stay zero (treated as invalid) unless there 
is any strategy that will
need valid ones in the future for Windows user-mode debugging(or for 
kernel-mode debugging?). 
The proposed implementation of native process/thread for windows in D56233 is 
mainly signal free. 

There will be several slight difference(worth mentioning) by always filling 
with zero signo

(1) In remote debugging case, T* packet is to detail the stopped reason for a 
thread.
W or w/o a valid signal the messages shown on lldb  are slightly different.
(StopReason::eStopReasonBreakpoint vs StopReason::eStopReasonException)

On Linux,

 thread #1, name = 'a.out', stop reason = signal SIGSEGV: invalid address 
(fault address: 0x0)

On Windows,
 thread #1, name = 'a.out', stop reason = Exception 0xc005 encountered at 
address 0x7ff6011c1093
 
(2) The GDB remote serial protocol does have several signals related packets,
like **"vCont;S"** to resume a thread by single stepping with signal or** 
"vCont;C"** to continue with signal.
For example, **vCont;S06** to single step with signo=6 (SIGABRT).

Such packets won't be available on Windows.  The continuation of a stopped 
thread relies on how
the exception is dispatched and handled.  This is mentioned at

https://docs.microsoft.com/en-us/windows/desktop/debug/exception-dispatching

In this python test case, if a segfault happens, the EXCEPTION_ACCESS_VIOLATION 
(0xc005) is raised.
Since there is no eh installed in user application, the exception will be 
dispatched to lldb Debugger for the second time
where a default eh or ExitProcess will be called.  ( D56233 patch might need 
such changes)




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

https://reviews.llvm.org/D61687



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


[Lldb-commits] [PATCH] D54747: Discard debuginfo for object files empty after GC

2019-05-15 Thread Reid Kleckner via Phabricator via lldb-commits
rnk added a comment.

I think there's an issue with the whole idea of dropping .debug_info from 
objects without live sections. Consider:

  // a.cpp
  int main() {
return f();
  }
  // b.cpp
  struct Foo {
int x, y;
  };
  int f() {
volatile Foo var;
var.x = 13;
var.y = 42;
return var.x + var.y;
  }

When compiled and linked with thinlto, `f` is imported into the a.cpp TU, but 
the full definition of the `Foo` type remains in the b.cpp TU, because 
importing the full type would be expensive and wasteful.

I used these commands to show the change in behavior before and after this 
change:

  $ clang -O2 -flto=thin -c -ffunction-sections a.cpp b.cpp -g 
  # before
  $ ninja lld
  [1 processes, 3/3 @ 0.8/s : 3.582s ] Linking CXX executable bin/lld
  $ clang -Wl,--gc-sections -flto=thin  -fuse-ld=lld a.o b.o  -o t.exe
  $ gdb -ex 'b foo' -ex r -ex s -ex 'p var' -batch t.exe
  ...
  Breakpoint 1 at 0x201168: file a.cpp, line 2.
  
  Breakpoint 1, foo () at b.cpp:7
  7 var.y = 42;
  8 return var.x + var.y;
  $1 = {x = 13, y = 42}
  # after
  $ ninja lld 
  $ clang -Wl,--gc-sections -flto=thin  -fuse-ld=lld a.o b.o  -o t.exe 
  $ gdb -ex 'b foo' -ex r -ex s -ex 'p var' -batch t.exe
  ...
  Breakpoint 1 at 0x201168: file a.cpp, line 2.
  
  Breakpoint 1, foo () at b.cpp:7
  7 var.y = 42;
  8 return var.x + var.y;
  $1 = 

So, before `Foo` had a complete type, but now it does not.

I can't seem to construct an example where LLD will throw away useful debug 
info without thinlto, but Clang often makes assumptions that other object files 
will provide certain bits of debug info as a size optimization.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D54747



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


[Lldb-commits] [lldb] r360822 - Update LLDB license on the LLDB home page to Apache+LLVM.

2019-05-15 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed May 15 14:58:43 2019
New Revision: 360822

URL: http://llvm.org/viewvc/llvm-project?rev=360822=rev
Log:
Update LLDB license on the LLDB home page to Apache+LLVM.

Modified:
lldb/trunk/docs/index.rst

Modified: lldb/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/index.rst?rev=360822=360821=360822=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Wed May 15 14:58:43 2019
@@ -12,9 +12,10 @@ Project, such as the Clang expression pa
 LLDB is the default debugger in Xcode on macOS and supports debugging C,
 Objective-C and C++ on the desktop and iOS devices and simulator.
 
-All of the code in the LLDB project is available under the standard
-`LLVM License 
`__,
-an open source "BSD-style" license.
+All of the code in the LLDB project is available under the
+`"Apache 2.0 License with LLVM exceptions"`_.
+
+.. _"Apache 2.0 License with LLVM exceptions": 
http://llvm.org/docs/DeveloperPolicy.html#new-llvm-project-license-framework
 
 Why a New Debugger?
 ---


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


[Lldb-commits] [PATCH] D61913: Get back the navigation sidebar on the LLDB website

2019-05-15 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360819: Get back the navigation sidebar on the LLDB 
website. (authored by adrian, committed by ).
Herald added a subscriber: teemperor.

Changed prior to commit:
  https://reviews.llvm.org/D61913?vs=199686=199687#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61913

Files:
  docs/CMakeLists.txt
  docs/_static/lldb.css
  docs/conf.py
  docs/index.rst
  docs/status/about.rst
  docs/use/formatting.rst

Index: docs/use/formatting.rst
===
--- docs/use/formatting.rst
+++ docs/use/formatting.rst
@@ -1,5 +1,5 @@
-Stack Frame and Thread Format
-=
+Frame and Thread Format
+===
 
 .. contents::
:local:
Index: docs/_static/lldb.css
===
--- docs/_static/lldb.css
+++ docs/_static/lldb.css
@@ -1,3 +1,15 @@
+pre {
+  padding: 7px;
+}
+
+div.document {
+  width: 90%;
+}
+
+div.body {
+  max-width: 90%;
+}
+
 table.mapping {
   width: 100%;
 }
@@ -9,14 +21,14 @@
 
 table.mapping td.hed {
   background: #606060;
-  color: white;
+  color: #fefefe;
   text-align: left;
-  border-bottom: 2px #fff solid;
+  border-bottom: 2px #fefefe solid;
   font-weight: bold;
 }
 
 table.mapping td.header {
-  background: #eee;
+  background: #ee;
 }
 
 table.mapping td.content {
@@ -24,3 +36,51 @@
   padding-bottom: 15px;
 }
 
+div.sphinxsidebar .caption {
+  font-family: Helvetica, Verdana, sans-serif;
+  font-size: 10pt;
+  font-weight:bold;
+  color: #fefefe;
+  background: #606060;
+  margin-bottom: 0;
+  text-transform: uppercase;
+  padding: 7px;
+}
+
+div.sphinxsidebar a,
+div.sphinxsidebar a:hover {
+  border: none;
+}
+
+div.sphinxsidebar li {
+  padding-left:5px;
+  padding-right:5px;
+  border-bottom:1px solid #fefefe;
+}
+
+div.sphinxsidebar li:hover {
+  background: #ee;
+}
+
+div.sphinxsidebar ul {
+  background: #e9e9e9;
+  margin: 0px;
+  padding: 0px;
+}
+
+div.sphinxsidebar ul a {
+  font-family: Helvetica, Verdana, sans-serif;
+  font-size: 8pt;
+  display: block;
+  padding: 5px 0;
+  line-height: 14pt;
+}
+
+div.sphinxsidebar ul li.toctree-l1 > a {
+  font-size: 100%;
+}
+
+div.sphinxsidebar h3 {
+  /* Hide Navigation. */
+  display: none;
+}
Index: docs/index.rst
===
--- docs/index.rst
+++ docs/index.rst
@@ -16,24 +16,105 @@
 `LLVM License `__,
 an open source "BSD-style" license.
 
+Why a New Debugger?
+---
 
-Goals & Status
-==
+In order to achieve our goals we decided to start with a fresh architecture
+that would support modern multi-threaded programs, handle debugging symbols in
+an efficient manner, use compiler based code knowledge and have plug-in support
+for functionality and extensions. Additionally we want the debugger
+capabilities to be available to other analysis tools, be they scripts or
+compiled programs, without requiring them to be GPL.
+
+Compiler Integration Benefits
+-
+
+LLDB currently converts debug information into clang types so that it can
+leverage the clang compiler infrastructure. This allows LLDB to support the
+latest C, C++, Objective-C and Objective-C++ language features and runtimes in
+expressions without having to reimplement any of this functionality. It also
+leverages the compiler to take care of all ABI details when making functions
+calls for expressions, when disassembling instructions and extracting
+instruction details, and much more.
+
+The major benefits include:
+
+- Up to date language support for C, C++, Objective-C
+- Multi-line expressions that can declare local variables and types
+- Utilize the JIT for expressions when supported
+- Evaluate expression Intermediate Representation (IR) when JIT can't be used
+
+Reusability
+---
+
+The LLDB debugger APIs are exposed as a C++ object oriented interface in a
+shared library. The lldb command line tool links to, and uses this public API.
+On macOS the shared library is exposed as a framework named LLDB.framework,
+and unix systems expose it as lldb.so. The entire API is also then exposed
+through Python script bindings which allow the API to be used within the LLDB
+embedded script interpreter, and also in any python script that loads the
+lldb.py module in standard python script files. See the Python Reference page
+for more details on how and where Python can be used with the LLDB API.
+
+Sharing the LLDB API allows LLDB to not only be used for debugging, but also
+for symbolication, disassembly, object and symbol file introspection, and much
+more.
+
+Platform Support
+
+
+LLDB is known to work on the following platforms, but ports to new platforms

[Lldb-commits] [lldb] r360819 - Get back the navigation sidebar on the LLDB website.

2019-05-15 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Wed May 15 14:49:00 2019
New Revision: 360819

URL: http://llvm.org/viewvc/llvm-project?rev=360819=rev
Log:
Get back the navigation sidebar on the LLDB website.

This returns the look & feel of the Sphinx-generated LLDB website to
the original pre-Sphinx layout.

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

Removed:
lldb/trunk/docs/status/about.rst
Modified:
lldb/trunk/docs/CMakeLists.txt
lldb/trunk/docs/_static/lldb.css
lldb/trunk/docs/conf.py
lldb/trunk/docs/index.rst
lldb/trunk/docs/use/formatting.rst

Modified: lldb/trunk/docs/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/CMakeLists.txt?rev=360819=360818=360819=diff
==
--- lldb/trunk/docs/CMakeLists.txt (original)
+++ lldb/trunk/docs/CMakeLists.txt Wed May 15 14:49:00 2019
@@ -58,6 +58,11 @@ if (LLVM_ENABLE_SPHINX)
   if (SPHINX_FOUND)
 if (${SPHINX_OUTPUT_HTML})
   add_sphinx_target(html lldb)
+  # Sphinx does not reliably update the custom CSS files, so force
+  # a clean rebuild of the documentation every time.
+  add_custom_target(clean-lldb-html COMMAND "${CMAKE_COMMAND}" -E
+remove_directory ${CMAKE_CURRENT_BINARY_DIR}/html)
+  add_dependencies(docs-lldb-html clean-lldb-html)
 endif()
   endif()
 endif()

Modified: lldb/trunk/docs/_static/lldb.css
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/_static/lldb.css?rev=360819=360818=360819=diff
==
--- lldb/trunk/docs/_static/lldb.css (original)
+++ lldb/trunk/docs/_static/lldb.css Wed May 15 14:49:00 2019
@@ -1,3 +1,15 @@
+pre {
+  padding: 7px;
+}
+
+div.document {
+  width: 90%;
+}
+
+div.body {
+  max-width: 90%;
+}
+
 table.mapping {
   width: 100%;
 }
@@ -9,14 +21,14 @@ table.mapping td {
 
 table.mapping td.hed {
   background: #606060;
-  color: white;
+  color: #fefefe;
   text-align: left;
-  border-bottom: 2px #fff solid;
+  border-bottom: 2px #fefefe solid;
   font-weight: bold;
 }
 
 table.mapping td.header {
-  background: #eee;
+  background: #ee;
 }
 
 table.mapping td.content {
@@ -24,3 +36,51 @@ table.mapping td.content {
   padding-bottom: 15px;
 }
 
+div.sphinxsidebar .caption {
+  font-family: Helvetica, Verdana, sans-serif;
+  font-size: 10pt;
+  font-weight:bold;
+  color: #fefefe;
+  background: #606060;
+  margin-bottom: 0;
+  text-transform: uppercase;
+  padding: 7px;
+}
+
+div.sphinxsidebar a,
+div.sphinxsidebar a:hover {
+  border: none;
+}
+
+div.sphinxsidebar li {
+  padding-left:5px;
+  padding-right:5px;
+  border-bottom:1px solid #fefefe;
+}
+
+div.sphinxsidebar li:hover {
+  background: #ee;
+}
+
+div.sphinxsidebar ul {
+  background: #e9e9e9;
+  margin: 0px;
+  padding: 0px;
+}
+
+div.sphinxsidebar ul a {
+  font-family: Helvetica, Verdana, sans-serif;
+  font-size: 8pt;
+  display: block;
+  padding: 5px 0;
+  line-height: 14pt;
+}
+
+div.sphinxsidebar ul li.toctree-l1 > a {
+  font-size: 100%;
+}
+
+div.sphinxsidebar h3 {
+  /* Hide Navigation. */
+  display: none;
+}

Modified: lldb/trunk/docs/conf.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/conf.py?rev=360819=360818=360819=diff
==
--- lldb/trunk/docs/conf.py (original)
+++ lldb/trunk/docs/conf.py Wed May 15 14:49:00 2019
@@ -92,12 +92,14 @@ pygments_style = 'friendly'
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'haiku'
+html_theme = 'alabaster'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-#html_theme_options = {}
+html_theme_options = {
+'font_size': '11pt'
+}
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []

Modified: lldb/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/index.rst?rev=360819=360818=360819=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Wed May 15 14:49:00 2019
@@ -16,24 +16,105 @@ All of the code in the LLDB project is a
 `LLVM License 
`__,
 an open source "BSD-style" license.
 
+Why a New Debugger?
+---
 
-Goals & Status
-==
+In order to achieve our goals we decided to start with a fresh architecture
+that would support modern multi-threaded programs, handle debugging symbols in
+an efficient manner, use compiler based code knowledge and have plug-in support
+for functionality and extensions. Additionally we want the debugger
+capabilities to be available to other analysis tools, be they scripts or
+compiled programs, without 

[Lldb-commits] [PATCH] D61913: Get back the navigation sidebar on the LLDB website

2019-05-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 199686.
JDevlieghere added a comment.

Fix pre-padding


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

https://reviews.llvm.org/D61913

Files:
  lldb/docs/CMakeLists.txt
  lldb/docs/_static/lldb.css
  lldb/docs/conf.py
  lldb/docs/index.rst
  lldb/docs/status/about.rst
  lldb/docs/use/formatting.rst

Index: lldb/docs/use/formatting.rst
===
--- lldb/docs/use/formatting.rst
+++ lldb/docs/use/formatting.rst
@@ -1,5 +1,5 @@
-Stack Frame and Thread Format
-=
+Frame and Thread Format
+===
 
 .. contents::
:local:
Index: lldb/docs/status/about.rst
===
--- lldb/docs/status/about.rst
+++ /dev/null
@@ -1,90 +0,0 @@
-About
-=
-
-.. contents::
-   :local:
-
-Why a New Debugger?

-
-In order to achieve our goals we decided to start with a fresh architecture
-that would support modern multi-threaded programs, handle debugging symbols in
-an efficient manner, use compiler based code knowledge and have plug-in support
-for functionality and extensions. Additionally we want the debugger
-capabilities to be available to other analysis tools, be they scripts or
-compiled programs, without requiring them to be GPL.
-
-Compiler Integration Benefits
--
-
-LLDB currently converts debug information into clang types so that it can
-leverage the clang compiler infrastructure. This allows LLDB to support the
-latest C, C++, Objective-C and Objective-C++ language features and runtimes in
-expressions without having to reimplement any of this functionality. It also
-leverages the compiler to take care of all ABI details when making functions
-calls for expressions, when disassembling instructions and extracting
-instruction details, and much more.
-
-The major benefits include:
-
-- Up to date language support for C, C++, Objective-C
-- Multi-line expressions that can declare local variables and types
-- Utilize the JIT for expressions when supported
-- Evaluate expression Intermediate Representation (IR) when JIT can't be used
-
-Reusability

-
-The LLDB debugger APIs are exposed as a C++ object oriented interface in a
-shared library. The lldb command line tool links to, and uses this public API.
-On macOS the shared library is exposed as a framework named LLDB.framework,
-and unix systems expose it as lldb.so. The entire API is also then exposed
-through Python script bindings which allow the API to be used within the LLDB
-embedded script interpreter, and also in any python script that loads the
-lldb.py module in standard python script files. See the Python Reference page
-for more details on how and where Python can be used with the LLDB API.
-
-Sharing the LLDB API allows LLDB to not only be used for debugging, but also
-for symbolication, disassembly, object and symbol file introspection, and much
-more.
-
-Platform Support
-
-
-LLDB is known to work on the following platforms, but ports to new platforms
-are welcome:
-
-* macOS desktop user space debugging for i386 and x86-64
-* iOS simulator debugging on i386
-* iOS device debugging on ARM
-* Linux local user-space debugging for i386, x86-64 and PPC64le
-* FreeBSD local user-space debugging for i386 and x86-64
-* Windows local user-space debugging for i386 (*)
-
-(*) Support for Windows is under active development. Basic functionality is
-expected to work, with functionality improving rapidly.
-
-Get Involved
-
-
-To check out the code, use:
-
-svn co http://llvm.org/svn/llvm-project/lldb/trunk lldb
-
-Note that LLDB generally builds from top-of-trunk
-
-* On macOS with Xcode
-* On Linux and FreeBSD (with clang and libstdc++/libc++)
-* On NetBSD (with GCC and clang and libstdc++/libc++)
-* On Windows with VS 2012 or higher using CMake
-
-See the LLDB Build Page for platform-specific build instructions.
-
-Discussions about LLDB should go to the `lldb-dev
-`__ mailing list. Commit
-messages for the lldb SVN module are automatically sent to the `lldb-commits
-`__ mailing list , and
-this is also the preferred mailing list for patch submissions.
-
-See the Projects page if you are looking for some interesting areas to
-contribute to lldb.
Index: lldb/docs/index.rst
===
--- lldb/docs/index.rst
+++ lldb/docs/index.rst
@@ -16,24 +16,105 @@
 `LLVM License `__,
 an open source "BSD-style" license.
 
+Why a New Debugger?
+---
 
-Goals & Status
-==
+In order to achieve our goals we decided to start with a fresh architecture
+that would support modern multi-threaded programs, handle debugging 

[Lldb-commits] [PATCH] D61913: Get back the navigation sidebar on the LLDB website

2019-05-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere commandeered this revision.
JDevlieghere edited reviewers, added: aprantl; removed: JDevlieghere.
JDevlieghere added a comment.

Hostile take-over of the patch ;-)


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

https://reviews.llvm.org/D61913



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


[Lldb-commits] [PATCH] D61952: [CMake] Stabilize install process for LLDB.framework

2019-05-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

How does this cleanup affect dependency tracking? Does the build dir become 
unusable after running ninja install?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61952



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


[Lldb-commits] [lldb] r360800 - [lldb] [test] Skip one more TestMiBreak on NetBSD

2019-05-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May 15 13:03:31 2019
New Revision: 360800

URL: http://llvm.org/viewvc/llvm-project?rev=360800=rev
Log:
[lldb] [test] Skip one more TestMiBreak on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py?rev=360800=360799=360800=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/breakpoint/TestMiBreak.py
 Wed May 15 13:03:31 2019
@@ -304,7 +304,7 @@ class MiBreakTestCase(lldbmi_testcase.Mi
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfRemote   # We do not currently support remote debugging via the MI.
-@expectedFlakeyNetBSD
+@skipIfNetBSD
 def test_lldbmi_break_enable_disable(self):
 """Test that 'lldb-mi --interpreter' works for enabling / disabling 
breakpoints."""
 


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


[Lldb-commits] [PATCH] D61502: Permit cross-CU references

2019-05-15 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360795: Permit cross-CU references (authored by 
jankratochvil, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61502?vs=199490=199656#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61502

Files:
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
===
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -693,16 +693,16 @@
 
   case DW_AT_abstract_origin:
   case DW_AT_specification: {
-uint64_t abstract_die_offset = form_value.Reference();
+DWARFDIE abstract_die = form_value.Reference();
 form_value.Dump(s);
-//  *ostrm_ptr << HEX32 << abstract_die_offset << " ( ";
-GetName(dwarf2Data, cu, abstract_die_offset, s);
+//  *ostrm_ptr << HEX32 << abstract_die.GetOffset() << " ( ";
+GetName(dwarf2Data, abstract_die.GetCU(), abstract_die.GetOffset(), s);
   } break;
 
   case DW_AT_type: {
-uint64_t type_die_offset = form_value.Reference();
+DWARFDIE type_die = form_value.Reference();
 s.PutCString(" ( ");
-AppendTypeName(dwarf2Data, cu, type_die_offset, s);
+AppendTypeName(dwarf2Data, type_die.GetCU(), type_die.GetOffset(), s);
 s.PutCString(" )");
   } break;
 
@@ -734,13 +734,6 @@
   const DWARFAbbreviationDeclaration *abbrevDecl = nullptr;
   lldb::offset_t offset = 0;
   if (cu) {
-if (m_tag != DW_TAG_compile_unit && m_tag != DW_TAG_partial_unit) {
-  SymbolFileDWARFDwo *dwo_symbol_file = cu->GetDwoSymbolFile();
-  if (dwo_symbol_file)
-return GetAttributes(dwo_symbol_file->GetCompileUnit(),
- fixed_form_sizes, attributes, curr_depth);
-}
-
 dwarf2Data = cu->GetSymbolFileDWARF();
 abbrevDecl = GetAbbreviationDeclarationPtr(dwarf2Data, cu, offset);
   }
@@ -779,9 +772,7 @@
 
   if ((attr == DW_AT_specification) || (attr == DW_AT_abstract_origin)) {
 if (form_value.ExtractValue(debug_info_data, )) {
-  dw_offset_t die_offset = form_value.Reference();
-  DWARFDIE spec_die =
-  const_cast(cu)->GetDIE(die_offset);
+  DWARFDIE spec_die = form_value.Reference();
   if (spec_die)
 spec_die.GetAttributes(attributes, curr_depth + 1);
 }
@@ -845,8 +836,7 @@
 
   if (check_specification_or_abstract_origin) {
 if (GetAttributeValue(dwarf2Data, cu, DW_AT_specification, form_value)) {
-  DWARFDIE die =
-  const_cast(cu)->GetDIE(form_value.Reference());
+  DWARFDIE die = form_value.Reference();
   if (die) {
 dw_offset_t die_offset = die.GetDIE()->GetAttributeValue(
 die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr,
@@ -857,8 +847,7 @@
 }
 
 if (GetAttributeValue(dwarf2Data, cu, DW_AT_abstract_origin, form_value)) {
-  DWARFDIE die =
-  const_cast(cu)->GetDIE(form_value.Reference());
+  DWARFDIE die = form_value.Reference();
   if (die) {
 dw_offset_t die_offset = die.GetDIE()->GetAttributeValue(
 die.GetDWARF(), die.GetCU(), attr, form_value, end_attr_offset_ptr,
@@ -920,15 +909,14 @@
 //
 // Get the value of an attribute as reference and fix up and compile unit
 // relative offsets as needed.
-uint64_t DWARFDebugInfoEntry::GetAttributeValueAsReference(
-SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu,
-const dw_attr_t attr, uint64_t fail_value,
+DWARFDIE DWARFDebugInfoEntry::GetAttributeValueAsReference(
+SymbolFileDWARF *dwarf2Data, const DWARFUnit *cu, const dw_attr_t attr,
 bool check_specification_or_abstract_origin) const {
   DWARFFormValue form_value;
   if (GetAttributeValue(dwarf2Data, cu, attr, form_value, nullptr,
 check_specification_or_abstract_origin))
 return form_value.Reference();
-  return fail_value;
+  return {};
 }
 
 uint64_t 

[Lldb-commits] [lldb] r360795 - Permit cross-CU references

2019-05-15 Thread Jan Kratochvil via lldb-commits
Author: jankratochvil
Date: Wed May 15 12:22:33 2019
New Revision: 360795

URL: http://llvm.org/viewvc/llvm-project?rev=360795=rev
Log:
Permit cross-CU references

So far dw_offset_t was global for the whole SymbolFileDWARF but with
.debug_types the same dw_offset_t may mean two different things depending on
its section (=CU). So references now return whole new referenced DWARFDIE
instead of just dw_offset_t.

This means that some functions have to now handle 16 bytes instead of 8 bytes
but I do not see that anywhere performance critical.

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp?rev=360795=360794=360795=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp Wed May 15 12:22:33 
2019
@@ -16,12 +16,13 @@
 DIERef::DIERef(const DWARFFormValue _value)
 : cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) {
   if (form_value.IsValid()) {
-if (const DWARFUnit *unit = form_value.GetUnit()) {
-  if (unit->GetBaseObjOffset() != DW_INVALID_OFFSET)
-cu_offset = unit->GetBaseObjOffset();
+DWARFDIE die = form_value.Reference();
+die_offset = die.GetOffset();
+if (die) {
+  if (die.GetCU()->GetBaseObjOffset() != DW_INVALID_OFFSET)
+cu_offset = die.GetCU()->GetBaseObjOffset();
   else
-cu_offset = unit->GetOffset();
+cu_offset = die.GetCU()->GetOffset();
 }
-die_offset = form_value.Reference();
   }
 }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp?rev=360795=360794=360795=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp Wed May 
15 12:22:33 2019
@@ -348,7 +348,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   // will have a hard time tracking down an unnammed structure type in
   // the module DWO file, so we make sure we don't get into this
   // situation by always resolving typedefs from the DWO file.
-  const DWARFDIE encoding_die = dwarf->GetDIE(DIERef(encoding_uid));
+  const DWARFDIE encoding_die = encoding_uid.Reference();
 
   // First make sure that the die that this is typedef'ed to _is_ just
   // a declaration (DW_AT_declaration == 1), not a full definition
@@ -499,7 +499,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
   // Clang sometimes erroneously emits id as objc_object*.  In that
   // case we fix up the type to "id".
 
-  const DWARFDIE encoding_die = 
dwarf->GetDIE(DIERef(encoding_uid));
+  const DWARFDIE encoding_die = encoding_uid.Reference();
 
   if (encoding_die && encoding_die.Tag() == DW_TAG_structure_type) 
{
 if (const char *struct_name = encoding_die.GetName()) {
@@ -1150,7 +1150,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 bool has_template_params = false;
 DWARFFormValue specification_die_form;
 DWARFFormValue abstract_origin_die_form;
-dw_offset_t object_pointer_die_offset = DW_INVALID_OFFSET;
+DWARFDIE object_pointer_die;
 
 unsigned type_quals = 0;
 clang::StorageClass storage =
@@ -1221,7 +1221,7 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 break;
 
   case DW_AT_object_pointer:
-object_pointer_die_offset = form_value.Reference();
+object_pointer_die = form_value.Reference();
 break;
 
   case DW_AT_allocated:
@@ -1254,13 +1254,10 @@ TypeSP DWARFASTParserClang::ParseTypeFro
 }
 
 std::string object_pointer_name;
-if 

[Lldb-commits] [PATCH] D61502: Permit cross-CU references

2019-05-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil marked an inline comment as done.
jankratochvil added a comment.

In D61502#1503247 , @clayborg wrote:

> Just a few simplifications to GetName() and AppendTypeName() are in question 
> and can optionally be done if needed.


I will do that in a different patch as its removal of the `SymbolFileDWARF 
*dwarf2Data` parameter goes outside of scope of this patch.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61502



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


[Lldb-commits] [PATCH] D61805: Add nullptr check in FindLibCppStdFunctionCallableInfo()

2019-05-15 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

@friss we have several bugs, once of which I can reproduce but I have not been 
able to reduce it to a minimal case yet and the nullptr check is obviously the 
right to do.


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

https://reviews.llvm.org/D61805



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


[Lldb-commits] [PATCH] D61956: [CMake] Add first CMake cache files

2019-05-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/cmake/caches/Apple-lldb-osx.cmake:1
+include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)
+

Filename: Apple-lldb-macOS or apple-lldb-macos?
MacOS X has been renamed to OS X which has been renamed to macOS :-)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61956



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


[Lldb-commits] [PATCH] D61805: Add nullptr check in FindLibCppStdFunctionCallableInfo()

2019-05-15 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 199649.
shafik marked 4 inline comments as done.
shafik added a comment.

Simplified the checking of symbol being a `nullptr`


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

https://reviews.llvm.org/D61805

Files:
  source/Target/CPPLanguageRuntime.cpp


Index: source/Target/CPPLanguageRuntime.cpp
===
--- source/Target/CPPLanguageRuntime.cpp
+++ source/Target/CPPLanguageRuntime.cpp
@@ -204,6 +204,9 @@
 symbol = sc.symbol;
   }
 
+  if (symbol == nullptr)
+return optional_info;
+
   auto get_name = [_template_parameter, ]() {
 // Given case 1:
 //
@@ -214,8 +217,7 @@
   return llvm::Regex::escape(first_template_parameter.str()) +
  R"(::operator\(\)\(.*\))";
 
-if (symbol != NULL &&
-symbol->GetName().GetStringRef().contains("__invoke")) {
+if (symbol->GetName().GetStringRef().contains("__invoke")) {
 
   llvm::StringRef symbol_name = symbol->GetName().GetStringRef();
   size_t pos2 = symbol_name.find_last_of(':');
@@ -260,8 +262,7 @@
   addr.CalculateSymbolContextLineEntry(line_entry);
 
   if (first_template_parameter.contains("$_") ||
-  (symbol != nullptr &&
-   symbol->GetName().GetStringRef().contains("__invoke"))) {
+  symbol->GetName().GetStringRef().contains("__invoke")) {
 // Case 1 and 2
 optional_info.callable_case = LibCppStdFunctionCallableCase::Lambda;
   } else {


Index: source/Target/CPPLanguageRuntime.cpp
===
--- source/Target/CPPLanguageRuntime.cpp
+++ source/Target/CPPLanguageRuntime.cpp
@@ -204,6 +204,9 @@
 symbol = sc.symbol;
   }
 
+  if (symbol == nullptr)
+return optional_info;
+
   auto get_name = [_template_parameter, ]() {
 // Given case 1:
 //
@@ -214,8 +217,7 @@
   return llvm::Regex::escape(first_template_parameter.str()) +
  R"(::operator\(\)\(.*\))";
 
-if (symbol != NULL &&
-symbol->GetName().GetStringRef().contains("__invoke")) {
+if (symbol->GetName().GetStringRef().contains("__invoke")) {
 
   llvm::StringRef symbol_name = symbol->GetName().GetStringRef();
   size_t pos2 = symbol_name.find_last_of(':');
@@ -260,8 +262,7 @@
   addr.CalculateSymbolContextLineEntry(line_entry);
 
   if (first_template_parameter.contains("$_") ||
-  (symbol != nullptr &&
-   symbol->GetName().GetStringRef().contains("__invoke"))) {
+  symbol->GetName().GetStringRef().contains("__invoke")) {
 // Case 1 and 2
 optional_info.callable_case = LibCppStdFunctionCallableCase::Lambda;
   } else {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61921: [Target] Generalize language-specific behavior in ThreadPlanStepThrough

2019-05-15 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D61921#1503331 , @xiaobai wrote:

> In D61921#1503282 , @jingham wrote:
>
> > In D61921#1502502 , @labath wrote:
> >
> > > If this iteration is going to be used a lot, I'd recommend taking a bit 
> > > of time to implement an iterator abstraction over the language runtimes. 
> > > It takes a bit longer to set up, but I hope we can all agree that `for 
> > > (runtime: process->GetLanguageRuntimes()) runtime->foo();` is more 
> > > readable than `process->ForEachLanguageRuntime([] (runtime) { 
> > > runtime->foo(); })`. This is particularly true if you need some sort of a 
> > > control flow construct (`continue`, `break`, `return`) in the loop "body".
> >
> >
> > +1
>
>
> Yeah this seems reasonable.
>
> In D61921#1503290 , @jingham wrote:
>
> > On macOS, there are a handful of runtimes that the Plugin Manager knows 
> > about - C++, ObjC, maybe Swift.  But, for instance, we only load the ObjC 
> > language runtime into the process' m_language_runtimes array when we see 
> > libobjc.dylib get loaded.  A pure C++ program might never load 
> > libobjc.dylib, and so even though the Plugin Manager knows we have support 
> > for the ObjC language runtime, that plugin wouldn't be active in the 
> > current lldb_private::Process.  So there's a real difference between the 
> > "available" and the "currently loaded" runtimes. I was saying I didn't see 
> > any compelling reason to have an iterator over the available runtimes, just 
> > over the loaded ones.  Not that we didn't need one or the other iterator.
>
>
> Okay, that makes sense to me. Thanks for clearing that up. If I understand 
> correctly (which I think I do), creating an iterator abstraction to iterate 
> over the process' currently loaded runtimes instead of over every available 
> runtime is the better option here. I'll follow up with that change later 
> today or tomorrow unless somebody believes this is the wrong idea.


That seems the right choice to me and should be easy to implement - since it's 
just iterating over a map.  Iterable.h is some little dealie Sean whipped up a 
while ago that we use to make other contained maps iterable - e.g. the Types in 
a TypeMap.  You could just reuse that.


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

https://reviews.llvm.org/D61921



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


[Lldb-commits] [PATCH] D61956: [CMake] Add first CMake cache files

2019-05-15 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz created this revision.
sgraenitz added reviewers: xiaobai, compnerd, JDevlieghere, aprantl, labath.
Herald added a subscriber: mgorny.
Herald added a project: LLDB.

CMake cache scripts pre-populate the CMakeCache in a build directory with 
commonly used settings.
The CMake invocation from D61952  could look 
like this:

  cmake -G Ninja -C 
/path/to/llvm-project/lldb/cmake/caches/Apple-lldb-osx.cmake 
-DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lldb" ../llvm-project/llvm

Options specified on the command line will override options in the cache files 
(as long as caches don't use `FORCE`).
What do you think? (This is a first proposal and not set in stone.)


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61956

Files:
  lldb/cmake/caches/Apple-lldb-base.cmake
  lldb/cmake/caches/Apple-lldb-osx.cmake


Index: lldb/cmake/caches/Apple-lldb-osx.cmake
===
--- /dev/null
+++ lldb/cmake/caches/Apple-lldb-osx.cmake
@@ -0,0 +1,12 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)
+
+set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "")
+set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install/usr" CACHE 
STRING "")
+
+set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "")
+set(LLDB_NO_INSTALL_DEFAULT_RPATH ON CACHE BOOL "")
+set(LLDB_FRAMEWORK_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE 
STRING "")
+
+# Release builds may invert these:
+set(LLDB_USE_SYSTEM_DEBUGSERVER ON CACHE BOOL "")
+set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
Index: lldb/cmake/caches/Apple-lldb-base.cmake
===
--- /dev/null
+++ lldb/cmake/caches/Apple-lldb-base.cmake
@@ -0,0 +1,8 @@
+set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
+
+# Release builds set these explicitly:
+#set(LLDB_VERSION_MAJOR  CACHE STRING "")
+#set(LLDB_VERSION_MINOR 9 CACHE STRING "")
+#set(LLDB_VERSION_PATCH 9 CACHE STRING "")
+#set(LLDB_VERSION_SUFFIX git CACHE STRING "")


Index: lldb/cmake/caches/Apple-lldb-osx.cmake
===
--- /dev/null
+++ lldb/cmake/caches/Apple-lldb-osx.cmake
@@ -0,0 +1,12 @@
+include(${CMAKE_CURRENT_LIST_DIR}/Apple-lldb-base.cmake)
+
+set(CMAKE_OSX_DEPLOYMENT_TARGET 10.11 CACHE STRING "")
+set(CMAKE_INSTALL_PREFIX "${CMAKE_CURRENT_BINARY_DIR}/install/usr" CACHE STRING "")
+
+set(LLDB_BUILD_FRAMEWORK ON CACHE BOOL "")
+set(LLDB_NO_INSTALL_DEFAULT_RPATH ON CACHE BOOL "")
+set(LLDB_FRAMEWORK_INSTALL_DIR "${CMAKE_CURRENT_BINARY_DIR}/install" CACHE STRING "")
+
+# Release builds may invert these:
+set(LLDB_USE_SYSTEM_DEBUGSERVER ON CACHE BOOL "")
+set(LLVM_EXTERNALIZE_DEBUGINFO ON CACHE BOOL "")
Index: lldb/cmake/caches/Apple-lldb-base.cmake
===
--- /dev/null
+++ lldb/cmake/caches/Apple-lldb-base.cmake
@@ -0,0 +1,8 @@
+set(LLVM_TARGETS_TO_BUILD X86;ARM;AArch64 CACHE STRING "")
+set(LLVM_INSTALL_TOOLCHAIN_ONLY ON CACHE BOOL "")
+
+# Release builds set these explicitly:
+#set(LLDB_VERSION_MAJOR  CACHE STRING "")
+#set(LLDB_VERSION_MINOR 9 CACHE STRING "")
+#set(LLDB_VERSION_PATCH 9 CACHE STRING "")
+#set(LLDB_VERSION_SUFFIX git CACHE STRING "")
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61921: [Target] Generalize language-specific behavior in ThreadPlanStepThrough

2019-05-15 Thread Alex Langford via Phabricator via lldb-commits
xiaobai added a comment.

In D61921#1503282 , @jingham wrote:

> In D61921#1502502 , @labath wrote:
>
> > If this iteration is going to be used a lot, I'd recommend taking a bit of 
> > time to implement an iterator abstraction over the language runtimes. It 
> > takes a bit longer to set up, but I hope we can all agree that `for 
> > (runtime: process->GetLanguageRuntimes()) runtime->foo();` is more readable 
> > than `process->ForEachLanguageRuntime([] (runtime) { runtime->foo(); })`. 
> > This is particularly true if you need some sort of a control flow construct 
> > (`continue`, `break`, `return`) in the loop "body".
>
>
> +1


Yeah this seems reasonable.

In D61921#1503290 , @jingham wrote:

> On macOS, there are a handful of runtimes that the Plugin Manager knows about 
> - C++, ObjC, maybe Swift.  But, for instance, we only load the ObjC language 
> runtime into the process' m_language_runtimes array when we see libobjc.dylib 
> get loaded.  A pure C++ program might never load libobjc.dylib, and so even 
> though the Plugin Manager knows we have support for the ObjC language 
> runtime, that plugin wouldn't be active in the current lldb_private::Process. 
>  So there's a real difference between the "available" and the "currently 
> loaded" runtimes. I was saying I didn't see any compelling reason to have an 
> iterator over the available runtimes, just over the loaded ones.  Not that we 
> didn't need one or the other iterator.


Okay, that makes sense to me. Thanks for clearing that up. If I understand 
correctly (which I think I do), creating an iterator abstraction to iterate 
over the process' currently loaded runtimes instead of over every available 
runtime is the better option here. I'll follow up with that change later today 
or tomorrow unless somebody believes this is the wrong idea.


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

https://reviews.llvm.org/D61921



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


[Lldb-commits] [PATCH] D61913: Get back the navigation sidebar on the LLDB website

2019-05-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 199642.
aprantl added a comment.

Add more context to the diff.


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

https://reviews.llvm.org/D61913

Files:
  lldb/docs/CMakeLists.txt
  lldb/docs/_static/lldb.css
  lldb/docs/conf.py
  lldb/docs/index.rst

Index: lldb/docs/index.rst
===
--- lldb/docs/index.rst
+++ lldb/docs/index.rst
@@ -22,6 +22,7 @@
 
 .. toctree::
:maxdepth: 1
+   :caption: Goals & Status
 
status/about
status/goals
@@ -34,6 +35,7 @@
 
 .. toctree::
:maxdepth: 1
+   :caption: Use & Extension
 
use/tutorial
use/map
@@ -52,6 +54,7 @@
 
 .. toctree::
:maxdepth: 1
+   :caption: Resources
 
resources/download
resources/source
@@ -63,13 +66,21 @@
 API Documentation
 =
 
-* `Public Python API Reference `_
-* `Public C++ API Reference `_
-* `Private C++ Reference `_
+.. toctree::
+   :maxdepth: 1
+   :caption: API Documentation
+
+   Public Python API Reference 
+   Public C++ API Reference 
+   Private C++ Reference 
 
 External Links
 ==
 
-* `Source Code `_
-* `Code Reviews `_
-* `Bug Reports `_
+.. toctree::
+   :maxdepth: 1
+   :caption: External Links
+
+   Source Code 
+   Code Reviews 
+   Bug Reports 
Index: lldb/docs/conf.py
===
--- lldb/docs/conf.py
+++ lldb/docs/conf.py
@@ -92,12 +92,14 @@
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'haiku'
+html_theme = 'alabaster'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-#html_theme_options = {}
+html_theme_options = {
+'font_size': '11pt'
+}
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []
Index: lldb/docs/_static/lldb.css
===
--- lldb/docs/_static/lldb.css
+++ lldb/docs/_static/lldb.css
@@ -1,3 +1,11 @@
+div.document {
+  width: 90%;
+}
+
+div.body {
+  max-width: 90%;
+}
+
 table.mapping {
   width: 100%;
 }
@@ -9,7 +17,7 @@
 
 table.mapping td.hed {
   background: #606060;
-  color: white;
+  color: #fefefe;
   text-align: left;
   border-bottom: 2px #fff solid;
   font-weight: bold;
@@ -24,3 +32,52 @@
   padding-bottom: 15px;
 }
 
+div.sphinxsidebar h4,
+div.sphinxsidebar p, div.sphinxsidebar p a {
+  font: bold 12px Helvetica, Verdana, sans-serif;
+  color: #fefefe;
+  background: #606060; 
+  margin-bottom: 0; /*bottom spacing between header and rest of content*/
+  text-transform: uppercase;
+  padding: 7px 0 7px 7px;
+}
+
+div.sphinxsidebar a.reference {
+text-decoration: none;
+border-bottom: 1px solid #fefefe;
+}
+
+div.sphinxsidebar li {
+  margin-left: 0px;
+  padding-left: 0px;
+}
+
+div.sphinxsidebar ul {
+margin: 0px;
+}
+
+div.sphinxsidebar ul,
+div.sphinxsidebar ul a {
+  font: normal 10px Helvetica, Verdana, sans-serif;
+  background: #E9E9E9;
+  display: block;
+  padding: 5px 0;
+  line-height: 17px;
+  border-bottom: 1px solid #fefefe;
+}
+
+div.sphinxsidebar h1 {
+  /* Hide LLDB. */
+  visibility: hidden;
+}
+
+div.sphinxsidebar h3 {
+  /* Hide Navigation. */
+  display: none;
+}
+
+div.body p.caption {
+  /* Hide duplicate ToC entries. */
+  display: none;
+}
+
Index: lldb/docs/CMakeLists.txt
===
--- lldb/docs/CMakeLists.txt
+++ lldb/docs/CMakeLists.txt
@@ -58,6 +58,11 @@
   if (SPHINX_FOUND)
 if (${SPHINX_OUTPUT_HTML})
   add_sphinx_target(html lldb)
+  # Sphinx does not reliably update the custom CSS files, so force
+  # a clean rebuild of the documentation every time.
+  add_custom_target(clean-lldb-html COMMAND "${CMAKE_COMMAND}" -E
+remove_directory ${CMAKE_CURRENT_BINARY_DIR}/html)
+  add_dependencies(docs-lldb-html clean-lldb-html)
 endif()
   endif()
 endif()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61913: Get back the navigation sidebar on the LLDB website

2019-05-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl updated this revision to Diff 199641.
aprantl added a comment.
Herald added a subscriber: mgorny.

I think I addressed most/all of the outstanding bugs.


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

https://reviews.llvm.org/D61913

Files:
  lldb/docs/CMakeLists.txt
  lldb/docs/_static/lldb.css
  lldb/docs/conf.py
  lldb/docs/index.rst

Index: lldb/docs/index.rst
===
--- lldb/docs/index.rst
+++ lldb/docs/index.rst
@@ -22,6 +22,7 @@
 
 .. toctree::
:maxdepth: 1
+   :caption: Goals & Status
 
status/about
status/goals
@@ -34,6 +35,7 @@
 
 .. toctree::
:maxdepth: 1
+   :caption: Use & Extension
 
use/tutorial
use/map
@@ -52,6 +54,7 @@
 
 .. toctree::
:maxdepth: 1
+   :caption: Resources
 
resources/download
resources/source
@@ -63,13 +66,21 @@
 API Documentation
 =
 
-* `Public Python API Reference `_
-* `Public C++ API Reference `_
-* `Private C++ Reference `_
+.. toctree::
+   :maxdepth: 1
+   :caption: API Documentation
+
+   Public Python API Reference 
+   Public C++ API Reference 
+   Private C++ Reference 
 
 External Links
 ==
 
-* `Source Code `_
-* `Code Reviews `_
-* `Bug Reports `_
+.. toctree::
+   :maxdepth: 1
+   :caption: External Links
+
+   Source Code 
+   Code Reviews 
+   Bug Reports 
Index: lldb/docs/conf.py
===
--- lldb/docs/conf.py
+++ lldb/docs/conf.py
@@ -92,12 +92,14 @@
 
 # The theme to use for HTML and HTML Help pages.  See the documentation for
 # a list of builtin themes.
-html_theme = 'haiku'
+html_theme = 'alabaster'
 
 # Theme options are theme-specific and customize the look and feel of a theme
 # further.  For a list of options available for each theme, see the
 # documentation.
-#html_theme_options = {}
+html_theme_options = {
+'font_size': '11pt'
+}
 
 # Add any paths that contain custom themes here, relative to this directory.
 #html_theme_path = []
Index: lldb/docs/_static/lldb.css
===
--- lldb/docs/_static/lldb.css
+++ lldb/docs/_static/lldb.css
@@ -1,3 +1,11 @@
+div.document {
+  width: 90%;
+}
+
+div.body {
+  max-width: 90%;
+}
+
 table.mapping {
   width: 100%;
 }
@@ -9,7 +17,7 @@
 
 table.mapping td.hed {
   background: #606060;
-  color: white;
+  color: #fefefe;
   text-align: left;
   border-bottom: 2px #fff solid;
   font-weight: bold;
@@ -24,3 +32,52 @@
   padding-bottom: 15px;
 }
 
+div.sphinxsidebar h4,
+div.sphinxsidebar p, div.sphinxsidebar p a {
+  font: bold 12px Helvetica, Verdana, sans-serif;
+  color: #fefefe;
+  background: #606060; 
+  margin-bottom: 0; /*bottom spacing between header and rest of content*/
+  text-transform: uppercase;
+  padding: 7px 0 7px 7px;
+}
+
+div.sphinxsidebar a.reference {
+text-decoration: none;
+border-bottom: 1px solid #fefefe;
+}
+
+div.sphinxsidebar li {
+  margin-left: 0px;
+  padding-left: 0px;
+}
+
+div.sphinxsidebar ul {
+margin: 0px;
+}
+
+div.sphinxsidebar ul,
+div.sphinxsidebar ul a {
+  font: normal 10px Helvetica, Verdana, sans-serif;
+  background: #E9E9E9;
+  display: block;
+  padding: 5px 0;
+  line-height: 17px;
+  border-bottom: 1px solid #fefefe;
+}
+
+div.sphinxsidebar h1 {
+  /* Hide LLDB. */
+  visibility: hidden;
+}
+
+div.sphinxsidebar h3 {
+  /* Hide Navigation. */
+  display: none;
+}
+
+div.body p.caption {
+  /* Hide duplicate ToC entries. */
+  display: none;
+}
+
Index: lldb/docs/CMakeLists.txt
===
--- lldb/docs/CMakeLists.txt
+++ lldb/docs/CMakeLists.txt
@@ -58,6 +58,11 @@
   if (SPHINX_FOUND)
 if (${SPHINX_OUTPUT_HTML})
   add_sphinx_target(html lldb)
+  # Sphinx does not reliably update the custom CSS files, so force
+  # a clean rebuild of the documentation every time.
+  add_custom_target(clean-lldb-html COMMAND "${CMAKE_COMMAND}" -E
+remove_directory ${CMAKE_CURRENT_BINARY_DIR}/html)
+  add_dependencies(docs-lldb-html clean-lldb-html)
 endif()
   endif()
 endif()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61921: [Target] Generalize language-specific behavior in ThreadPlanStepThrough

2019-05-15 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D61921#1502352 , @xiaobai wrote:

> In D61921#1502338 , @jingham wrote:
>
> > Getting it from the Process's m_language_runtimes is probably fine.  On 
> > reflection, I can't think of a reason why you would want to iterate over 
> > all the available LanguageRuntimes, including the ones that hadn't been 
> > recognized in this Process yet.
> >
> > It's fine to do that in a separate patch.  If you do that it would be good 
> > to back port it to the other iterations over the LanguageRuntimes.
>
>
> Excellent, sounds good. I definitely intend to backport it to any other 
> iterations over LanguageRuntimes that I find. As for iterating over all 
> available LanguageRuntimes, this patch and my last few have sufficient 
> motivation for doing so, no? Maybe I'm misunderstanding what you mean.


On macOS, there are a handful of runtimes that the Plugin Manager knows about - 
C++, ObjC, maybe Swift.  But, for instance, we only load the ObjC language 
runtime into the process' m_language_runtimes array when we see libobjc.dylib 
get loaded.  A pure C++ program might never load libobjc.dylib, and so even 
though the Plugin Manager knows we have support for the ObjC language runtime, 
that plugin wouldn't be active in the current lldb_private::Process.  So 
there's a real difference between the "available" and the "currently loaded" 
runtimes. I was saying I didn't see any compelling reason to have an iterator 
over the available runtimes, just over the loaded ones.  Not that we didn't 
need one or the other iterator.

> 
> 
>> I don't see a really strong reason to make GetStepThroughTrampolinePlan a 
>> pure virtual method, this isn't required behavior for a language runtime.  
>> Why not make a default method that returns an empty thread plan?
> 
> Thinking about it further, you're probably right here. Not every language 
> might have the need to handle this scenario. I'll update this patch with your 
> suggestion.


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

https://reviews.llvm.org/D61921



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


[Lldb-commits] [PATCH] D61921: [Target] Generalize language-specific behavior in ThreadPlanStepThrough

2019-05-15 Thread Jim Ingham via Phabricator via lldb-commits
jingham added a comment.

In D61921#1502502 , @labath wrote:

> If this iteration is going to be used a lot, I'd recommend taking a bit of 
> time to implement an iterator abstraction over the language runtimes. It 
> takes a bit longer to set up, but I hope we can all agree that `for (runtime: 
> process->GetLanguageRuntimes()) runtime->foo();` is more readable than 
> `process->ForEachLanguageRuntime([] (runtime) { runtime->foo(); })`. This is 
> particularly true if you need some sort of a control flow construct 
> (`continue`, `break`, `return`) in the loop "body".


+1


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

https://reviews.llvm.org/D61921



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


[Lldb-commits] [PATCH] D61502: Permit cross-CU references

2019-05-15 Thread Greg Clayton via Phabricator via lldb-commits
clayborg accepted this revision.
clayborg added a comment.
This revision is now accepted and ready to land.

Just a few simplifications to GetName() and AppendTypeName() are in question 
and can optionally be done if needed.




Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:699
+//  *ostrm_ptr << HEX32 << abstract_die.GetOffset() << " ( ";
+GetName(dwarf2Data, abstract_die.GetCU(), abstract_die.GetOffset(), s);
   } break;

Should we make GetName() just take a DWARFDIE now?:
```
GetName(abstract_die, s);
```



Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:705
 s.PutCString(" ( ");
-AppendTypeName(dwarf2Data, cu, type_die_offset, s);
+AppendTypeName(dwarf2Data, type_die.GetCU(), type_die.GetOffset(), s);
 s.PutCString(" )");

Should we make AppendTypeName() just take a DWARFDIE now?:
```
AppendTypeName(type_die, s);
```



Comment at: 
lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp:1199-1200
+  DWARFDIE next_die = form_value.Reference();
+  result = AppendTypeName(dwarf2Data, next_die.GetCU(),
+  next_die.GetOffset(), s);
 }

Should we make AppendTypeName() just take a DWARFDIE now?:
```
AppendTypeName(next_die, s);
```


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61502



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


[Lldb-commits] [PATCH] D61952: [CMake] Stabilize install process for LLDB.framework

2019-05-15 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz created this revision.
sgraenitz added reviewers: xiaobai, compnerd, JDevlieghere, labath.
Herald added subscribers: kristof.beyls, javed.absar, mgorny, ki.stfu.
Herald added a project: LLDB.

We got used to post-build commands for copying resources into the build-tree 
framework. Executables were included by adding their target names to the list 
of `LLDB_FRAMEWORK_TOOLS`. Install destinations were set in 
`add_lldb_tool( ...)`.

This patch unifies these steps in `lldb_add_to_framework()` which:

- adds a copy to the build-tree framework for testing
- adds a cleanup step to run before install
- sets the target's destination in the install-tree

Key changes:

- `LLDB_BUILD_FRAMEWORK` now disables the default `GENERATE_INSTALL` logic
- `LLDB_FRAMEWORK_TOOLS` is obsolete; instead each tool calls 
`lldb_add_to_framework()` individually
- `lldb_setup_framework_rpaths_in_tool()` is obsolete; instead targets set them 
individually using `lldb_setup_rpaths` (old function will be removed in a 
separate commit to keep the diff readable)
- `lldb-framework` gets built by default
- the build-tree copy operation is a `POST_BUILD` command for the individual 
targets (instead of the `lldb-framework` target)
- while configuring the build, `lldb_framework_cleanup_list_raw.txt` collects 
` ` pairs to "strip" from the framework before install
- eventually, the final list of ` ` pairs is stored in 
`lldb_framework_cleanup_list_paths.txt`
- first action for `install` runs all the cleanup commands (see 
LLDBFrameworkInstall.cmake)

Test with monorepo:

  $ cmake -GNinja -DCMAKE_INSTALL_PREFIX=install/Developer/usr \
  -DLLDB_FRAMEWORK_INSTALL_DIR=install/SharedFrameworks \
  -DLLVM_TARGETS_TO_BUILD="X86;ARM;AArch64" 
-DLLVM_INSTALL_TOOLCHAIN_ONLY=ON \
  -DLLVM_ENABLE_PROJECTS="clang;libcxx;libcxxabi;lldb" \
  -DLLDB_BUILD_FRAMEWORK=ON -DLLDB_NO_INSTALL_DEFAULT_RPATH=ON 
../llvm-project/llvm
  $ ninja check-lldb
  $ ninja install

More background:

A framework is represented by the CMake target for the shared library it ships. 
Installing the target copies the entire bundle from the build-tree to the 
install-tree. This is mostly good, because we can add additional resource files 
to the build-tree framework bundle and `install` will include them 
automatically. We need the additional resources in the build-tree framework to 
facilitate testing.

Apart from simple files, however, LLDB.framework ships executable resources 
that define their own install targets (for extra processing at install-time 
like RPATH substitution or stripping). Apparently, CMake does not provide a way 
to run these install targets in the course of the framework install target. 
Instead they run either before or after framework install. The former is 
problematic, because the framework install will overwrite correctly processed 
resource executables with their build-tree pendants. While an install-order 
oriented fix may sound suitable at first appearance, we should keep in mind 
that, formally, CMake defines an order only locally 
:

  [install] This command generates installation rules for a project. Rules 
specified by calls to this command within a source directory are executed in 
order during installation. The order across directories is not defined.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61952

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/AddLLDB.cmake
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/cmake/modules/LLDBFramework.cmake
  lldb/cmake/modules/LLDBFrameworkInstall.cmake
  lldb/tools/argdumper/CMakeLists.txt
  lldb/tools/darwin-debug/CMakeLists.txt
  lldb/tools/debugserver/source/CMakeLists.txt
  lldb/tools/driver/CMakeLists.txt
  lldb/tools/lldb-mi/CMakeLists.txt
  lldb/tools/lldb-server/CMakeLists.txt
  lldb/tools/lldb-vscode/CMakeLists.txt

Index: lldb/tools/lldb-vscode/CMakeLists.txt
===
--- lldb/tools/lldb-vscode/CMakeLists.txt
+++ lldb/tools/lldb-vscode/CMakeLists.txt
@@ -29,7 +29,3 @@
   LINK_COMPONENTS
 Support
   )
-
-if(LLDB_BUILD_FRAMEWORK)
-  lldb_setup_framework_rpaths_in_tool(lldb-vscode)
-endif()
Index: lldb/tools/lldb-server/CMakeLists.txt
===
--- lldb/tools/lldb-server/CMakeLists.txt
+++ lldb/tools/lldb-server/CMakeLists.txt
@@ -77,3 +77,7 @@
 )
 
 target_link_libraries(lldb-server PRIVATE ${LLDB_SYSTEM_LIBS})
+
+if(LLDB_BUILD_FRAMEWORK)
+  lldb_add_to_framework(lldb-server)
+endif()
Index: lldb/tools/lldb-mi/CMakeLists.txt
===
--- lldb/tools/lldb-mi/CMakeLists.txt
+++ lldb/tools/lldb-mi/CMakeLists.txt
@@ -93,7 +93,3 @@
   LINK_COMPONENTS
 Support
   )
-
-if(LLDB_BUILD_FRAMEWORK)
-  lldb_setup_framework_rpaths_in_tool(lldb-mi)
-endif()
Index: lldb/tools/driver/CMakeLists.txt

[Lldb-commits] [PATCH] D61687: Update Python tests for lldb-server on Windows

2019-05-15 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: packages/Python/lldbsuite/test/dotest.py:1313
 
 # Don't do lldb-server (llgs) tests on anything except Linux.
+configuration.dont_do_llgs_test = not ("linux" in target_platform) and not 
("windows" in target_platform)

Update comment


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

https://reviews.llvm.org/D61687



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


[Lldb-commits] [PATCH] D61853: [FuncUnwinders] Use "symbol file" unwind plans for unwinding

2019-05-15 Thread Greg Clayton via Phabricator via lldb-commits
clayborg added inline comments.



Comment at: source/Symbol/FuncUnwinders.cpp:61-70
   if (UnwindPlanSP plan_sp = GetEHFrameUnwindPlan(target))
 return plan_sp;
   if (UnwindPlanSP plan_sp = GetDebugFrameUnwindPlan(target))
 return plan_sp;
   if (UnwindPlanSP plan_sp = GetCompactUnwindUnwindPlan(target))
 return plan_sp;
   if (UnwindPlanSP plan_sp = GetArmUnwindUnwindPlan(target))

I would love to at least make this entire function just be:
```
std::lock_guard guard(m_mutex);
 if (UnwindPlanSP plan_sp = GetSymbolFileUnwindPlan(thread))
return plan_sp;
  return nullptr;
```
and let the symbol files do all of the work as they will know if one plan is 
better than another?

Or do we need to add an ObjectFile component?:

```
std::lock_guard guard(m_mutex);
 if (UnwindPlanSP plan_sp = GetSymbolFileUnwindPlan(thread))
return plan_sp;
 if (UnwindPlanSP plan_sp = GetObjectFileUnwindPlan(thread))
return plan_sp;
  return nullptr;
```

Since macho will always check EH frame, then .debug_frame, then  compact unwind 
and never ARM. ELF would check EH frame, then .debug_frame, then ARM unwind.

If we split it up GetObjectFileUnwindPlan would check:
EH frame
Apple compact unwind
ARM compact unwind

and GetSymbolFileUnwindPlan would check:
.debug_frame
breakpad

I might also argue the ordering is wrong in the original function. The 
.debug_frame should come first since it can be more complete than EH frame. 
Granted most times the .debug_frame is the same as the EH frame, but if it 
isn't we should be using that first. Then EH frame, then apple compact unwind, 
then ARM unwind. That is why I put the symbol file check first in the example 
code where we check the symbol file, then the object file.


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

https://reviews.llvm.org/D61853



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


[Lldb-commits] [PATCH] D61942: DWARFContext: Return empty data extractors instead of null pointers

2019-05-15 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl accepted this revision.
aprantl added inline comments.
This revision is now accepted and ready to land.



Comment at: source/Plugins/SymbolFile/DWARF/DWARFContext.h:26
 
-  const DWARFDataExtractor *getOrLoadArangesData();
+  const DWARFDataExtractor ();
 };

lgtm



Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp:44
 llvm::Error
 DWARFDebugAranges::extract(const DWARFDataExtractor _aranges_data) {
   lldb::offset_t offset = 0;

lgtm



Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp:49
   m_context.getOrLoadArangesData();
-  if (debug_aranges_data) {
-llvm::Error error = m_cu_aranges_up->extract(*debug_aranges_data);
-if (error)
-  return std::move(error);
-  }
+  if (llvm::Error error = m_cu_aranges_up->extract(debug_aranges_data))
+return std::move(error);

ltgm


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

https://reviews.llvm.org/D61942



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


[Lldb-commits] [PATCH] D61833: Fix IPv6 support on lldb-server platform

2019-05-15 Thread António Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 199619.
aadsm added a comment.

Move function from anonymous namespace to const


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61833

Files:
  lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
  lldb/unittests/Host/CMakeLists.txt
  lldb/unittests/Host/ConnectionFileDescriptorTest.cpp
  lldb/unittests/Host/SocketTest.cpp
  lldb/unittests/Host/SocketTestUtilities.cpp
  lldb/unittests/Host/SocketTestUtilities.h

Index: lldb/unittests/Host/SocketTestUtilities.h
===
--- /dev/null
+++ lldb/unittests/Host/SocketTestUtilities.h
@@ -0,0 +1,47 @@
+//===- SocketTestUtilities.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_UNITTESTS_HOST_SOCKETTESTUTILITIES_H
+#define LLDB_UNITTESTS_HOST_SOCKETTESTUTILITIES_H
+
+#include 
+#include 
+#include 
+
+#include "lldb/Host/Config.h"
+#include "lldb/Host/Socket.h"
+#include "lldb/Host/common/TCPSocket.h"
+#include "lldb/Host/common/UDPSocket.h"
+#include "llvm/Support/FileSystem.h"
+#include "llvm/Support/Path.h"
+#include "llvm/Testing/Support/Error.h"
+
+#ifndef LLDB_DISABLE_POSIX
+#include "lldb/Host/posix/DomainSocket.h"
+#endif
+
+namespace lldb_private {
+template 
+void CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function _connect_addr,
+std::unique_ptr *a_up, std::unique_ptr *b_up);
+bool CreateTCPConnectedSockets(std::string listen_remote_ip,
+   std::unique_ptr *a_up,
+   std::unique_ptr *b_up);
+#ifndef LLDB_DISABLE_POSIX
+void CreateDomainConnectedSockets(llvm::StringRef path,
+  std::unique_ptr *a_up,
+  std::unique_ptr *b_up);
+#endif
+
+bool IsAddressFamilySupported(std::string ip);
+bool IsIPv4(std::string ip);
+} // namespace lldb_private
+
+#endif
\ No newline at end of file
Index: lldb/unittests/Host/SocketTestUtilities.cpp
===
--- /dev/null
+++ lldb/unittests/Host/SocketTestUtilities.cpp
@@ -0,0 +1,98 @@
+//===- SocketTestUtilities.cpp --*- 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
+//
+//===--===//
+
+#include "SocketTestUtilities.h"
+#include "lldb/Utility/StreamString.h"
+#include 
+
+using namespace lldb_private;
+
+const void AcceptThread(Socket *listen_socket, bool child_processes_inherit,
+Socket **accept_socket, Status *error) {
+  *error = listen_socket->Accept(*accept_socket);
+}
+
+template 
+void lldb_private::CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function _connect_addr,
+std::unique_ptr *a_up, std::unique_ptr *b_up) {
+  bool child_processes_inherit = false;
+  Status error;
+  std::unique_ptr listen_socket_up(
+  new SocketType(true, child_processes_inherit));
+  EXPECT_FALSE(error.Fail());
+  error = listen_socket_up->Listen(listen_remote_address, 5);
+  EXPECT_FALSE(error.Fail());
+  EXPECT_TRUE(listen_socket_up->IsValid());
+
+  Status accept_error;
+  Socket *accept_socket;
+  std::thread accept_thread(AcceptThread, listen_socket_up.get(),
+child_processes_inherit, _socket,
+_error);
+
+  std::string connect_remote_address = get_connect_addr(*listen_socket_up);
+  std::unique_ptr connect_socket_up(
+  new SocketType(true, child_processes_inherit));
+  EXPECT_FALSE(error.Fail());
+  error = connect_socket_up->Connect(connect_remote_address);
+  EXPECT_FALSE(error.Fail());
+  EXPECT_TRUE(connect_socket_up->IsValid());
+
+  a_up->swap(connect_socket_up);
+  EXPECT_TRUE(error.Success());
+  EXPECT_NE(nullptr, a_up->get());
+  EXPECT_TRUE((*a_up)->IsValid());
+
+  accept_thread.join();
+  b_up->reset(static_cast(accept_socket));
+  EXPECT_TRUE(accept_error.Success());
+  EXPECT_NE(nullptr, b_up->get());
+  EXPECT_TRUE((*b_up)->IsValid());
+
+  listen_socket_up.reset();
+}
+
+bool lldb_private::CreateTCPConnectedSockets(
+std::string listen_remote_ip, std::unique_ptr *socket_a_up,
+std::unique_ptr *socket_b_up) {
+  StreamString strm;
+  strm.Printf("[%s]:0", listen_remote_ip.c_str());
+  CreateConnectedSockets(
+  strm.GetString(),
+  [=](const TCPSocket ) {
+char 

[Lldb-commits] [PATCH] D61942: DWARFContext: Return empty data extractors instead of null pointers

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.

There are several reasons for doing this:

- generally, there's no reason to differentiate between a section being absent 
and it being present, but empty
- it matches more closely what llvm DWARF parser is doing (which also doesn't 
differentiate the two cases)
- SymbolFileDWARF also doesn't differentiate the two cases, which makes porting 
the rest of sections easier
- it fixes a bug in how the return-null-if-empty logic was implemented (it 
returned nullptr only the second time we tried to get the debug_aranges 
section), which meant that we hit an assert when trying to parse an 
empty-but-present section


https://reviews.llvm.org/D61942

Files:
  lit/SymbolFile/DWARF/debug_aranges-empty-section.s
  source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
  source/Plugins/SymbolFile/DWARF/DWARFContext.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp

Index: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -44,13 +44,10 @@
   assert(m_dwarf2Data);
 
   m_cu_aranges_up = llvm::make_unique();
-  const DWARFDataExtractor *debug_aranges_data =
+  const DWARFDataExtractor _aranges_data =
   m_context.getOrLoadArangesData();
-  if (debug_aranges_data) {
-llvm::Error error = m_cu_aranges_up->extract(*debug_aranges_data);
-if (error)
-  return std::move(error);
-  }
+  if (llvm::Error error = m_cu_aranges_up->extract(debug_aranges_data))
+return std::move(error);
 
   // Make a list of all CUs represented by the arange data in the file.
   std::set cus_with_data;
Index: source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
@@ -42,8 +42,6 @@
 // Extract
 llvm::Error
 DWARFDebugAranges::extract(const DWARFDataExtractor _aranges_data) {
-  assert(debug_aranges_data.ValidOffset(0));
-
   lldb::offset_t offset = 0;
 
   DWARFDebugArangeSet set;
@@ -65,8 +63,8 @@
   }
 }
 set.Clear();
-}
-return llvm::ErrorSuccess();
+  }
+  return llvm::ErrorSuccess();
 }
 
 void DWARFDebugAranges::Dump(Log *log) const {
Index: source/Plugins/SymbolFile/DWARF/DWARFContext.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFContext.h
+++ source/Plugins/SymbolFile/DWARF/DWARFContext.h
@@ -23,7 +23,7 @@
 public:
   explicit DWARFContext(Module );
 
-  const DWARFDataExtractor *getOrLoadArangesData();
+  const DWARFDataExtractor ();
 };
 } // namespace lldb_private
 
Index: source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
===
--- source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
+++ source/Plugins/SymbolFile/DWARF/DWARFContext.cpp
@@ -13,31 +13,32 @@
 using namespace lldb;
 using namespace lldb_private;
 
-static const DWARFDataExtractor *
-LoadOrGetSection(Module , SectionType section_type,
- llvm::Optional ) {
-  if (extractor.hasValue())
-return extractor->GetByteSize() > 0 ? extractor.getPointer() : nullptr;
-
-  // Initialize to an empty extractor so that we always take the fast path going
-  // forward.
-  extractor.emplace();
-
-  const SectionList *section_list = module.GetSectionList();
+static DWARFDataExtractor LoadSection(Module ,
+  SectionType section_type) {
+  SectionList *section_list = module.GetSectionList();
   if (!section_list)
-return nullptr;
+return DWARFDataExtractor();
 
   auto section_sp = section_list->FindSectionByType(section_type, true);
   if (!section_sp)
-return nullptr;
+return DWARFDataExtractor();
 
-  section_sp->GetSectionData(*extractor);
-  return extractor.getPointer();
+  DWARFDataExtractor data;
+  section_sp->GetSectionData(data);
+  return data;
+}
+
+static const DWARFDataExtractor &
+LoadOrGetSection(Module , SectionType section_type,
+ llvm::Optional ) {
+  if (!extractor)
+extractor = LoadSection(module, section_type);
+  return *extractor;
 }
 
 DWARFContext::DWARFContext(Module ) : m_module(module) {}
 
-const DWARFDataExtractor *DWARFContext::getOrLoadArangesData() {
+const DWARFDataExtractor ::getOrLoadArangesData() {
   return LoadOrGetSection(m_module, eSectionTypeDWARFDebugAranges,
   m_data_debug_aranges);
 }
Index: lit/SymbolFile/DWARF/debug_aranges-empty-section.s
===
--- /dev/null
+++ lit/SymbolFile/DWARF/debug_aranges-empty-section.s
@@ -0,0 +1,63 @@
+# Test that an empty .debug_aranges section doesn't confuse (or crash) us.
+
+# RUN: 

[Lldb-commits] [PATCH] D61877: [CMake] Add error to clarify that lldb requires libcxx

2019-05-15 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz added a comment.

Yes, sorry for that. I realized it after the commit was in. The commit I got 
from arc patch did have the original author information. It must have changed 
in `git llvm push`, probably because it's still going to SVN and then gets 
mirrored back to git. I missed this last detail.

> consider adding a "Patch by" line for future commits from those without 
> access.

Given that I do this about once a year, I hope we will have switched to git at 
this point ;-)


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61877



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


[Lldb-commits] [lldb] r360767 - [lldb] [test] Mark frequently failing flaky tests skipped on NetBSD

2019-05-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May 15 05:13:20 2019
New Revision: 360767

URL: http://llvm.org/viewvc/llvm-project?rev=360767=rev
Log:
[lldb] [test] Mark frequently failing flaky tests skipped on NetBSD

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py

lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py?rev=360767=360766=360767=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_set_restart/TestBreakpointSetRestart.py
 Wed May 15 05:13:20 2019
@@ -13,7 +13,7 @@ class BreakpointSetRestart(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 BREAKPOINT_TEXT = 'Set a breakpoint here'
 
-@expectedFlakeyNetBSD
+@skipIfNetBSD
 def test_breakpoint_set_restart(self):
 self.build()
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py?rev=360767=360766=360767=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
 Wed May 15 05:13:20 2019
@@ -33,7 +33,7 @@ class LongjmpTestCase(TestBase):
 @skipIfFreeBSD  # llvm.org/pr17214
 @expectedFailureAll(oslist=["linux"], bugnumber="llvm.org/pr20231")
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24778")
-@expectedFlakeyNetBSD
+@skipIfNetBSD
 def test_step_over(self):
 """Test stepping when the inferior calls setjmp/longjmp, in 
particular, thread step-over a longjmp."""
 self.build()

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py?rev=360767=360766=360767=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/watchpoint/multiple_threads/TestWatchpointMultipleThreads.py
 Wed May 15 05:13:20 2019
@@ -23,7 +23,7 @@ class WatchpointForMultipleThreadsTestCa
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
-@expectedFailureNetBSD
+@skipIfNetBSD
 def test_watchpoint_before_thread_start(self):
 """Test that we can hit a watchpoint we set before starting another 
thread"""
 self.do_watchpoint_test("Before running the thread")
@@ -31,7 +31,7 @@ class WatchpointForMultipleThreadsTestCa
 @expectedFailureAll(
 oslist=["windows"],
 bugnumber="llvm.org/pr24446: WINDOWS XFAIL TRIAGE - Watchpoints not 
supported on Windows")
-@expectedFailureNetBSD
+@skipIfNetBSD
 def test_watchpoint_after_thread_start(self):
 """Test that we can hit a watchpoint we set after starting another 
thread"""
 self.do_watchpoint_test("After running the thread")

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py?rev=360767=360766=360767=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
(original)
+++ lldb/trunk/packages/Python/lldbsuite/test/python_api/event/TestEvents.py 
Wed May 15 05:13:20 2019
@@ -32,6 +32,7 @@ class EventAPITestCase(TestBase):
 oslist=["linux"],
 bugnumber="llvm.org/pr23730 Flaky, fails ~1/10 cases")
 @skipIfWindows # This is flakey on Windows AND when it fails, it hangs: 
llvm.org/pr38373
+@skipIfNetBSD
 def test_listen_for_and_print_event(self):
 

[Lldb-commits] [PATCH] D61877: [CMake] Add error to clarify that lldb requires libcxx

2019-05-15 Thread J. Ryan Stinnett via Phabricator via lldb-commits
jryans added a comment.

@sgraenitz Thanks for committing!  I guess the original author info is lost 
for this one, but consider adding a "Patch by" line 
 for future commits 
from those without access.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61877



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


[Lldb-commits] [lldb] r360762 - Delete unnecessary copy ctors/copy assignment operators

2019-05-15 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Wed May 15 04:23:54 2019
New Revision: 360762

URL: http://llvm.org/viewvc/llvm-project?rev=360762=rev
Log:
Delete unnecessary copy ctors/copy assignment operators

It's the simplest and gives the cleanest semantics.

Modified:
lldb/trunk/include/lldb/Core/ModuleChild.h
lldb/trunk/include/lldb/Core/SearchFilter.h
lldb/trunk/include/lldb/Core/ValueObjectList.h
lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
lldb/trunk/include/lldb/Expression/DWARFExpression.h
lldb/trunk/include/lldb/Host/SocketAddress.h
lldb/trunk/include/lldb/Symbol/SymbolContext.h
lldb/trunk/include/lldb/Symbol/Type.h
lldb/trunk/include/lldb/Target/ThreadSpec.h
lldb/trunk/include/lldb/Utility/Broadcaster.h
lldb/trunk/include/lldb/Utility/Status.h
lldb/trunk/include/lldb/Utility/StringExtractor.h
lldb/trunk/include/lldb/Utility/StringLexer.h
lldb/trunk/source/Core/ModuleChild.cpp
lldb/trunk/source/Core/SearchFilter.cpp
lldb/trunk/source/Core/ValueObjectList.cpp
lldb/trunk/source/DataFormatters/TypeSummary.cpp
lldb/trunk/source/Expression/DWARFExpression.cpp
lldb/trunk/source/Host/common/SocketAddress.cpp
lldb/trunk/source/Symbol/SymbolContext.cpp
lldb/trunk/source/Symbol/Type.cpp
lldb/trunk/source/Target/ThreadSpec.cpp
lldb/trunk/source/Utility/Broadcaster.cpp
lldb/trunk/source/Utility/Status.cpp
lldb/trunk/source/Utility/StringExtractor.cpp
lldb/trunk/source/Utility/StringLexer.cpp
lldb/trunk/tools/intel-features/intel-pt/PTDecoder.cpp
lldb/trunk/tools/intel-features/intel-pt/PTDecoder.h
lldb/trunk/tools/lldb-perf/lib/MemoryGauge.cpp
lldb/trunk/tools/lldb-perf/lib/MemoryGauge.h

Modified: lldb/trunk/include/lldb/Core/ModuleChild.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ModuleChild.h?rev=360762=360761=360762=diff
==
--- lldb/trunk/include/lldb/Core/ModuleChild.h (original)
+++ lldb/trunk/include/lldb/Core/ModuleChild.h Wed May 15 04:23:54 2019
@@ -25,12 +25,6 @@ public:
   /// class.
   ModuleChild(const lldb::ModuleSP _sp);
 
-  /// Copy constructor.
-  ///
-  /// \param[in] rhs
-  /// A const ModuleChild class reference to copy.
-  ModuleChild(const ModuleChild );
-
   /// Destructor.
   ~ModuleChild();
 

Modified: lldb/trunk/include/lldb/Core/SearchFilter.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/SearchFilter.h?rev=360762=360761=360762=diff
==
--- lldb/trunk/include/lldb/Core/SearchFilter.h (original)
+++ lldb/trunk/include/lldb/Core/SearchFilter.h Wed May 15 04:23:54 2019
@@ -88,14 +88,10 @@ public:
   ///The Target that provides the module list to search.
   SearchFilter(const lldb::TargetSP _sp);
 
-  SearchFilter(const SearchFilter );
-
   SearchFilter(const lldb::TargetSP _sp, unsigned char filterType);
 
   virtual ~SearchFilter();
 
-  SearchFilter =(const SearchFilter );
-
   /// Call this method with a file spec to see if that spec passes the filter.
   ///
   /// \param[in] spec
@@ -317,12 +313,8 @@ public:
   ///The Module that limits the search.
   SearchFilterByModule(const lldb::TargetSP , const FileSpec );
 
-  SearchFilterByModule(const SearchFilterByModule );
-
   ~SearchFilterByModule() override;
 
-  SearchFilterByModule =(const SearchFilterByModule );
-
   bool ModulePasses(const lldb::ModuleSP _sp) override;
 
   bool ModulePasses(const FileSpec ) override;

Modified: lldb/trunk/include/lldb/Core/ValueObjectList.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/ValueObjectList.h?rev=360762=360761=360762=diff
==
--- lldb/trunk/include/lldb/Core/ValueObjectList.h (original)
+++ lldb/trunk/include/lldb/Core/ValueObjectList.h Wed May 15 04:23:54 2019
@@ -22,13 +22,6 @@ class ValueObject;
 // A collection of ValueObject values that
 class ValueObjectList {
 public:
-  // Constructors and Destructors
-  ValueObjectList();
-
-  ValueObjectList(const ValueObjectList );
-
-  ~ValueObjectList();
-
   const ValueObjectList =(const ValueObjectList );
 
   void Append(const lldb::ValueObjectSP _obj_sp);

Modified: lldb/trunk/include/lldb/DataFormatters/TypeSummary.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/DataFormatters/TypeSummary.h?rev=360762=360761=360762=diff
==
--- lldb/trunk/include/lldb/DataFormatters/TypeSummary.h (original)
+++ lldb/trunk/include/lldb/DataFormatters/TypeSummary.h Wed May 15 04:23:54 
2019
@@ -26,12 +26,9 @@ namespace lldb_private {
 class TypeSummaryOptions {
 public:
   TypeSummaryOptions();
-  TypeSummaryOptions(const TypeSummaryOptions );
 
   ~TypeSummaryOptions() = default;
 
-  TypeSummaryOptions =(const TypeSummaryOptions );
-

[Lldb-commits] [lldb] r360761 - [lldb] [lit] Pass --mode=compile to fix compiler-full-path.test

2019-05-15 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Wed May 15 03:48:55 2019
New Revision: 360761

URL: http://llvm.org/viewvc/llvm-project?rev=360761=rev
Log:
[lldb] [lit] Pass --mode=compile to fix compiler-full-path.test

Pass '--mode=compile' to fix compiler-full-path.test failure on NetBSD
buildbot (apparently due to lack of 'link' executable).

Fixes r360355.  Acked by Pavel Labath.

Modified:
lldb/trunk/lit/BuildScript/compiler-full-path.test

Modified: lldb/trunk/lit/BuildScript/compiler-full-path.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/BuildScript/compiler-full-path.test?rev=360761=360760=360761=diff
==
--- lldb/trunk/lit/BuildScript/compiler-full-path.test (original)
+++ lldb/trunk/lit/BuildScript/compiler-full-path.test Wed May 15 03:48:55 2019
@@ -1,7 +1,8 @@
-RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/clang -o foo \
-RUN:foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
-RUN: %build -n --verbose --arch=64 --compiler=/path/to/my/x64/cl.exe -o foo \
-RUN:foobar.c | FileCheck %s --check-prefix=CHECK-MSVC
+RUN: %build -n --mode=compile --verbose --arch=64 --compiler=/path/to/my/clang 
\
+RUN:-o foo foobar.c | FileCheck %s --check-prefix=CHECK-CLANG
+RUN: %build -n --mode=compile --verbose --arch=64 \
+RUN:--compiler=/path/to/my/x64/cl.exe -o foo foobar.c | \
+RUN:FileCheck %s --check-prefix=CHECK-MSVC
 
 CHECK-CLANG: Command Line: /path/to/my/clang
 CHECK-SAME: -o


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


[Lldb-commits] [PATCH] D61438: [ASTImporter] Use llvm::Expected and Error in the importer API

2019-05-15 Thread Gabor Marton via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360760: [ASTImporter] Use llvm::Expected and Error in the 
importer API (authored by martong, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61438?vs=199569=199573#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61438

Files:
  cfe/trunk/include/clang/AST/ASTImporter.h
  cfe/trunk/lib/AST/ASTImporter.cpp
  cfe/trunk/lib/AST/ExternalASTMerger.cpp
  cfe/trunk/lib/CrossTU/CrossTranslationUnit.cpp
  cfe/trunk/lib/Frontend/ASTMerge.cpp
  cfe/trunk/unittests/AST/ASTImporterFixtures.cpp
  cfe/trunk/unittests/AST/ASTImporterTest.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Symbol/ClangASTImporter.cpp
  lldb/trunk/source/Symbol/CxxModuleHandler.cpp

Index: cfe/trunk/include/clang/AST/ASTImporter.h
===
--- cfe/trunk/include/clang/AST/ASTImporter.h
+++ cfe/trunk/include/clang/AST/ASTImporter.h
@@ -183,7 +183,7 @@
 /// \return Error information (success or error).
 template 
 LLVM_NODISCARD llvm::Error importInto(ImportT , const ImportT ) {
-  auto ToOrErr = Import_New(From);
+  auto ToOrErr = Import(From);
   if (ToOrErr)
 To = *ToOrErr;
   return ToOrErr.takeError();
@@ -193,40 +193,29 @@
 /// context. A null type is imported as a null type (no error).
 ///
 /// \returns The equivalent type in the "to" context, or the import error.
-llvm::Expected Import_New(QualType FromT);
-// FIXME: Remove this version.
-QualType Import(QualType FromT);
+llvm::Expected Import(QualType FromT);
 
 /// Import the given type source information from the
 /// "from" context into the "to" context.
 ///
 /// \returns The equivalent type source information in the "to"
 /// context, or the import error.
-llvm::Expected Import_New(TypeSourceInfo *FromTSI);
-// FIXME: Remove this version.
-TypeSourceInfo *Import(TypeSourceInfo *FromTSI);
+llvm::Expected Import(TypeSourceInfo *FromTSI);
 
 /// Import the given attribute from the "from" context into the
 /// "to" context.
 ///
 /// \returns The equivalent attribute in the "to" context, or the import
 /// error.
-llvm::Expected Import_New(const Attr *FromAttr);
-// FIXME: Remove this version.
-Attr *Import(const Attr *FromAttr);
+llvm::Expected Import(const Attr *FromAttr);
 
 /// Import the given declaration from the "from" context into the
 /// "to" context.
 ///
 /// \returns The equivalent declaration in the "to" context, or the import
 /// error.
-llvm::Expected Import_New(Decl *FromD);
-llvm::Expected Import_New(const Decl *FromD) {
-  return Import_New(const_cast(FromD));
-}
-// FIXME: Remove this version.
-Decl *Import(Decl *FromD);
-Decl *Import(const Decl *FromD) {
+llvm::Expected Import(Decl *FromD);
+llvm::Expected Import(const Decl *FromD) {
   return Import(const_cast(FromD));
 }
 
@@ -251,28 +240,21 @@
 ///
 /// \returns The equivalent expression in the "to" context, or the import
 /// error.
-llvm::Expected Import_New(Expr *FromE);
-// FIXME: Remove this version.
-Expr *Import(Expr *FromE);
+llvm::Expected Import(Expr *FromE);
 
 /// Import the given statement from the "from" context into the
 /// "to" context.
 ///
 /// \returns The equivalent statement in the "to" context, or the import
 /// error.
-llvm::Expected Import_New(Stmt *FromS);
-// FIXME: Remove this version.
-Stmt *Import(Stmt *FromS);
+llvm::Expected Import(Stmt *FromS);
 
 /// Import the given nested-name-specifier from the "from"
 /// context into the "to" context.
 ///
 /// \returns The equivalent nested-name-specifier in the "to"
 /// context, or the import error.
-llvm::Expected
-Import_New(NestedNameSpecifier *FromNNS);
-// FIXME: Remove this version.
-NestedNameSpecifier *Import(NestedNameSpecifier *FromNNS);
+llvm::Expected Import(NestedNameSpecifier *FromNNS);
 
 /// Import the given nested-name-specifier-loc from the "from"
 /// context into the "to" context.
@@ -280,42 +262,32 @@
 /// \returns The equivalent nested-name-specifier-loc in the "to"
 /// context, or the import error.
 llvm::Expected
-Import_New(NestedNameSpecifierLoc FromNNS);
-// FIXME: Remove this version.
-NestedNameSpecifierLoc Import(NestedNameSpecifierLoc FromNNS);
+Import(NestedNameSpecifierLoc FromNNS);
 
 /// Import the given template name from the "from" context into the
 /// "to" context, or the 

[Lldb-commits] [PATCH] D61885: Minidump: Add support for the MemoryList stream

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 199570.
labath marked 6 inline comments as done.
labath added a comment.

Address review comments.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61885

Files:
  include/llvm/Object/Minidump.h
  include/llvm/ObjectYAML/MinidumpYAML.h
  lib/Object/Minidump.cpp
  lib/ObjectYAML/MinidumpYAML.cpp
  test/tools/obj2yaml/basic-minidump.yaml
  unittests/Object/MinidumpTest.cpp

Index: unittests/Object/MinidumpTest.cpp
===
--- unittests/Object/MinidumpTest.cpp
+++ unittests/Object/MinidumpTest.cpp
@@ -463,3 +463,51 @@
 EXPECT_EQ(0x08070605u, T.Context.RVA);
   }
 }
+
+TEST(MinidumpFile, getMemoryList) {
+  std::vector OneRange{
+  // Header
+  'M', 'D', 'M', 'P', 0x93, 0xa7, 0, 0, // Signature, Version
+  1, 0, 0, 0,   // NumberOfStreams,
+  32, 0, 0, 0,  // StreamDirectoryRVA
+  0, 1, 2, 3, 4, 5, 6, 7,   // Checksum, TimeDateStamp
+  0, 0, 0, 0, 0, 0, 0, 0,   // Flags
+// Stream Directory
+  5, 0, 0, 0, 20, 0, 0, 0,  // Type, DataSize,
+  44, 0, 0, 0,  // RVA
+  // MemoryDescriptor
+  1, 0, 0, 0, // NumberOfMemoryRanges
+  5, 6, 7, 8, 9, 0, 1, 2, // StartOfMemoryRange
+  3, 4, 5, 6, 7, 8, 9, 0, // DataSize, RVA
+  };
+  // Same as before, but with a padded memory list.
+  std::vector PaddedRange{
+  // Header
+  'M', 'D', 'M', 'P', 0x93, 0xa7, 0, 0, // Signature, Version
+  1, 0, 0, 0,   // NumberOfStreams,
+  32, 0, 0, 0,  // StreamDirectoryRVA
+  0, 1, 2, 3, 4, 5, 6, 7,   // Checksum, TimeDateStamp
+  0, 0, 0, 0, 0, 0, 0, 0,   // Flags
+// Stream Directory
+  5, 0, 0, 0, 24, 0, 0, 0,  // Type, DataSize,
+  44, 0, 0, 0,  // RVA
+  // MemoryDescriptor
+  1, 0, 0, 0, // NumberOfMemoryRanges
+  0, 0, 0, 0, // Padding
+  5, 6, 7, 8, 9, 0, 1, 2, // StartOfMemoryRange
+  3, 4, 5, 6, 7, 8, 9, 0, // DataSize, RVA
+  };
+
+  for (ArrayRef Data : {OneRange, PaddedRange}) {
+auto ExpectedFile = create(Data);
+ASSERT_THAT_EXPECTED(ExpectedFile, Succeeded());
+const MinidumpFile  = **ExpectedFile;
+Expected> ExpectedRanges = File.getMemoryList();
+ASSERT_THAT_EXPECTED(ExpectedRanges, Succeeded());
+ASSERT_EQ(1u, ExpectedRanges->size());
+const MemoryDescriptor  = ExpectedRanges.get()[0];
+EXPECT_EQ(0x0201000908070605u, MD.StartOfMemoryRange);
+EXPECT_EQ(0x06050403u, MD.Memory.DataSize);
+EXPECT_EQ(0x00090807u, MD.Memory.RVA);
+  }
+}
Index: test/tools/obj2yaml/basic-minidump.yaml
===
--- test/tools/obj2yaml/basic-minidump.yaml
+++ test/tools/obj2yaml/basic-minidump.yaml
@@ -37,20 +37,24 @@
   File Date High:   0x3C3D3E3F
   File Date Low:0x40414243
 CodeView Record: '44454647'
-Misc Record: 48494A4B
+Misc Record: '48494A4B'
   - Base of Image:   0x4C4D4E4F50515253
 Size of Image:   0x54555657
 Module Name: libb.so
-CodeView Record: 58595A5B
+CodeView Record: '58595A5B'
   - Type:ThreadList
 Threads:
   - Thread Id: 0x5C5D5E5F
 Priority Class:0x60616263
 Environment Block: 0x6465666768696A6B
-Context: 7C7D7E7F80818283
+Context:   '7C7D7E7F80818283'
 Stack:
   Start of Memory Range: 0x6C6D6E6F70717273
-  Content: 7475767778797A7B
+  Content:   '7475767778797A7B'
+  - Type:MemoryList
+Memory Ranges:   
+  - Start of Memory Range: 0x7C7D7E7F80818283
+Content:   '8485868788'
 ...
 
 # CHECK:  --- !minidump
@@ -97,11 +101,15 @@
 # CHECK-NEXT: CodeView Record: 58595A5B
 # CHECK-NEXT:   - Type:ThreadList
 # CHECK-NEXT: Threads:
-# CHECK-NEXT:   - Thread Id:   0x5C5D5E5F
-# CHECK-NEXT: Priority Class:  0x60616263
+# CHECK-NEXT:   - Thread Id: 0x5C5D5E5F
+# CHECK-NEXT: Priority Class:0x60616263
 # CHECK-NEXT: Environment Block: 0x6465666768696A6B
-# CHECK-NEXT: Context: 7C7D7E7F80818283
+# CHECK-NEXT: Context:   7C7D7E7F80818283
 # CHECK-NEXT: Stack:
 # CHECK-NEXT:   Start of Memory Range: 0x6C6D6E6F70717273
-# CHECK-NEXT:   Content: 7475767778797A7B
+# CHECK-NEXT:   Content:   7475767778797A7B
+# CHECK-NEXT:   - Type:MemoryList
+# CHECK-NEXT: Memory Ranges:   
+# CHECK-NEXT:   - Start 

[Lldb-commits] [PATCH] D61885: Minidump: Add support for the MemoryList stream

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: include/llvm/Object/Minidump.h:85-86
+  /// error is returned if the file does not contain this stream, or if the
+  /// stream is not large enough to contain the number of threads declared in
+  /// the stream header. The consistency of the Thread entries themselves is 
not
+  /// checked in any way.

jhenderson wrote:
> These two lines talk about threads. Is that a copy/paste error?
Yep, sorry. This is the downside of "straight-forward applications of 
established
patterns" :/



Comment at: include/llvm/ObjectYAML/MinidumpYAML.h:92
+/// A structure containing all data describing a single memory region.
+struct ParsedMemoryRange {
+  static constexpr Stream::StreamKind Kind = Stream::StreamKind::MemoryList;

jhenderson wrote:
> Would it make more sense to call this ParsedMermoryList, to match the 
> StreamType?
Not really, because this represents only one entry in the MemoryList stream, 
and not list as a whole. However, we could call it ParsedMemoryDescriptor, as 
that's the type of the list entries.



Comment at: test/tools/obj2yaml/basic-minidump.yaml:54-57
+  - Type:MemoryList
+Memory Ranges:   
+  - Start of Memory Range: 0x7C7D7E7F80818283
+Content: '8485868788'

jhenderson wrote:
> I'd probably find this neater if the Indentation of values for each entry 
> were more consistent, but I'm not too fussed.
> 
> Also, in the ThreadList above, the Content is not quoted, but here it is. 
> Please standardise it on one or the other.
Done. The different quoting of is actually a relict of how obj2yaml prints 
BinaryRef values (they omit quotes if the data happens to be contain hex (A-F) 
characters). Do you think it would be worth making this output more consistent 
too?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61885



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


[Lldb-commits] [PATCH] D61438: [ASTImporter] Use llvm::Expected and Error in the importer API

2019-05-15 Thread Gabor Marton via Phabricator via lldb-commits
martong updated this revision to Diff 199569.
martong added a comment.

- Rebase to master


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61438

Files:
  clang/include/clang/AST/ASTImporter.h
  clang/lib/AST/ASTImporter.cpp
  clang/lib/AST/ExternalASTMerger.cpp
  clang/lib/CrossTU/CrossTranslationUnit.cpp
  clang/lib/Frontend/ASTMerge.cpp
  clang/unittests/AST/ASTImporterFixtures.cpp
  clang/unittests/AST/ASTImporterTest.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/ClangASTImporter.cpp
  lldb/source/Symbol/CxxModuleHandler.cpp

Index: lldb/source/Symbol/CxxModuleHandler.cpp
===
--- lldb/source/Symbol/CxxModuleHandler.cpp
+++ lldb/source/Symbol/CxxModuleHandler.cpp
@@ -9,6 +9,7 @@
 #include "lldb/Symbol/CxxModuleHandler.h"
 
 #include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Utility/Log.h"
 #include "clang/Sema/Lookup.h"
 #include "llvm/Support/Error.h"
 
@@ -214,13 +215,15 @@
   // Import the foreign template arguments.
   llvm::SmallVector imported_args;
 
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+
   // If this logic is changed, also update templateArgsAreSupported.
   for (const TemplateArgument  : foreign_args.asArray()) {
 switch (arg.getKind()) {
 case TemplateArgument::Type: {
-  llvm::Expected type = m_importer->Import_New(arg.getAsType());
+  llvm::Expected type = m_importer->Import(arg.getAsType());
   if (!type) {
-llvm::consumeError(type.takeError());
+LLDB_LOG_ERROR(log, type.takeError(), "Couldn't import type: {0}");
 return {};
   }
   imported_args.push_back(TemplateArgument(*type));
@@ -229,9 +232,9 @@
 case TemplateArgument::Integral: {
   llvm::APSInt integral = arg.getAsIntegral();
   llvm::Expected type =
-  m_importer->Import_New(arg.getIntegralType());
+  m_importer->Import(arg.getIntegralType());
   if (!type) {
-llvm::consumeError(type.takeError());
+LLDB_LOG_ERROR(log, type.takeError(), "Couldn't import type: {0}");
 return {};
   }
   imported_args.push_back(
Index: lldb/source/Symbol/ClangASTImporter.cpp
===
--- lldb/source/Symbol/ClangASTImporter.cpp
+++ lldb/source/Symbol/ClangASTImporter.cpp
@@ -62,10 +62,18 @@
 
   ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
-  if (delegate_sp)
-return delegate_sp->Import(type);
-
-  return QualType();
+  if (!delegate_sp)
+return QualType();
+
+  llvm::Expected ret_or_error = delegate_sp->Import(type);
+  if (!ret_or_error) {
+Log *log =
+  lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+LLDB_LOG_ERROR(log, ret_or_error.takeError(),
+"Couldn't import type: {0}");
+return QualType();
+  }
+  return *ret_or_error;
 }
 
 lldb::opaque_compiler_type_t
@@ -105,34 +113,33 @@
 
   ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
-  if (delegate_sp) {
-clang::Decl *result = delegate_sp->Import(decl);
-
-if (!result) {
-  Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+  if (!delegate_sp)
+return nullptr;
 
-  if (log) {
-lldb::user_id_t user_id = LLDB_INVALID_UID;
-ClangASTMetadata *metadata = GetDeclMetadata(decl);
-if (metadata)
-  user_id = metadata->GetUserID();
-
-if (NamedDecl *named_decl = dyn_cast(decl))
-  log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s "
-  "'%s', metadata 0x%" PRIx64,
-  decl->getDeclKindName(),
-  named_decl->getNameAsString().c_str(), user_id);
-else
-  log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s, "
-  "metadata 0x%" PRIx64,
-  decl->getDeclKindName(), user_id);
-  }
+  llvm::Expected result = delegate_sp->Import(decl);
+  if (!result) {
+Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
+LLDB_LOG_ERROR(log, result.takeError(), "Couldn't import decl: {0}");
+if (log) {
+  lldb::user_id_t user_id = LLDB_INVALID_UID;
+  ClangASTMetadata *metadata = GetDeclMetadata(decl);
+  if (metadata)
+user_id = metadata->GetUserID();
+
+  if (NamedDecl *named_decl = dyn_cast(decl))
+log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s "
+"'%s', metadata 0x%" PRIx64,
+decl->getDeclKindName(),
+named_decl->getNameAsString().c_str(), user_id);
+  else
+log->Printf("  [ClangASTImporter] WARNING: Failed to import a %s, 

[Lldb-commits] [PATCH] D61687: Update Python tests for lldb-server on Windows

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteProcessInfo.py:205-217
 @skipUnlessPlatform(["linux"])
 @llgs_test
 def test_qProcessInfo_does_not_contain_cputype_cpusubtype_llgs_linux(self):
 self.init_llgs_test()
 self.build()
 self.qProcessInfo_does_not_contain_keys(set(['cputype', 'cpusubtype']))
+

These two tests can also be merged and made `@skipIfDarwin` as that is the only 
platform using the cpu(sub)type fields.



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteThreadsInStopReply.py:208-212
+# In current implementation of llgs on Windows, as a response to '\x03' 
packet, the debugger
+# of the native process will trigger a call to DebugBreakProcess that will 
create a new thread
+# to handle the exception debug event. So one more stop thread will be 
notified to the
+# delegate, e.g. llgs.  So tests below to assert the stop threads number 
will all fail.
+@expectedFailureAll(oslist=["windows"])

labath wrote:
> Is this something that we consider to be a bug, or is it just how debugging 
> is supposed to work on windows? If it's a bug then fine, but if not then we 
> might consider adjusting the expectations in the test (or just skipping it).
You marked this as done, but it's not obvious how is this comment resolved (or 
indeed, if it needs to be resolved). Can you elaborate?



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemote_qThreadStopInfo.py:146-153
 # All but one thread should report no stop reason.
-self.assertEqual(no_stop_reason_count, thread_count - 1)
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+
+# Consider one more thread created by calling DebugBreakProcess.
+if re.match(".*-.*-windows", triple):
+self.assertGreaterEqual(no_stop_reason_count, thread_count - 1)
+else:

labath wrote:
> I think this assertion should just be deleted. If the assertion below (that 
> one thread has a stop reason) is true, then it trivially true that the rest 
> of the threads don't have one. Whether or not a platforms spawns an extra 
> thread does not seem to be relevant for this test.
This comment doesn't appear to be "done".



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/inferior-crash/TestGdbRemoteAbort.py:40
 
+@skipIfWindows # For now the signo in T* packet is always 0.
 @llgs_test

labath wrote:
> Do you have any plans for changing this? Given that windows does not support 
> signals, maybe it should stay 0...
I'd like to hear your thoughts on this...

If the idea is for the signal number to stay zero, then the comment shouldn't 
say "for now" but instead say something to the effect that abort() does not 
cause a signal to be raised on windows because windows doesn't have signals. If 
the idea is to change this later, then I'd like to understand how/why.


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

https://reviews.llvm.org/D61687



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


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-15 Thread Michał Górny via Phabricator via lldb-commits
mgorny added a comment.

In D61713#1502606 , @labath wrote:

> In D61713#1502580 , @mgorny wrote:
>
> > Is this test supposed to work portably? It fails on NetBSD buildbot: 
> > http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20101/steps/run%20unit%20tests/logs/FAIL%3A%20LLDB%3A%3Acompiler-full-path.test
>
>
> I think we can just add --mode=link to the test to avoid it trying to mess 
> with the linker (since that is not important here anyway).


Did you mean `--mode=compile`? I can confirm it fixes the test. Should I commit 
it?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61713



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


[Lldb-commits] [lldb] r360757 - Group forward declarations in one namespace lldb_private {}

2019-05-15 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Wed May 15 02:15:13 2019
New Revision: 360757

URL: http://llvm.org/viewvc/llvm-project?rev=360757=rev
Log:
Group forward declarations in one namespace lldb_private {}

Modified:
lldb/trunk/include/lldb/Core/Address.h
lldb/trunk/include/lldb/Core/AddressRange.h
lldb/trunk/include/lldb/Core/AddressResolver.h
lldb/trunk/include/lldb/Core/AddressResolverFileLine.h
lldb/trunk/include/lldb/Core/AddressResolverName.h
lldb/trunk/include/lldb/Core/Communication.h
lldb/trunk/include/lldb/Core/Debugger.h
lldb/trunk/include/lldb/Core/Disassembler.h
lldb/trunk/include/lldb/Core/EmulateInstruction.h
lldb/trunk/include/lldb/Core/FileLineResolver.h
lldb/trunk/include/lldb/Core/FileSpecList.h
lldb/trunk/include/lldb/Core/FormatEntity.h
lldb/trunk/include/lldb/Core/Module.h
lldb/trunk/include/lldb/Core/ModuleList.h
lldb/trunk/include/lldb/Core/Opcode.h
lldb/trunk/include/lldb/Core/PluginManager.h
lldb/trunk/include/lldb/Core/SearchFilter.h
lldb/trunk/include/lldb/Core/Section.h
lldb/trunk/include/lldb/Core/SourceManager.h
lldb/trunk/include/lldb/Core/StreamAsynchronousIO.h
lldb/trunk/include/lldb/Core/UserSettingsController.h
lldb/trunk/include/lldb/Core/Value.h
lldb/trunk/include/lldb/Core/ValueObject.h
lldb/trunk/include/lldb/Core/ValueObjectCast.h
lldb/trunk/include/lldb/Core/ValueObjectConstResult.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultCast.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultChild.h
lldb/trunk/include/lldb/Core/ValueObjectConstResultImpl.h
lldb/trunk/include/lldb/Core/ValueObjectDynamicValue.h
lldb/trunk/include/lldb/Core/ValueObjectList.h
lldb/trunk/include/lldb/Core/ValueObjectMemory.h
lldb/trunk/include/lldb/Core/ValueObjectRegister.h
lldb/trunk/include/lldb/Core/ValueObjectSyntheticFilter.h
lldb/trunk/include/lldb/Core/ValueObjectVariable.h
lldb/trunk/include/lldb/Target/DynamicLoader.h
lldb/trunk/include/lldb/Utility/Broadcaster.h
lldb/trunk/include/lldb/Utility/Connection.h
lldb/trunk/include/lldb/Utility/DataExtractor.h
lldb/trunk/include/lldb/Utility/Event.h
lldb/trunk/include/lldb/Utility/JSON.h
lldb/trunk/include/lldb/Utility/Listener.h
lldb/trunk/include/lldb/Utility/StringList.h
lldb/trunk/include/lldb/Utility/StructuredData.h
lldb/trunk/include/lldb/Utility/UserID.h

Modified: lldb/trunk/include/lldb/Core/Address.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Address.h?rev=360757=360756=360757=diff
==
--- lldb/trunk/include/lldb/Core/Address.h (original)
+++ lldb/trunk/include/lldb/Core/Address.h Wed May 15 02:15:13 2019
@@ -19,36 +19,15 @@
 
 namespace lldb_private {
 class Block;
-}
-namespace lldb_private {
 class CompileUnit;
-}
-namespace lldb_private {
 class ExecutionContextScope;
-}
-namespace lldb_private {
 class Function;
-}
-namespace lldb_private {
 class SectionList;
-}
-namespace lldb_private {
 class Stream;
-}
-namespace lldb_private {
 class Symbol;
-}
-namespace lldb_private {
 class SymbolContext;
-}
-namespace lldb_private {
 class Target;
-}
-namespace lldb_private {
 struct LineEntry;
-}
-
-namespace lldb_private {
 
 /// \class Address Address.h "lldb/Core/Address.h"
 /// A section + offset based address class.

Modified: lldb/trunk/include/lldb/Core/AddressRange.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressRange.h?rev=360757=360756=360757=diff
==
--- lldb/trunk/include/lldb/Core/AddressRange.h (original)
+++ lldb/trunk/include/lldb/Core/AddressRange.h Wed May 15 02:15:13 2019
@@ -17,15 +17,8 @@
 
 namespace lldb_private {
 class SectionList;
-}
-namespace lldb_private {
 class Stream;
-}
-namespace lldb_private {
 class Target;
-}
-
-namespace lldb_private {
 
 /// \class AddressRange AddressRange.h "lldb/Core/AddressRange.h"
 /// A section + offset based address range class.

Modified: lldb/trunk/include/lldb/Core/AddressResolver.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressResolver.h?rev=360757=360756=360757=diff
==
--- lldb/trunk/include/lldb/Core/AddressResolver.h (original)
+++ lldb/trunk/include/lldb/Core/AddressResolver.h Wed May 15 02:15:13 2019
@@ -18,11 +18,7 @@
 
 namespace lldb_private {
 class ModuleList;
-}
-namespace lldb_private {
 class Stream;
-}
-namespace lldb_private {
 
 /// \class AddressResolver AddressResolver.h "lldb/Core/AddressResolver.h"
 /// This class works with SearchFilter to resolve function names and source

Modified: lldb/trunk/include/lldb/Core/AddressResolverFileLine.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/AddressResolverFileLine.h?rev=360757=360756=360757=diff

[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61713#1502580 , @mgorny wrote:

> Is this test supposed to work portably? It fails on NetBSD buildbot: 
> http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20101/steps/run%20unit%20tests/logs/FAIL%3A%20LLDB%3A%3Acompiler-full-path.test


I think we can just add --mode=link to the test to avoid it trying to mess with 
the linker (since that is not important here anyway).


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61713



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


[Lldb-commits] [PATCH] D61713: [lldb] build.py: fix behavior when passing --compiler=/path/to/compiler

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

In D61713#1502617 , @mgorny wrote:

> In D61713#1502606 , @labath wrote:
>
> > In D61713#1502580 , @mgorny wrote:
> >
> > > Is this test supposed to work portably? It fails on NetBSD buildbot: 
> > > http://lab.llvm.org:8011/builders/netbsd-amd64/builds/20101/steps/run%20unit%20tests/logs/FAIL%3A%20LLDB%3A%3Acompiler-full-path.test
> >
> >
> > I think we can just add --mode=link to the test to avoid it trying to mess 
> > with the linker (since that is not important here anyway).
>
>
> Did you mean `--mode=compile`? I can confirm it fixes the test. Should I 
> commit it?


Yes, that's what I meant. :) Feel free to commit.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61713



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


[Lldb-commits] [PATCH] D61686: Enable lldb-server on Windows

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added inline comments.
This revision is now accepted and ready to land.



Comment at: cmake/modules/LLDBConfig.cmake:421
 # ensure we build lldb-server when an lldb target is being built.
-if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD|Windows")
 set(LLDB_CAN_USE_LLDB_SERVER 1)

JDevlieghere wrote:
> Should we just remove `LLDB_CAN_USE_LLDB_SERVER` instead?
Sounds like a good idea.


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

https://reviews.llvm.org/D61686



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


[Lldb-commits] [PATCH] D61502: Permit cross-CU references

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

I like this patch in a lot of ways, because it makes the code cleaner, and 
prepares us for DWARF5, which can reference entries in other files in a lot of 
interesting ways.

The part I am not totally sure if is the alignment of lldb's DWARFFormValue 
with it's llvm counterpart. The llvm version does not have this fancy 
cross-unit resolution capability, but it just returns the raw value and leaves 
it up to the user to make sense of it (much like our class does now). However, 
it's possible that the llvm version does not have this functionality because 
there wasn't need for it, and it already has access to the DWARFContext, so it 
is certainly prepared to do more complex lookups, so it's possible it could be 
extended similarly once we go around to merging the two. And even if we go back 
to the world where `form.Reference()` returns a raw value, this may serve as a 
good intermediate step, because otherwise we'd have a hard time catching all 
the cases where someone calls `Reference`, and expects it to return an simple 
section offset.

So, overall, I'm inclined to accept this patch, but I'd like to hear what 
@JDevlieghere and @clayborg think.




Comment at: lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp:114-115
 DWARFDIE
 DWARFDIE::GetReferencedDIE(const dw_attr_t attr) const {
-  const dw_offset_t die_offset =
-  GetAttributeValueAsReference(attr, DW_INVALID_OFFSET);
-  if (die_offset != DW_INVALID_OFFSET)
-return GetDIE(die_offset);
-  else
-return DWARFDIE();
+  return GetAttributeValueAsReference(attr);
 }

It looks like these two functions are equivalent now and we can remove one of 
them (I vote to keep this one).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61502



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


[Lldb-commits] [PATCH] D61877: [CMake] Add error to clarify that lldb requires libcxx

2019-05-15 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL360756: [CMake] Add error to clarify that lldb requires 
libcxx (authored by stefan.graenitz, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61877?vs=199394=199564#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61877

Files:
  lldb/trunk/CMakeLists.txt
  lldb/trunk/docs/resources/build.rst


Index: lldb/trunk/docs/resources/build.rst
===
--- lldb/trunk/docs/resources/build.rst
+++ lldb/trunk/docs/resources/build.rst
@@ -151,6 +151,12 @@
 LLVM, then you can pass LLVM-specific CMake variables to cmake when building
 LLDB.
 
+If you are building both Clang and LLDB together, be sure to also add libc++,
+which is currently required for testing on macOS:
+
+::
+
+  > cmake -D LLVM_ENABLE_PROJECTS='clang;lldb;libcxx' $PATH_TO_LLVM -G Ninja
 
 Here are some commonly used LLDB-specific CMake variables:
 
Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -124,6 +124,24 @@
   message(WARNING "LLDB test suite requires libc++ in 
llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}")
 endif()
   else()
+# We require libcxx for the test suite, so if we aren't building it,
+# try to provide a helpful error about how to resolve the situation.
+if(NOT TARGET cxx)
+  if(LLVM_ENABLE_PROJECTS STREQUAL "")
+# If `LLVM_ENABLE_PROJECTS` is not being used (implying that we are
+# using the old layout), suggest checking it out.
+message(FATAL_ERROR
+  "LLDB test suite requires libc++, but it is currently disabled. "
+  "Please checkout `libcxx` in `llvm/projects` or disable tests "
+  "via `LLDB_INCLUDE_TESTS=OFF`.")
+  else()
+# If `LLVM_ENABLE_PROJECTS` is being used, suggest adding it.
+message(FATAL_ERROR
+  "LLDB test suite requires libc++, but it is currently disabled. "
+  "Please add `libcxx` to `LLVM_ENABLE_PROJECTS` or disable tests "
+  "via `LLDB_INCLUDE_TESTS=OFF`.")
+  endif()
+endif()
 list(APPEND LLDB_TEST_DEPS cxx)
   endif()
 endif()


Index: lldb/trunk/docs/resources/build.rst
===
--- lldb/trunk/docs/resources/build.rst
+++ lldb/trunk/docs/resources/build.rst
@@ -151,6 +151,12 @@
 LLVM, then you can pass LLVM-specific CMake variables to cmake when building
 LLDB.
 
+If you are building both Clang and LLDB together, be sure to also add libc++,
+which is currently required for testing on macOS:
+
+::
+
+  > cmake -D LLVM_ENABLE_PROJECTS='clang;lldb;libcxx' $PATH_TO_LLVM -G Ninja
 
 Here are some commonly used LLDB-specific CMake variables:
 
Index: lldb/trunk/CMakeLists.txt
===
--- lldb/trunk/CMakeLists.txt
+++ lldb/trunk/CMakeLists.txt
@@ -124,6 +124,24 @@
   message(WARNING "LLDB test suite requires libc++ in llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}")
 endif()
   else()
+# We require libcxx for the test suite, so if we aren't building it,
+# try to provide a helpful error about how to resolve the situation.
+if(NOT TARGET cxx)
+  if(LLVM_ENABLE_PROJECTS STREQUAL "")
+# If `LLVM_ENABLE_PROJECTS` is not being used (implying that we are
+# using the old layout), suggest checking it out.
+message(FATAL_ERROR
+  "LLDB test suite requires libc++, but it is currently disabled. "
+  "Please checkout `libcxx` in `llvm/projects` or disable tests "
+  "via `LLDB_INCLUDE_TESTS=OFF`.")
+  else()
+# If `LLVM_ENABLE_PROJECTS` is being used, suggest adding it.
+message(FATAL_ERROR
+  "LLDB test suite requires libc++, but it is currently disabled. "
+  "Please add `libcxx` to `LLVM_ENABLE_PROJECTS` or disable tests "
+  "via `LLDB_INCLUDE_TESTS=OFF`.")
+  endif()
+endif()
 list(APPEND LLDB_TEST_DEPS cxx)
   endif()
 endif()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61908: DWARF: Add ability to reference debug info coming from multiple sections

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 199562.
labath marked 4 inline comments as done.
labath added a comment.

- use enum class for the section type
- put DIERef as a member of HashedNameToDie::DIEInfo


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

https://reviews.llvm.org/D61908

Files:
  lit/SymbolFile/DWARF/array-sizes.s
  lit/SymbolFile/DWARF/dwarf5_locations.s
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -160,5 +160,5 @@
 SymbolFileDWARFDwo::GetDIE(const DIERef _ref) {
   lldbassert(die_ref.cu_offset == m_base_dwarf_cu->GetOffset() ||
  die_ref.cu_offset == DW_INVALID_OFFSET);
-  return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
+  return DebugInfo()->GetDIEForDIEOffset(die_ref.section, die_ref.die_offset);
 }
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.h
@@ -287,10 +287,13 @@
   DWARFDIE GetDIE(lldb::user_id_t uid);
 
   lldb::user_id_t GetUID(const DWARFBaseDIE ) {
-return GetID() | die.GetOffset();
+return GetUID(die.GetDIERef());
   }
 
-  lldb::user_id_t GetUID(const DIERef ) { return GetID() | ref.die_offset; }
+  lldb::user_id_t GetUID(const DIERef ) {
+return GetID() | ref.die_offset |
+   (lldb::user_id_t(ref.section == DIERef::Section::DebugTypes) << 63);
+  }
 
   virtual std::unique_ptr
   GetDwoSymbolFileForCompileUnit(DWARFUnit _cu,
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -349,10 +349,10 @@
 }
 
 SymbolFileDWARF::SymbolFileDWARF(ObjectFile *objfile)
-: SymbolFile(objfile), UserID(uint64_t(DW_INVALID_OFFSET)
-  << 32), // Used by SymbolFileDWARFDebugMap to
-  // when this class parses .o files to
-  // contain the .o file index/ID
+: SymbolFile(objfile),
+  UserID(0x7fff), // Used by SymbolFileDWARFDebugMap to
+  // when this class parses .o files to
+  // contain the .o file index/ID
   m_debug_map_module_wp(), m_debug_map_symfile(NULL),
   m_context(*objfile->GetModule()), m_data_debug_abbrev(),
   m_data_debug_frame(), m_data_debug_info(), m_data_debug_line(),
@@ -1257,9 +1257,11 @@
   if (SymbolFileDWARFDebugMap *debug_map = GetDebugMapSymfile()) {
 SymbolFileDWARF *dwarf = debug_map->GetSymbolFileByOSOIndex(
 debug_map->GetOSOIndexFromUserID(uid));
-return {dwarf, {DW_INVALID_OFFSET, dw_offset_t(uid)}};
+return {dwarf, {DIERef::Section::DebugInfo, DW_INVALID_OFFSET, dw_offset_t(uid)}};
   }
-  uint32_t dwarf_id = uid >> 32;
+  DIERef::Section section =
+  uid >> 63 ? DIERef::Section::DebugTypes : DIERef::Section::DebugInfo;
+  uint32_t dwarf_id = uid >> 32 & 0x7fff;
   dw_offset_t die_offset = uid;
 
   if (die_offset == DW_INVALID_OFFSET)
@@ -1272,7 +1274,7 @@
 dwarf = unit->GetDwoSymbolFile();
 }
   }
-  return {dwarf, {DW_INVALID_OFFSET, die_offset}};
+  return {dwarf, {section, DW_INVALID_OFFSET, die_offset}};
 }
 
 DWARFDIE
@@ -1765,7 +1767,8 @@
 }
   } else {
 uint32_t cu_idx = DW_INVALID_INDEX;
-DWARFUnit *dwarf_cu = debug_info->GetUnitAtOffset(cu_offset, _idx);
+DWARFUnit *dwarf_cu = debug_info->GetUnitAtOffset(DIERef::Section::DebugInfo,
+  cu_offset, _idx);
 if (dwarf_cu) {
   sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
   if (sc.comp_unit) {
Index: source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp

[Lldb-commits] [PATCH] D61908: DWARF: Add ability to reference debug info coming from multiple sections

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath marked 10 inline comments as done.
labath added inline comments.



Comment at: source/Plugins/SymbolFile/DWARF/DIERef.cpp:18
   if (form_value.IsValid()) {
 const DWARFUnit *dwarf_cu = form_value.GetCompileUnit();
 if (dwarf_cu) {

clayborg wrote:
> We should maybe rename DWARFFormValue::GetCompileUnit() to 
> DWARFFormValue::GetUnit()? Also we might use "unit" instead of "dwarf_cu" 
> here?
Done in r360754.



Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp:141
+  uint32_t idx = FindUnitIndex(section, cu_offset);
   DWARFUnit *result = GetUnitAtIndex(idx);
   if (result && result->GetOffset() != cu_offset) {

clayborg wrote:
> Does the "GetUnitAtIndex" call need to take "section" to get the right unit?
No, the idea is that the unit index will still uniquely determine the 
DWARFUnit, regardless of the section it is in (so the sections will still be 
kind of concatenated, but only at the index level). This makes it easy to 
convert back and forth between DWARFUnits and lldb_private::CompileUnits.



Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp:162
+  uint32_t idx = FindUnitIndex(section, die_offset);
   DWARFUnit *result = GetUnitAtIndex(idx);
   if (result && !result->ContainsDIEOffset(die_offset))

clayborg wrote:
> Does the "GetUnitAtIndex" call need to take "section" to get the right unit?
> 
> 
Same comment as above.



Comment at: source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h:51-52
   struct DIEInfo {
 dw_offset_t cu_offset;
 dw_offset_t offset; // The DIE offset
 dw_tag_t tag;

clayborg wrote:
> Should we use a DIERef here instead of these two members?
Sounds like a good idea. I'll update the patch accordingly.



Comment at: source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h:61
+explicit operator DIERef() const {
+  return {DIERef::InfoSection, cu_offset, offset};
+}

clayborg wrote:
> just return the DIERef member variable if we switch according to above inline 
> comment
Done. I'm not sure the operator makes that much sense now as one can just 
access the contained DIERef directly.  I've kept it for now to avoid needing to 
update all callsites, but I can also delete it if you prefer.


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

https://reviews.llvm.org/D61908



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


[Lldb-commits] [lldb] r360754 - DWARF: s/CompileUnit/Unit/ in DWARFFormValue

2019-05-15 Thread Pavel Labath via lldb-commits
Author: labath
Date: Wed May 15 00:45:40 2019
New Revision: 360754

URL: http://llvm.org/viewvc/llvm-project?rev=360754=rev
Log:
DWARF: s/CompileUnit/Unit/ in DWARFFormValue

The class has been converted to use DWARFUnit, but a number of uses of
the words compile unit remained. This removes all such references
Get/SetCompileUnit becomes Get/SetUnit, and m_cu becomes m_unit.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp?rev=360754=360753=360754=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.cpp Wed May 15 00:45:40 
2019
@@ -16,12 +16,11 @@
 DIERef::DIERef(const DWARFFormValue _value)
 : cu_offset(DW_INVALID_OFFSET), die_offset(DW_INVALID_OFFSET) {
   if (form_value.IsValid()) {
-const DWARFUnit *dwarf_cu = form_value.GetCompileUnit();
-if (dwarf_cu) {
-  if (dwarf_cu->GetBaseObjOffset() != DW_INVALID_OFFSET)
-cu_offset = dwarf_cu->GetBaseObjOffset();
+if (const DWARFUnit *unit = form_value.GetUnit()) {
+  if (unit->GetBaseObjOffset() != DW_INVALID_OFFSET)
+cu_offset = unit->GetBaseObjOffset();
   else
-cu_offset = dwarf_cu->GetOffset();
+cu_offset = unit->GetOffset();
 }
 die_offset = form_value.Reference();
   }

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp?rev=360754=360753=360754=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFAttribute.cpp Wed May 15 
00:45:40 2019
@@ -35,7 +35,7 @@ void DWARFAttributes::Append(const DWARF
 bool DWARFAttributes::ExtractFormValueAtIndex(
 uint32_t i, DWARFFormValue _value) const {
   const DWARFUnit *cu = CompileUnitAtIndex(i);
-  form_value.SetCompileUnit(cu);
+  form_value.SetUnit(cu);
   form_value.SetForm(FormAtIndex(i));
   lldb::offset_t offset = DIEOffsetAtIndex(i);
   return form_value.ExtractValue(cu->GetData(), );

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp?rev=360754=360753=360754=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp Wed May 
15 00:45:40 2019
@@ -833,7 +833,7 @@ dw_offset_t DWARFDebugInfoEntry::GetAttr
   debug_info_data, , cu);
 
   const dw_offset_t attr_offset = offset;
-  form_value.SetCompileUnit(cu);
+  form_value.SetUnit(cu);
   form_value.SetForm(abbrevDecl->GetFormByIndex(idx));
   if (form_value.ExtractValue(debug_info_data, )) {
 if (end_attr_offset_ptr)

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp?rev=360754=360753=360754=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp Wed May 15 
00:45:40 2019
@@ -104,16 +104,8 @@ DWARFFormValue::GetFixedFormSizesForAddr
   return FixedFormSizes();
 }
 
-DWARFFormValue::DWARFFormValue() : m_cu(NULL), m_form(0), m_value() {}
-
-DWARFFormValue::DWARFFormValue(const DWARFUnit *cu)
-: m_cu(cu), m_form(0), m_value() {}
-
-DWARFFormValue::DWARFFormValue(const DWARFUnit *cu, dw_form_t form)
-: m_cu(cu), m_form(form), m_value() {}
-
 void DWARFFormValue::Clear() {
-  m_cu = nullptr;
+  m_unit = nullptr;
   m_form = 0;
   m_value = ValueTypeTag();
 }
@@ -133,9 +125,9 @@ bool DWARFFormValue::ExtractValue(const
 indirect = false;
 switch (m_form) {
 case DW_FORM_addr:
-  assert(m_cu);
+  assert(m_unit);
   m_value.value.uval =
-  data.GetMaxU64(offset_ptr, DWARFUnit::GetAddressByteSize(m_cu));
+  data.GetMaxU64(offset_ptr, DWARFUnit::GetAddressByteSize(m_unit));
   break;
 case DW_FORM_block1:
   m_value.value.uval = data.GetU8(offset_ptr);
@@ -207,9 +199,9 @@ bool DWARFFormValue::ExtractValue(const
 

[Lldb-commits] [PATCH] D61921: [Target] Generalize language-specific behavior in ThreadPlanStepThrough

2019-05-15 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

If this iteration is going to be used a lot, I'd recommend taking a bit of time 
to implement an iterator abstraction over the language runtimes. It takes a bit 
longer to set up, but I hope we can all agree that `for (runtime: 
process->GetLanguageRuntimes()) runtime->foo();` is more readable than 
`process->ForEachLanguageRuntime([] (runtime) { runtime->foo(); })`. This is 
particularly true if you need some sort of a control flow construct 
(`continue`, `break`, `return`) in the loop "body".


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

https://reviews.llvm.org/D61921



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