[Lldb-commits] [lldb] r360562 - Remove declaratons of deleted structs/classes

2019-05-13 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Mon May 13 01:25:53 2019
New Revision: 360562

URL: http://llvm.org/viewvc/llvm-project?rev=360562&view=rev
Log:
Remove declaratons of deleted structs/classes

Modified:
lldb/trunk/include/lldb/lldb-forward.h

Modified: lldb/trunk/include/lldb/lldb-forward.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/lldb-forward.h?rev=360562&r1=360561&r2=360562&view=diff
==
--- lldb/trunk/include/lldb/lldb-forward.h (original)
+++ lldb/trunk/include/lldb/lldb-forward.h Mon May 13 01:25:53 2019
@@ -18,7 +18,6 @@ namespace lldb_private {
 
 class ABI;
 class Address;
-class AddressImpl;
 class AddressRange;
 class AddressResolver;
 class ArchSpec;
@@ -52,7 +51,6 @@ class ClangASTSource;
 class ClangExpressionDeclMap;
 class ClangExpressionParser;
 class ClangExpressionVariable;
-class ClangExpressionVariables;
 class ClangModulesDeclVendor;
 class ClangPersistentVariables;
 class CommandInterpreter;
@@ -67,7 +65,6 @@ class CompilerDecl;
 class CompilerDeclContext;
 class CompilerType;
 class CompileUnit;
-class Condition;
 class Connection;
 class ConnectionFileDescriptor;
 class ConstString;
@@ -94,7 +91,6 @@ class EventData;
 class EventDataStructuredData;
 class ExecutionContext;
 class ExecutionContextRef;
-class ExecutionContextRefLocker;
 class ExecutionContextScope;
 class Expression;
 class ExpressionVariable;
@@ -134,10 +130,8 @@ class Module;
 class ModuleList;
 class ModuleSpec;
 class ModuleSpecList;
-class Mutex;
 struct NameSearchContext;
 class ObjCLanguageRuntime;
-class ObjCRuntimeSyntheticProvider;
 class ObjectContainer;
 class OptionGroup;
 class OptionGroupOptions;
@@ -166,7 +160,6 @@ class OptionValueSInt64;
 class OptionValueString;
 class OptionValueUInt64;
 class OptionValueUUID;
-class NamedOption;
 class PathMappingList;
 class FunctionCaller;
 class PersistentExpressionState;
@@ -184,8 +177,6 @@ struct PropertyDefinition;
 class RecognizedStackFrame;
 class RegisterCheckpoint;
 class RegisterContext;
-class RegisterLocation;
-class RegisterLocationList;
 class RegisterValue;
 class RegularExpression;
 class REPL;
@@ -196,7 +187,6 @@ class ScriptInterpreterLocker;
 struct ScriptSummaryFormat;
 class SearchFilter;
 class Section;
-class SectionImpl;
 class SectionList;
 class SectionLoadHistory;
 class SectionLoadList;
@@ -204,7 +194,6 @@ class Settings;
 class SourceManager;
 class SourceManagerImpl;
 class StackFrame;
-class StackFrameImpl;
 class StackFrameList;
 class StackFrameRecognizer;
 class StackFrameRecognizerManager;


___
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-13 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

The actual change looks obviously correct. Below are my comments on the test 
situation.

> I wanted to reuse the CreateConnectedSockets part of the SocketTests. 
> Initially I thought about creating a few functions in a test socket utility 
> file, but then I realized the tests need to initialize the Socket plugin for 
> these functions to work. In the end I created a new class (SocketBasedTest) 
> so I can ensure this plugin is correctly initialized and teared down. 
> However, I'm not a fan of subclassing as a means of code shared (as I prefer 
> composition or delegation). What are your thoughts on this?

I don't think that the necessity of the Socket::Initialize call should prevent 
you from creating free functions. Everything else in lldb dealing with sockets 
already assumes that Socket::Initialize has been called, so I don't see why 
this couldn't be an implicit prerequisite of these functions (or you can even 
document it explicitly if you want). Though I generally also prefer free 
functions, I'm fairly ambivalent in this case, so I'll leave it up to you 
whether you want to leave this as a separate class, or convert it into a bunch 
of free functions. (If you do leave it as-is, I think you should at least 
remove the `setUp/tearDown overrides in the derived classes as they're pretty 
useless now - you're just overriding the methods with identical 
implementations.).

> Another question I have (and this is more a n00b question as I don't have 
> prior c++ experience), the CreateConnectedSockets functions that exist use 
> unique pointers, and after reading the documentation about this I decided to 
> use .release() so I could safely pass them to the ConnectionFileDescriptor in 
> the test I created for it. Should I have changed the unique pointers to 
> shared pointers instead?

Using `release` is the correct thing to do here as ConnectionFileDescriptor 
takes ownership of the passed-in object. What would be a nice improvement here 
would be to change the interface of ConnectionFileDescriptor constructor so 
that it takes a `unique_ptr` instead of a raw pointer. That way, you would just 
say `ConnectionFileDescriptor(std::move(whatever_up))`. That way the ownership 
part would be explicitly documented (now, I've had to look at the source to 
check the ownership semantics).  If you want to do that please make a separate 
patch for that.




Comment at: lldb/unittests/Host/ConnectionFileDescriptorTest.cpp:40
+EXPECT_TRUE(UriParser::Parse(connection_file_descriptor.GetURI(), scheme, 
hostname, port, path));
+EXPECT_STREQ(ip.c_str(), hostname.str().c_str());
+EXPECT_EQ(socket->GetRemotePortNumber(), port);

You can just do `EXPECT_EQ(ip, hostname)`



Comment at: lldb/unittests/Host/SocketBasedTest.cpp:63-68
+  // Return false if the host doesn't support this interface.
+  auto addresses = lldb_private::SocketAddress::GetAddressInfo(
+  listen_remote_ip.c_str(), NULL, AF_UNSPEC, SOCK_STREAM, IPPROTO_TCP);
+  if (addresses.size() == 0) {
+return false;
+  }

The fact that you felt the need to place `// this does foo` comments everywhere 
is a signal that this behavior is unintuitive. I think it would be better to 
split this part into a separate function, and name it something like 
`IsAddressFamilySupported`. Then each test can do something like:
```
if (!IsAddressFamilySupported(...)) {
  GTEST_LOG_(WARNING) << "Skipping test due to missing ??? support.";
  return;
}


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61833



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


[Lldb-commits] [lldb] r360564 - @skipIfLinux flaky lldb-mi tests

2019-05-13 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 13 01:48:03 2019
New Revision: 360564

URL: http://llvm.org/viewvc/llvm-project?rev=360564&view=rev
Log:
@skipIfLinux flaky lldb-mi tests

Modified:
lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py

Modified: lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test?rev=360564&r1=360563&r2=360564&view=diff
==
--- lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test (original)
+++ lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test Mon May 13 
01:48:03 2019
@@ -1,4 +1,5 @@
 # XFAIL: system-netbsd
+# UNSUPPORTED: system-linux
 #
 # RUN: %build %p/inputs/break-insert.c --nodefaultlib -o a.exe
 # RUN: %lldbmi < %s | FileCheck %s

Modified: lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test?rev=360564&r1=360563&r2=360564&view=diff
==
--- lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test (original)
+++ lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test Mon May 13 01:48:03 2019
@@ -1,4 +1,5 @@
 # XFAIL: system-netbsd
+# UNSUPPORTED: system-linux
 #
 # RUN: %build %p/inputs/main.c --nodefaultlib -o %t
 # RUN: %lldbmi %t < %s | FileCheck %s

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?rev=360564&r1=360563&r2=360564&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
 Mon May 13 01:48:03 2019
@@ -83,9 +83,9 @@ class MiInterpreterExecTestCase(lldbmi_t
 
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
-@expectedFlakeyLinux(bugnumber="llvm.org/pr25470")
 @skipIfRemote   # We do not currently support remote debugging via the MI.
 @skipIfDarwin
+@skipIfLinux
 def test_lldbmi_settings_set_target_run_args_before(self):
 """Test that 'lldb-mi --interpreter' can set target arguments by 
'setting set target.run-args' command before than target was created."""
 

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=360564&r1=360563&r2=360564&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
 Mon May 13 01:48:03 2019
@@ -19,6 +19,7 @@ class MiStartupOptionsTestCase(lldbmi_te
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfDarwin
+@skipIfLinux
 def test_lldbmi_executable_option_file(self):
 """Test that 'lldb-mi --interpreter %s' loads executable file."""
 
@@ -67,6 +68,7 @@ class MiStartupOptionsTestCase(lldbmi_te
 @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
 @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known thread 
races
 @skipIfDarwin
+@skipIfLinux
 def test_lldbmi_executable_option_absolute_path(self):
 """Test that 'lldb-mi --interpreter %s' loads executable which is 
specified via absolute path."""
 


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


[Lldb-commits] [lldb] r360565 - [DWARF] Use sequential integers for the IDs of the SymbolFileDWOs

2019-05-13 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 13 01:58:34 2019
New Revision: 360565

URL: http://llvm.org/viewvc/llvm-project?rev=360565&view=rev
Log:
[DWARF] Use sequential integers for the IDs of the SymbolFileDWOs

Summary:
Instead of using the offset of the contained compile unit, we use it's
ID. The goal of this change is two-fold:
- free up space in the user_id_t representation to enable storing the
  debug-info-carrying section (debug_types/debug_info) without
  decreasing the amount of debug info we can address (as would be the
  case with D61503).
- be a step towards supporting DWO files containing more than one unit
  (important for debug_types+dwo, but can also happen with regular
  dwo+lto). For this part to fully work we'd still need to add a way to
  lookup the SymbolFileDWO without going through GetCompileUnitAtIndex,
  but making sure things don't accidentally work because the SymbolFile
  ID is the same as compile unit offset is a step towards that.

Reviewers: JDevlieghere, clayborg, aprantl

Subscribers: mehdi_amini, dexonsmith, tberghammer, jankratochvil, lldb-commits

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

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp?rev=360565&r1=360564&r2=360565&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp Mon May 13 
01:58:34 2019
@@ -1259,7 +1259,20 @@ SymbolFileDWARF::DecodedUID SymbolFileDW
 debug_map->GetOSOIndexFromUserID(uid));
 return {dwarf, {DW_INVALID_OFFSET, dw_offset_t(uid)}};
   }
-  return {this, {dw_offset_t(uid >> 32), dw_offset_t(uid)}};
+  uint32_t dwarf_id = uid >> 32;
+  dw_offset_t die_offset = uid;
+
+  if (die_offset == DW_INVALID_OFFSET)
+return {nullptr, DIERef()};
+
+  SymbolFileDWARF *dwarf = this;
+  if (DebugInfo()) {
+if (DWARFUnit *unit = DebugInfo()->GetUnitAtIndex(dwarf_id)) {
+  if (unit->GetDwoSymbolFile())
+dwarf = unit->GetDwoSymbolFile();
+}
+  }
+  return {dwarf, {DW_INVALID_OFFSET, die_offset}};
 }
 
 DWARFDIE

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp?rev=360565&r1=360564&r2=360565&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp Mon May 
13 01:58:34 2019
@@ -23,7 +23,7 @@ SymbolFileDWARFDwo::SymbolFileDWARFDwo(O
DWARFUnit *dwarf_cu)
 : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
   m_base_dwarf_cu(dwarf_cu) {
-  SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
+  SetID(((lldb::user_id_t)dwarf_cu->GetID()) << 32);
 }
 
 void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
@@ -158,6 +158,7 @@ SymbolFileDWARFDwo::GetTypeSystemForLang
 
 DWARFDIE
 SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
-  lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
+  lldbassert(die_ref.cu_offset == m_base_dwarf_cu->GetOffset() ||
+ die_ref.cu_offset == DW_INVALID_OFFSET);
   return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
 }


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


[Lldb-commits] [PATCH] D61783: [DWARF] Use sequential integers for the IDs of the SymbolFileDWOs

2019-05-13 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360565: [DWARF] Use sequential integers for the IDs of 
the SymbolFileDWOs (authored by labath, committed by ).
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61783?vs=199007&id=199222#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61783

Files:
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1259,7 +1259,20 @@
 debug_map->GetOSOIndexFromUserID(uid));
 return {dwarf, {DW_INVALID_OFFSET, dw_offset_t(uid)}};
   }
-  return {this, {dw_offset_t(uid >> 32), dw_offset_t(uid)}};
+  uint32_t dwarf_id = uid >> 32;
+  dw_offset_t die_offset = uid;
+
+  if (die_offset == DW_INVALID_OFFSET)
+return {nullptr, DIERef()};
+
+  SymbolFileDWARF *dwarf = this;
+  if (DebugInfo()) {
+if (DWARFUnit *unit = DebugInfo()->GetUnitAtIndex(dwarf_id)) {
+  if (unit->GetDwoSymbolFile())
+dwarf = unit->GetDwoSymbolFile();
+}
+  }
+  return {dwarf, {DW_INVALID_OFFSET, die_offset}};
 }
 
 DWARFDIE
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -23,7 +23,7 @@
DWARFUnit *dwarf_cu)
 : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
   m_base_dwarf_cu(dwarf_cu) {
-  SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
+  SetID(((lldb::user_id_t)dwarf_cu->GetID()) << 32);
 }
 
 void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
@@ -158,6 +158,7 @@
 
 DWARFDIE
 SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
-  lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
+  lldbassert(die_ref.cu_offset == m_base_dwarf_cu->GetOffset() ||
+ die_ref.cu_offset == DW_INVALID_OFFSET);
   return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
 }


Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -1259,7 +1259,20 @@
 debug_map->GetOSOIndexFromUserID(uid));
 return {dwarf, {DW_INVALID_OFFSET, dw_offset_t(uid)}};
   }
-  return {this, {dw_offset_t(uid >> 32), dw_offset_t(uid)}};
+  uint32_t dwarf_id = uid >> 32;
+  dw_offset_t die_offset = uid;
+
+  if (die_offset == DW_INVALID_OFFSET)
+return {nullptr, DIERef()};
+
+  SymbolFileDWARF *dwarf = this;
+  if (DebugInfo()) {
+if (DWARFUnit *unit = DebugInfo()->GetUnitAtIndex(dwarf_id)) {
+  if (unit->GetDwoSymbolFile())
+dwarf = unit->GetDwoSymbolFile();
+}
+  }
+  return {dwarf, {DW_INVALID_OFFSET, die_offset}};
 }
 
 DWARFDIE
Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -23,7 +23,7 @@
DWARFUnit *dwarf_cu)
 : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
   m_base_dwarf_cu(dwarf_cu) {
-  SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
+  SetID(((lldb::user_id_t)dwarf_cu->GetID()) << 32);
 }
 
 void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
@@ -158,6 +158,7 @@
 
 DWARFDIE
 SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
-  lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
+  lldbassert(die_ref.cu_offset == m_base_dwarf_cu->GetOffset() ||
+ die_ref.cu_offset == DW_INVALID_OFFSET);
   return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r360564 - @skipIfLinux flaky lldb-mi tests

2019-05-13 Thread Raphael Isemann via lldb-commits
These tests are now SkipIf Windows, FreeBSD, Darwin AND Linux :( So
unless someone sets up a Minix or GNU Hurd bot these tests are never
run.

CC'ing Alexander who was IIRC able to fix these tests in the past, so
maybe he has an idea what's going on.

- Raphael

Am Mo., 13. Mai 2019 um 10:45 Uhr schrieb Pavel Labath via
lldb-commits :
>
> Author: labath
> Date: Mon May 13 01:48:03 2019
> New Revision: 360564
>
> URL: http://llvm.org/viewvc/llvm-project?rev=360564&view=rev
> Log:
> @skipIfLinux flaky lldb-mi tests
>
> Modified:
> lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
> lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test
> 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
> 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
>
> Modified: lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test?rev=360564&r1=360563&r2=360564&view=diff
> ==
> --- lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test (original)
> +++ lldb/trunk/lit/tools/lldb-mi/breakpoint/break-insert.test Mon May 13 
> 01:48:03 2019
> @@ -1,4 +1,5 @@
>  # XFAIL: system-netbsd
> +# UNSUPPORTED: system-linux
>  #
>  # RUN: %build %p/inputs/break-insert.c --nodefaultlib -o a.exe
>  # RUN: %lldbmi < %s | FileCheck %s
>
> Modified: lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test?rev=360564&r1=360563&r2=360564&view=diff
> ==
> --- lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test (original)
> +++ lldb/trunk/lit/tools/lldb-mi/exec/exec-next.test Mon May 13 01:48:03 2019
> @@ -1,4 +1,5 @@
>  # XFAIL: system-netbsd
> +# UNSUPPORTED: system-linux
>  #
>  # RUN: %build %p/inputs/main.c --nodefaultlib -o %t
>  # RUN: %lldbmi %t < %s | FileCheck %s
>
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py?rev=360564&r1=360563&r2=360564&view=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/interpreter/TestMiInterpreterExec.py
>  Mon May 13 01:48:03 2019
> @@ -83,9 +83,9 @@ class MiInterpreterExecTestCase(lldbmi_t
>
>  @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
>  @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known 
> thread races
> -@expectedFlakeyLinux(bugnumber="llvm.org/pr25470")
>  @skipIfRemote   # We do not currently support remote debugging via the 
> MI.
>  @skipIfDarwin
> +@skipIfLinux
>  def test_lldbmi_settings_set_target_run_args_before(self):
>  """Test that 'lldb-mi --interpreter' can set target arguments by 
> 'setting set target.run-args' command before than target was created."""
>
>
> Modified: 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py?rev=360564&r1=360563&r2=360564&view=diff
> ==
> --- 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
>  (original)
> +++ 
> lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-mi/startup_options/TestMiStartupOptions.py
>  Mon May 13 01:48:03 2019
> @@ -19,6 +19,7 @@ class MiStartupOptionsTestCase(lldbmi_te
>  @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
>  @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known 
> thread races
>  @skipIfDarwin
> +@skipIfLinux
>  def test_lldbmi_executable_option_file(self):
>  """Test that 'lldb-mi --interpreter %s' loads executable file."""
>
> @@ -67,6 +68,7 @@ class MiStartupOptionsTestCase(lldbmi_te
>  @skipIfWindows  # llvm.org/pr24452: Get lldb-mi tests working on Windows
>  @skipIfFreeBSD  # llvm.org/pr22411: Failure presumably due to known 
> thread races
>  @skipIfDarwin
> +@skipIfLinux
>  def test_lldbmi_executable_option_absolute_path(self):
>  """Test that 'lldb-mi --interpreter %s' loads executable which is 
> specified via absolute path."""
>
>
>
> ___
> lldb-commits mailing list
> lldb-commits@lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailma

[Lldb-commits] [PATCH] D61128: Support member function types in PdbAstBuilder

2019-05-13 Thread Mikhail Senkov via Phabricator via lldb-commits
zloyrobot added a comment.

In D61128#1483663 , @zloyrobot wrote:

> In D61128#1482765 , @amccarth wrote:
>
> > Thanks for the improved commit message.  Again, sorry about the delay.
>
>
> No problem, thanks for review!


I afraid I don't have commit access to merge this path. Could somebody help me?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61128



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


[Lldb-commits] [PATCH] D60963: Fix dereferencing null pointer

2019-05-13 Thread Mikhail Senkov via Phabricator via lldb-commits
zloyrobot added a comment.

kind reminder


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60963



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


[Lldb-commits] [PATCH] D60962: [NativePDB] Extend .pdb files search folders

2019-05-13 Thread Mikhail Senkov via Phabricator via lldb-commits
zloyrobot added a comment.

In D60962#1477160 , @amccarth wrote:

> Thanks Pavel!
>
> Please address Pavel's inline comments, and I'll accept this.


Kind reminder


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60962



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


Re: [Lldb-commits] [lldb] r360564 - @skipIfLinux flaky lldb-mi tests

2019-05-13 Thread Pavel Labath via lldb-commits

On 13/05/2019 11:00, Raphael Isemann wrote:

These tests are now SkipIf Windows, FreeBSD, Darwin AND Linux :( So
unless someone sets up a Minix or GNU Hurd bot these tests are never
run.


Yeah, the state of lldb-mi is... sad :/



CC'ing Alexander who was IIRC able to fix these tests in the past, so
maybe he has an idea what's going on.



The most recent failures are here:
http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1354/steps/test/logs/stdio
http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1343/steps/test/logs/stdio
http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1324/steps/test/logs/stdio

pl


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


[Lldb-commits] [PATCH] D61611: [JITLoaderGDB] Set eTypeJIT for objects read from JIT descriptors

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

It looks like this test is flaky:
http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1339/steps/test/logs/stdio
http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1294/steps/test/logs/stdio

The failure messages I've seen are all the same and seem to indicate that the 
"breakpoint locations added" and "process stopped" messages come out of order. 
This seems plausible since the two messages are reported through different 
channels, and I was able to reproduce this failure locally by adding a sleep(1) 
to Debugger::HandleBreakpointEvent.

Given that the behavior of asynchronous breakpoint location messages is not the 
puprose of this test, what would you say to just deleting the "# CHECK: 1 
location added to breakpoint 1" line from the test?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61611



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


[Lldb-commits] [lldb] r360568 - minidump: Use yaml instead of checked-in binaries for ThreadList tests

2019-05-13 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 13 02:35:00 2019
New Revision: 360568

URL: http://llvm.org/viewvc/llvm-project?rev=360568&view=rev
Log:
minidump: Use yaml instead of checked-in binaries for ThreadList tests

yaml2obj now supports the ThreadList stream.

Removed:
lldb/trunk/unittests/Process/minidump/Inputs/linux-i386.dmp
lldb/trunk/unittests/Process/minidump/Inputs/thread-list-not-padded.dmp
lldb/trunk/unittests/Process/minidump/Inputs/thread-list-padded.dmp
Modified:
lldb/trunk/unittests/Process/minidump/CMakeLists.txt
lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp

Modified: lldb/trunk/unittests/Process/minidump/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/CMakeLists.txt?rev=360568&r1=360567&r2=360568&view=diff
==
--- lldb/trunk/unittests/Process/minidump/CMakeLists.txt (original)
+++ lldb/trunk/unittests/Process/minidump/CMakeLists.txt Mon May 13 02:35:00 
2019
@@ -18,7 +18,6 @@ add_lldb_unittest(LLDBMinidumpTests
 set(test_inputs
fizzbuzz_no_heap.dmp
fizzbuzz_wow64.dmp
-   linux-i386.dmp
linux-x86_64.dmp
linux-x86_64_not_crashed.dmp
memory-list-not-padded.dmp
@@ -26,8 +25,6 @@ set(test_inputs
regions-linux-map.dmp
regions-memlist.dmp
regions-memlist64.dmp
-   thread-list-not-padded.dmp
-   thread-list-padded.dmp
)
 
 add_unittest_inputs(LLDBMinidumpTests "${test_inputs}")

Removed: lldb/trunk/unittests/Process/minidump/Inputs/linux-i386.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/linux-i386.dmp?rev=360567&view=auto
==
Binary files lldb/trunk/unittests/Process/minidump/Inputs/linux-i386.dmp 
(original) and lldb/trunk/unittests/Process/minidump/Inputs/linux-i386.dmp 
(removed) differ

Removed: lldb/trunk/unittests/Process/minidump/Inputs/thread-list-not-padded.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/thread-list-not-padded.dmp?rev=360567&view=auto
==
Binary file - no diff available.

Removed: lldb/trunk/unittests/Process/minidump/Inputs/thread-list-padded.dmp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/Inputs/thread-list-padded.dmp?rev=360567&view=auto
==
Binary file - no diff available.

Modified: lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp?rev=360568&r1=360567&r2=360568&view=diff
==
--- lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp (original)
+++ lldb/trunk/unittests/Process/minidump/MinidumpParserTest.cpp Mon May 13 
02:35:00 2019
@@ -90,7 +90,19 @@ Streams:
 }
 
 TEST_F(MinidumpParserTest, GetThreadsAndGetThreadContext) {
-  SetUpData("linux-x86_64.dmp");
+  ASSERT_THAT_ERROR(SetUpFromYaml(R"(
+--- !minidump
+Streams: 
+  - Type:ThreadList
+Threads: 
+  - Thread Id:   0x3E81
+Stack:   
+  Start of Memory Range: 0x7FFCEB34A000
+  Content: C84D04BCE97F00
+Context: 00
+...
+)"),
+llvm::Succeeded());
   llvm::ArrayRef thread_list;
 
   thread_list = parser->GetThreads();
@@ -98,32 +110,10 @@ TEST_F(MinidumpParserTest, GetThreadsAnd
 
   const minidump::Thread &thread = thread_list[0];
 
-  EXPECT_EQ(16001UL, thread.ThreadId);
+  EXPECT_EQ(0x3e81u, thread.ThreadId);
 
   llvm::ArrayRef context = parser->GetThreadContext(thread);
-  EXPECT_EQ(1232UL, context.size());
-}
-
-TEST_F(MinidumpParserTest, GetThreadListNotPadded) {
-  // Verify that we can load a thread list that doesn't have 4 bytes of padding
-  // after the thread count.
-  SetUpData("thread-list-not-padded.dmp");
-  llvm::ArrayRef thread_list;
-
-  thread_list = parser->GetThreads();
-  ASSERT_EQ(2UL, thread_list.size());
-  EXPECT_EQ(0x11223344UL, thread_list[0].ThreadId);
-  EXPECT_EQ(0x55667788UL, thread_list[1].ThreadId);
-}
-
-TEST_F(MinidumpParserTest, GetThreadListPadded) {
-  // Verify that we can load a thread list that has 4 bytes of padding
-  // after the thread count as found in breakpad minidump files.
-  SetUpData("thread-list-padded.dmp");
-  auto thread_list = parser->GetThreads();
-  ASSERT_EQ(2UL, thread_list.size());
-  EXPECT_EQ(0x11223344UL, thread_list[0].ThreadId);
-  EXPECT_EQ(0x55667788UL, thread_list[1].ThreadId);
+  EXPECT_EQ(7u, context.size());
 }
 
 TEST_F(MinidumpParserTest, GetMemoryListNotPadded) {
@@ -459,7 +449,19 @@ TEST_F(MinidumpParserTest, GetPidWow64)
 #define REG_VAL64(x) *(reinterpret_cast(x))
 
 TEST_F(MinidumpPars

[Lldb-commits] [lldb] r360569 - [NativePDB] Support member function types in PdbAstBuilder

2019-05-13 Thread Aleksandr Urakov via lldb-commits
Author: aleksandr.urakov
Date: Mon May 13 02:41:57 2019
New Revision: 360569

URL: http://llvm.org/viewvc/llvm-project?rev=360569&view=rev
Log:
[NativePDB] Support member function types in PdbAstBuilder

Summary:
This patch implements missing case in PdbAstBuilder::CreateType for
LF_MFUNCTION. This is necessary, for example, in stack unwinding of struct
methods.

Reviewers: amccarth, aleksandr.urakov

Reviewed By: amccarth

Subscribers: abidh, teemperor, lldb-commits, leonid.mashinskiy

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

Added:
lldb/trunk/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit
lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp
Modified:
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.h

Added: lldb/trunk/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit?rev=360569&view=auto
==
--- lldb/trunk/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit 
(added)
+++ lldb/trunk/lit/SymbolFile/NativePDB/Inputs/stack_unwinding01.lldbinit Mon 
May 13 02:41:57 2019
@@ -0,0 +1,8 @@
+b stack_unwinding01.cpp:12
+run
+thread backtrace
+c
+thread backtrace
+c
+thread backtrace
+quit
\ No newline at end of file

Added: lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp?rev=360569&view=auto
==
--- lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp (added)
+++ lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp Mon May 13 
02:41:57 2019
@@ -0,0 +1,48 @@
+// clang-format off
+// REQUIRES: lld
+
+// RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s
+// RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
+// RUN: %p/Inputs/stack_unwinding01.lldbinit 2>&1 | FileCheck %s
+
+
+struct Struct {
+  void simple_method(int a, int b) {
+ a += 1;
+ simple_method(a, b);
+  }
+};
+
+
+
+int main(int argc, char **argv) {
+  Struct s;
+  s.simple_method(1,2);
+  return 0;
+}
+
+
+// CHECK: (lldb) thread backtrace
+// CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
+// CHECK-NEXT:   * frame #0: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
+// CHECK-NEXT: frame #1: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
+// CHECK-NEXT: frame #2: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
+// CHECK-NEXT: frame #3: {{.*}} ntdll.dll`RtlUserThreadStart + 52
+
+
+// CHECK: (lldb) thread backtrace
+// CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
+// CHECK-NEXT:   * frame #0: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
+// CHECK-NEXT: frame #1: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
+// CHECK-NEXT: frame #2: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
+// CHECK-NEXT: frame #3: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
+// CHECK-NEXT: frame #4: {{.*}} ntdll.dll`RtlUserThreadStart + 52
+
+// CHECK: (lldb) thread backtrace
+// CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
+// CHECK-NEXT:   * frame #0: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
+// CHECK-NEXT: frame #1: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
+// CHECK-NEXT: frame #2: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
+// CHECK-NEXT: frame #3: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
+// CHECK-NEXT: frame #4: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
+// CHECK-NEXT: frame #5: {{.*}} ntdll.dll`RtlUserThreadStart + 52
\ No newline at end of file

Modified: lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp?rev=360569&r1=360568&r2=360569&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp 
(original)
+++ lldb/trunk/source/Plugins/SymbolFile/NativePDB/SymbolFileNativePDB.cpp Mon 
May 13 02:41:57 2019
@@ -595,6 +595,17 @@ TypeSP SymbolFileNativePDB::CreateArrayT
   return array_sp;
 }
 
+
+TypeSP SymbolFileNativePDB::CreateFunctionType(PdbTypeSymId type_id,
+   const MemberFunctionRecord &mfr,
+ 

[Lldb-commits] [lldb] r360571 - Fix flakiness in lldb lit test

2019-05-13 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Mon May 13 02:48:26 2019
New Revision: 360571

URL: http://llvm.org/viewvc/llvm-project?rev=360571&view=rev
Log:
Fix flakiness in lldb lit test

Messages "breakpoint locations added" and "process stopped" may come out of 
order.

Differential Revision: https://reviews.llvm.org/D61611#anchor-1499662

Modified:
lldb/trunk/lit/Breakpoint/jitbp_elf.test

Modified: lldb/trunk/lit/Breakpoint/jitbp_elf.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Breakpoint/jitbp_elf.test?rev=360571&r1=360570&r2=360571&view=diff
==
--- lldb/trunk/lit/Breakpoint/jitbp_elf.test (original)
+++ lldb/trunk/lit/Breakpoint/jitbp_elf.test Mon May 13 02:48:26 2019
@@ -6,7 +6,6 @@
 
 # CHECK: Breakpoint 1: no locations (pending).
 # CHECK: (lldb) run -jit-kind=mcjit {{.*}}/jitbp_elf.test.tmp.ll
-# CHECK: 1 location added to breakpoint 1
 # CHECK: Process {{.*}} stopped
 # CHECK: JIT(0x{{.*}})`jitbp:
 # CHECK: Process {{.*}} launched: {{.*}}


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


[Lldb-commits] [PATCH] D61611: [JITLoaderGDB] Set eTypeJIT for objects read from JIT descriptors

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

> It looks like this test is flaky [...] what would you say to just deleting 
> the "# CHECK: 1 location added to breakpoint 1" line from the test?

Thanks for reporting and explaining. Sounds like a reasonable change. Pushed 
with rL360571 .


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61611



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


[Lldb-commits] [PATCH] D61611: [JITLoaderGDB] Set eTypeJIT for objects read from JIT descriptors

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

Thanks.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61611



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


[Lldb-commits] [lldb] r360574 - Breakpad: Generate unwind plans from STACK CFI records

2019-05-13 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 13 04:25:35 2019
New Revision: 360574

URL: http://llvm.org/viewvc/llvm-project?rev=360574&view=rev
Log:
Breakpad: Generate unwind plans from STACK CFI records

Summary:
This patch implements the GetUnwindPlan interface (added in the previous
patch) for SymbolFileBreakpad, and uses it to generate unwind plans from
STACK CFI records in breakpad files.

We first perform a light-weight parse of the breakpad in order to build
up a map of regions covered by the unwind info so that we can later jump
to the right record when we need to unwind a specific function.

The actual parsing is relatively straight-forward, as the STACK CFI records
are just another (text) form of the eh_frame unwind instructions, and
the same goes for lldb's UnwindPlans. The newly-introduced
PostfixExpression API is used to convert the breakpad postfix
expressions into DWARF. The generated dwarf expressions are stored in a
BumpPtrAllocator, as the UnwindPlan does not take ownership of the
expression data it references (usually this is static data in an object
file, so special ownership is needed).

At this moment the generated unwind plans aren't used in the actual
unwind machinery (only in the image show-unwind command), but that is
coming in a separate patch.

Reviewers: amccarth, clayborg, markmentovai

Subscribers: aprantl, jasonmolenda, lldb-commits

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

Added:
lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms
lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml
lldb/trunk/lit/SymbolFile/Breakpad/stack-cfi-parsing.test
Modified:
lldb/trunk/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
lldb/trunk/source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h

Added: lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms?rev=360574&view=auto
==
--- lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms (added)
+++ lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms Mon May 13 
04:25:35 2019
@@ -0,0 +1,20 @@
+MODULE Linux x86_64 E5894855C35D0 linux.out
+INFO CODE_ID E35C283BC327C28762DB788BF5A4078BE2351448
+FUNC 0 2 0 func0
+FUNC 2 1 0 func2
+FUNC 3 1 0 func3
+FUNC 4 1 0 func4
+FUNC 5 1 0 func5
+FUNC 6 1 0 func6
+FUNC 7 2 0 func7
+FUNC 9 1 0 func9
+STACK CFI INIT 0 2 .cfa: $rsp .ra: .cfa $rbp: $rsp
+STACK CFI 1 $rbp: $rax $rbx: $rcx
+STACK CFI INIT 2 1 $r47: $r42
+STACK CFI INIT 3 1 $rbp:
+STACK CFI INIT 4 1 $rbp
+STACK CFI INIT 5 1 $rbp: $rbx $rsp:
+STACK CFI INIT 6 1 $rbp: $rsp:
+STACK CFI INIT 7 1 .cfa: $rsp
+STACK CFI bogus
+STACK CFI INIT 9 1 .cfa: $rbp .ra: $rax

Added: lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml?rev=360574&view=auto
==
--- lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml (added)
+++ lldb/trunk/lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml Mon May 13 
04:25:35 2019
@@ -0,0 +1,36 @@
+--- !minidump
+Streams: 
+  - Type:ThreadList
+Threads: 
+  - Thread Id:   0x3E81
+Context: DEAD
+Stack:   
+  Start of Memory Range: 0x7FFCEB34A000
+  Content: DEAD
+  - Type:ModuleList
+Modules: 
+  - Base of Image:   0x0040
+Size of Image:   0x1000
+Module Name: '/tmp/stack-cfi-parsing.out'
+CodeView Record: 4C457042E35C283BC327C28762DB788BF5A4078BE2351448
+  - Type:SystemInfo
+Processor Arch:  AMD64
+Processor Level: 6
+Processor Revision: 15876
+Number of Processors: 40
+Platform ID: Linux
+CSD Version: 'Linux 3.13.0-91-generic'
+CPU: 
+  Vendor ID:   GenuineIntel
+  Version Info:0x
+  Feature Info:0x
+  - Type:LinuxProcStatus
+Text: |
+  Name:linux-x86_64
+  State:   t (tracing stop)
+  Tgid:29917
+  Ngid:0
+  Pid: 29917
+  PPid:29370
+
+...

Added: lldb/trunk/lit/SymbolFile/Breakpad/stack-cfi-parsing.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/Breakpad/stack-cfi-parsing.test?rev=360574&view=auto
==
--- lldb/trunk/lit/SymbolFile/Breakpad/stack-cfi-parsing.test (added)
+++ lldb/trunk/lit/SymbolFile/Breakpad/stack-cfi-parsing.test Mon May 13 
04:25:35 2019
@@ -0,0 +1,48 @@
+# RUN: yaml2obj %S/Inputs/stack-cfi-parsing.yaml > %t
+# RUN: %lldb -c %t -o "target symbols add %S/Inputs/stack-cfi-parsing.syms" 

[Lldb-commits] [PATCH] D61733: Breakpad: Generate unwind plans from STACK CFI records

2019-05-13 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360574: Breakpad: Generate unwind plans from STACK CFI 
records (authored by labath, committed by ).
Herald added a subscriber: abidh.
Herald added a project: LLDB.

Changed prior to commit:
  https://reviews.llvm.org/D61733?vs=198993&id=199246#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61733

Files:
  lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.syms
  lit/SymbolFile/Breakpad/Inputs/stack-cfi-parsing.yaml
  lit/SymbolFile/Breakpad/stack-cfi-parsing.test
  source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
  source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.h

Index: source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
===
--- source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
+++ source/Plugins/SymbolFile/Breakpad/SymbolFileBreakpad.cpp
@@ -15,9 +15,11 @@
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Symbol/CompileUnit.h"
 #include "lldb/Symbol/ObjectFile.h"
+#include "lldb/Symbol/PostfixExpression.h"
 #include "lldb/Symbol/SymbolVendor.h"
 #include "lldb/Symbol/TypeMap.h"
 #include "lldb/Utility/Log.h"
+#include "lldb/Utility/StreamString.h"
 #include "llvm/ADT/StringExtras.h"
 
 using namespace lldb;
@@ -370,6 +372,155 @@
   symtab.CalculateSymbolSizes();
 }
 
+static llvm::Optional>
+GetRule(llvm::StringRef &unwind_rules) {
+  // Unwind rules are of the form
+  //   register1: expression1 register2: expression2 ...
+  // We assume none of the tokens in expression end with a colon.
+
+  llvm::StringRef lhs, rest;
+  std::tie(lhs, rest) = getToken(unwind_rules);
+  if (!lhs.consume_back(":"))
+return llvm::None;
+
+  // Seek forward to the next register: expression pair
+  llvm::StringRef::size_type pos = rest.find(": ");
+  if (pos == llvm::StringRef::npos) {
+// No pair found, this means the rest of the string is a single expression.
+unwind_rules = llvm::StringRef();
+return std::make_pair(lhs, rest);
+  }
+
+  // Go back one token to find the end of the current rule.
+  pos = rest.rfind(' ', pos);
+  if (pos == llvm::StringRef::npos)
+return llvm::None;
+
+  llvm::StringRef rhs = rest.take_front(pos);
+  unwind_rules = rest.drop_front(pos);
+  return std::make_pair(lhs, rhs);
+}
+
+static const RegisterInfo *
+ResolveRegister(const SymbolFile::RegisterInfoResolver &resolver,
+llvm::StringRef name) {
+  if (name.consume_front("$"))
+return resolver.ResolveName(name);
+
+  return nullptr;
+}
+
+static const RegisterInfo *
+ResolveRegisterOrRA(const SymbolFile::RegisterInfoResolver &resolver,
+llvm::StringRef name) {
+  if (name == ".ra")
+return resolver.ResolveNumber(eRegisterKindGeneric, LLDB_REGNUM_GENERIC_PC);
+  return ResolveRegister(resolver, name);
+}
+
+bool SymbolFileBreakpad::ParseUnwindRow(llvm::StringRef unwind_rules,
+const RegisterInfoResolver &resolver,
+UnwindPlan::Row &row) {
+  Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_SYMBOLS);
+
+  llvm::BumpPtrAllocator node_alloc;
+  while (auto rule = GetRule(unwind_rules)) {
+node_alloc.Reset();
+llvm::StringRef lhs = rule->first;
+postfix::Node *rhs = postfix::Parse(rule->second, node_alloc);
+if (!rhs) {
+  LLDB_LOG(log, "Could not parse `{0}` as unwind rhs.", rule->second);
+  return false;
+}
+
+bool success = postfix::ResolveSymbols(
+rhs, [&](postfix::SymbolNode &symbol) -> postfix::Node * {
+  llvm::StringRef name = symbol.GetName();
+  if (name == ".cfa" && lhs != ".cfa")
+return postfix::MakeNode(node_alloc);
+
+  if (const RegisterInfo *info = ResolveRegister(resolver, name)) {
+return postfix::MakeNode(
+node_alloc, info->kinds[eRegisterKindLLDB]);
+  }
+  return nullptr;
+});
+
+if (!success) {
+  LLDB_LOG(log, "Resolving symbols in `{0}` failed.", rule->second);
+  return false;
+}
+
+ArchSpec arch = m_obj_file->GetArchitecture();
+StreamString dwarf(Stream::eBinary, arch.GetAddressByteSize(),
+   arch.GetByteOrder());
+ToDWARF(*rhs, dwarf);
+uint8_t *saved = m_allocator.Allocate(dwarf.GetSize());
+std::memcpy(saved, dwarf.GetData(), dwarf.GetSize());
+
+if (lhs == ".cfa") {
+  row.GetCFAValue().SetIsDWARFExpression(saved, dwarf.GetSize());
+} else if (const RegisterInfo *info = ResolveRegisterOrRA(resolver, lhs)) {
+  UnwindPlan::Row::RegisterLocation loc;
+  loc.SetIsDWARFExpression(saved, dwarf.GetSize());
+  row.SetRegisterInfo(info->kinds[eRegisterKindLLDB], loc);
+} else
+  LLDB_LOG(log, "Invalid register `{0}` in unwind rule.", lhs);
+  }
+  if (unwind_rules.empty())
+return true;
+
+  LLDB_LOG(

[Lldb-commits] [lldb] r360576 - Add REQUIRES: windows to NativePDB/stack_unwinding01.cpp

2019-05-13 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 13 04:32:52 2019
New Revision: 360576

URL: http://llvm.org/viewvc/llvm-project?rev=360576&view=rev
Log:
Add REQUIRES: windows to NativePDB/stack_unwinding01.cpp

The test runs the compiled executable. As such, it can only work on
windows hosts.

Modified:
lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp

Modified: lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp?rev=360576&r1=360575&r2=360576&view=diff
==
--- lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp (original)
+++ lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp Mon May 13 
04:32:52 2019
@@ -1,5 +1,5 @@
 // clang-format off
-// REQUIRES: lld
+// REQUIRES: lld, system-windows
 
 // RUN: %build --compiler=clang-cl --nodefaultlib -o %t.exe -- %s
 // RUN: env LLDB_USE_NATIVE_PDB_READER=1 %lldb -f %t.exe -s \
@@ -45,4 +45,4 @@ int main(int argc, char **argv) {
 // CHECK-NEXT: frame #2: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
 // CHECK-NEXT: frame #3: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
 // CHECK-NEXT: frame #4: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
-// CHECK-NEXT: frame #5: {{.*}} ntdll.dll`RtlUserThreadStart + 52
\ No newline at end of file
+// CHECK-NEXT: frame #5: {{.*}} ntdll.dll`RtlUserThreadStart + 52


___
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-13 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: jasonmolenda, clayborg.

Previous patch (r360409) introduced the "symbol file unwind plan"
concept, but that plan wasn't used for unwinding yet. With this patch,
we start to consider the new plan as a possible strategy for both
synchronous and asynchronous unwinding. I also add a test that asserts
that unwinding via breakpad STACK CFI info works end-to-end.


https://reviews.llvm.org/D61853

Files:
  include/lldb/Symbol/FuncUnwinders.h
  lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.dmp
  lit/SymbolFile/Breakpad/Inputs/unwind-via-stack-cfi.syms
  lit/SymbolFile/Breakpad/stack-cfi-parsing.test
  lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test
  source/Commands/CommandObjectTarget.cpp
  source/Plugins/Process/Utility/RegisterContextLLDB.cpp
  source/Symbol/FuncUnwinders.cpp

Index: source/Symbol/FuncUnwinders.cpp
===
--- source/Symbol/FuncUnwinders.cpp
+++ source/Symbol/FuncUnwinders.cpp
@@ -54,7 +54,8 @@
 
 FuncUnwinders::~FuncUnwinders() {}
 
-UnwindPlanSP FuncUnwinders::GetUnwindPlanAtCallSite(Target &target) {
+UnwindPlanSP FuncUnwinders::GetUnwindPlanAtCallSite(Target &target,
+Thread &thread) {
   std::lock_guard guard(m_mutex);
 
   if (UnwindPlanSP plan_sp = GetEHFrameUnwindPlan(target))
@@ -65,6 +66,8 @@
 return plan_sp;
   if (UnwindPlanSP plan_sp = GetArmUnwindUnwindPlan(target))
 return plan_sp;
+  if (UnwindPlanSP plan_sp = GetSymbolFileUnwindPlan(thread))
+return plan_sp;
 
   return nullptr;
 }
@@ -361,6 +364,8 @@
 return plan_sp;
   if (UnwindPlanSP plan_sp = GetDebugFrameAugmentedUnwindPlan(target, thread))
 return plan_sp;
+  if (UnwindPlanSP plan_sp = GetSymbolFileUnwindPlan(thread))
+return plan_sp;
 
   return assembly_sp;
 }
Index: source/Plugins/Process/Utility/RegisterContextLLDB.cpp
===
--- source/Plugins/Process/Utility/RegisterContextLLDB.cpp
+++ source/Plugins/Process/Utility/RegisterContextLLDB.cpp
@@ -244,8 +244,8 @@
 }
 
 if (func_unwinders_sp.get() != nullptr)
-  call_site_unwind_plan =
-  func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget());
+  call_site_unwind_plan = func_unwinders_sp->GetUnwindPlanAtCallSite(
+  process->GetTarget(), m_thread);
 
 if (call_site_unwind_plan.get() != nullptr) {
   m_fallback_unwind_plan_sp = call_site_unwind_plan;
@@ -873,7 +873,8 @@
 // location what helps in the most common cases when the instruction
 // emulation fails.
 UnwindPlanSP call_site_unwind_plan =
-func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget());
+func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget(),
+   m_thread);
 if (call_site_unwind_plan &&
 call_site_unwind_plan.get() != unwind_plan_sp.get() &&
 call_site_unwind_plan->GetSourceName() !=
@@ -909,8 +910,8 @@
   // Typically this is unwind info from an eh_frame section intended for
   // exception handling; only valid at call sites
   if (process) {
-unwind_plan_sp =
-func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget());
+unwind_plan_sp = func_unwinders_sp->GetUnwindPlanAtCallSite(
+process->GetTarget(), m_thread);
   }
   int valid_offset = -1;
   if (IsUnwindPlanValidForCurrentPC(unwind_plan_sp, valid_offset)) {
@@ -940,7 +941,8 @@
 // code it is often written in a way that it valid at all location what
 // helps in the most common cases when the instruction emulation fails.
 UnwindPlanSP call_site_unwind_plan =
-func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget());
+func_unwinders_sp->GetUnwindPlanAtCallSite(process->GetTarget(),
+   m_thread);
 if (call_site_unwind_plan &&
 call_site_unwind_plan.get() != unwind_plan_sp.get() &&
 call_site_unwind_plan->GetSourceName() !=
Index: source/Commands/CommandObjectTarget.cpp
===
--- source/Commands/CommandObjectTarget.cpp
+++ source/Commands/CommandObjectTarget.cpp
@@ -3521,7 +3521,7 @@
 non_callsite_unwind_plan->GetSourceName().AsCString());
   }
   UnwindPlanSP callsite_unwind_plan =
-  func_unwinders_sp->GetUnwindPlanAtCallSite(*target);
+  func_unwinders_sp->GetUnwindPlanAtCallSite(*target, *thread);
   if (callsite_unwind_plan) {
 result.GetOutputStream().Printf(
 "Synchronous (restricted to call-sites) UnwindPlan is '%s'\n",
Index: lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test
===
--- /dev/null
+++ lit/SymbolFile/Breakpad/unwind-via-stack-cfi.test
@@ -0,0 +1,21 @@
+# RUN: %lldb 

[Lldb-commits] [PATCH] D61128: Support member function types in PdbAstBuilder

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

Looks like this is failing on the windows bot.

Looking at the test, it seems that you are asserting that you will unwind into 
a particular offset in ntdll.dll. That sounds like an incredibly fragile 
assertion, which will only be true for people running the exact same version of 
ntdll that you happen to have...


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61128



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


[Lldb-commits] [lldb] r360583 - DWARF/DIERef: remove non-const operator

2019-05-13 Thread Pavel Labath via lldb-commits
Author: labath
Date: Mon May 13 06:52:40 2019
New Revision: 360583

URL: http://llvm.org/viewvc/llvm-project?rev=360583&view=rev
Log:
DWARF/DIERef: remove non-const operator<

It serves no purpose as one can always invoke the const version instead.

Modified:
lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h

Modified: lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h?rev=360583&r1=360582&r2=360583&view=diff
==
--- lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h (original)
+++ lldb/trunk/source/Plugins/SymbolFile/DWARF/DIERef.h Mon May 13 06:52:40 2019
@@ -26,8 +26,6 @@ struct DIERef {
 return die_offset < ref.die_offset;
   }
 
-  bool operator<(const DIERef &ref) { return die_offset < ref.die_offset; }
-
   explicit operator bool() const {
 return cu_offset != DW_INVALID_OFFSET || die_offset != DW_INVALID_OFFSET;
   }


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


[Lldb-commits] [PATCH] D60963: Fix dereferencing null pointer

2019-05-13 Thread Nico Weber via Phabricator via lldb-commits
thakis added a comment.

Add a test that fails without the code change and that passes with it. I don't 
know under which conditions this change is needed, so I apologize that I can't 
make a more concrete suggestion.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60963



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


[Lldb-commits] [lldb] r360587 - [NativePDB] Fix tests after r360569

2019-05-13 Thread Aleksandr Urakov via lldb-commits
Author: aleksandr.urakov
Date: Mon May 13 08:06:13 2019
New Revision: 360587

URL: http://llvm.org/viewvc/llvm-project?rev=360587&view=rev
Log:
[NativePDB] Fix tests after r360569

Modified:
lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp

Modified: lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp?rev=360587&r1=360586&r2=360587&view=diff
==
--- lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp (original)
+++ lldb/trunk/lit/SymbolFile/NativePDB/stack_unwinding01.cpp Mon May 13 
08:06:13 2019
@@ -26,8 +26,6 @@ int main(int argc, char **argv) {
 // CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
 // CHECK-NEXT:   * frame #0: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
 // CHECK-NEXT: frame #1: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
-// CHECK-NEXT: frame #2: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
-// CHECK-NEXT: frame #3: {{.*}} ntdll.dll`RtlUserThreadStart + 52
 
 
 // CHECK: (lldb) thread backtrace
@@ -35,8 +33,6 @@ int main(int argc, char **argv) {
 // CHECK-NEXT:   * frame #0: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
 // CHECK-NEXT: frame #1: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
 // CHECK-NEXT: frame #2: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
-// CHECK-NEXT: frame #3: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
-// CHECK-NEXT: frame #4: {{.*}} ntdll.dll`RtlUserThreadStart + 52
 
 // CHECK: (lldb) thread backtrace
 // CHECK-NEXT: * thread #1, stop reason = breakpoint 1.1
@@ -44,5 +40,3 @@ int main(int argc, char **argv) {
 // CHECK-NEXT: frame #1: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
 // CHECK-NEXT: frame #2: {{.*}} 
stack_unwinding01.cpp.tmp.exe`Struct::simple_method at stack_unwinding01.cpp:12
 // CHECK-NEXT: frame #3: {{.*}} 
stack_unwinding01.cpp.tmp.exe`main(argc={{.*}}, argv={{.*}}) at 
stack_unwinding01.cpp:20
-// CHECK-NEXT: frame #4: {{.*}} kernel32.dll`BaseThreadInitThunk + 34
-// CHECK-NEXT: frame #5: {{.*}} ntdll.dll`RtlUserThreadStart + 52


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


[Lldb-commits] [PATCH] D61128: Support member function types in PdbAstBuilder

2019-05-13 Thread Mikhail Senkov via Phabricator via lldb-commits
zloyrobot added a comment.

In D61128#1499934 , @labath wrote:

> Looks like this is failing on the windows bot 
> http://lab.llvm.org:8011/builders/lldb-x64-windows-ninja/builds/4635/steps/test/logs/stdio.
>
> Looking at the test, it seems that you are asserting that you will unwind 
> into a particular offset in ntdll.dll. That sounds like an incredibly fragile 
> assertion, which will only be true for people running the exact same version 
> of ntdll that you happen to have...


My bad, these assertions (ntdll and kernel32) should be removed from test. I 
already asked @aleksandr.urakov to do it.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61128



___
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-13 Thread Gabor Marton via Phabricator via lldb-commits
martong added a comment.

@aprantl Ping


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61438



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


[Lldb-commits] [lldb] r360599 - [DataFormatters] FindLibCppStdFunctionCallableInfo() currently uses FindFunctions() in order to find a lambdas operator()() but using FindSymbolsMatchingRegExAndType()

2019-05-13 Thread Shafik Yaghmour via lldb-commits
Author: shafik
Date: Mon May 13 09:48:06 2019
New Revision: 360599

URL: http://llvm.org/viewvc/llvm-project?rev=360599&view=rev
Log:
[DataFormatters] FindLibCppStdFunctionCallableInfo() currently uses 
FindFunctions() in order to find a lambdas operator()() but using 
FindSymbolsMatchingRegExAndType() is cheaper and if we also anchor the regex 
using ^ this adds some additional performance gains.

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

Modified:
lldb/trunk/source/Target/CPPLanguageRuntime.cpp

Modified: lldb/trunk/source/Target/CPPLanguageRuntime.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/CPPLanguageRuntime.cpp?rev=360599&r1=360598&r2=360599&view=diff
==
--- lldb/trunk/source/Target/CPPLanguageRuntime.cpp (original)
+++ lldb/trunk/source/Target/CPPLanguageRuntime.cpp Mon May 13 09:48:06 2019
@@ -241,8 +241,8 @@ CPPLanguageRuntime::FindLibCppStdFunctio
 
   SymbolContextList scl;
 
-  target.GetImages().FindFunctions(RegularExpression{func_to_match}, true, 
true,
-   true, scl);
+  target.GetImages().FindSymbolsMatchingRegExAndType(
+  RegularExpression{R"(^)" + func_to_match}, eSymbolTypeAny, scl, true);
 
   // Case 1,2 or 3
   if (scl.GetSize() >= 1) {


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


[Lldb-commits] [PATCH] D61759: Switch to FindSymbolsMatchingRegExAndType() from FindFunctions() in FindLibCppStdFunctionCallableInfo()

2019-05-13 Thread Shafik Yaghmour via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360599: [DataFormatters] 
FindLibCppStdFunctionCallableInfo() currently uses… (authored by shafik, 
committed by ).
Herald added a project: LLDB.

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61759

Files:
  source/Target/CPPLanguageRuntime.cpp


Index: source/Target/CPPLanguageRuntime.cpp
===
--- source/Target/CPPLanguageRuntime.cpp
+++ source/Target/CPPLanguageRuntime.cpp
@@ -241,8 +241,8 @@
 
   SymbolContextList scl;
 
-  target.GetImages().FindFunctions(RegularExpression{func_to_match}, true, 
true,
-   true, scl);
+  target.GetImages().FindSymbolsMatchingRegExAndType(
+  RegularExpression{R"(^)" + func_to_match}, eSymbolTypeAny, scl, true);
 
   // Case 1,2 or 3
   if (scl.GetSize() >= 1) {


Index: source/Target/CPPLanguageRuntime.cpp
===
--- source/Target/CPPLanguageRuntime.cpp
+++ source/Target/CPPLanguageRuntime.cpp
@@ -241,8 +241,8 @@
 
   SymbolContextList scl;
 
-  target.GetImages().FindFunctions(RegularExpression{func_to_match}, true, true,
-   true, scl);
+  target.GetImages().FindSymbolsMatchingRegExAndType(
+  RegularExpression{R"(^)" + func_to_match}, eSymbolTypeAny, scl, true);
 
   // Case 1,2 or 3
   if (scl.GetSize() >= 1) {
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61602: Handle function parameters of RunCommandInterpreter (script bridge)

2019-05-13 Thread Jim Ingham via Phabricator via lldb-commits
jingham accepted this revision.
jingham added a comment.
This revision is now accepted and ready to land.

Excellent, thanks!  Can you check this in or do you need me to?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61602



___
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-13 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: source/Target/CPPLanguageRuntime.cpp:217
 
 if (symbol != NULL &&
 symbol->GetName().GetStringRef().contains("__invoke")) {

davide wrote:
> This should probably be `nullptr`, anyway, my general comment is that this 
> check is scattered all around the function and could be centralized in a 
> single place.
`if (symbol && symbol->GetName() `



Comment at: source/Target/CPPLanguageRuntime.cpp:264
   (symbol != nullptr &&
symbol->GetName().GetStringRef().contains("__invoke"))) {
 // Case 1 and 2

this should probably be factored out into a bool variable.


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] D61864: Merge target and launch info environments

2019-05-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, aprantl, davide.
Herald added a project: LLDB.

Before this change we were overriding the launch info environment with the 
target environment. This meant that the environment variables passed to 
`process launch --environment <>` were lost. Instead of replacing the 
Environment, we should merge them.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61864

Files:
  lldb/lit/Process/TestEnvironment.test
  lldb/source/Commands/CommandObjectProcess.cpp


Index: lldb/source/Commands/CommandObjectProcess.cpp
===
--- lldb/source/Commands/CommandObjectProcess.cpp
+++ lldb/source/Commands/CommandObjectProcess.cpp
@@ -193,7 +193,10 @@
 if (target->GetDisableSTDIO())
   m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
 
-m_options.launch_info.GetEnvironment() = target->GetEnvironment();
+// Merge the launch info environment with the target environment.
+Environment target_env = target->GetEnvironment();
+m_options.launch_info.GetEnvironment().insert(target_env.begin(),
+  target_env.end());
 
 if (!target_settings_argv0.empty()) {
   m_options.launch_info.GetArguments().AppendArgument(
Index: lldb/lit/Process/TestEnvironment.test
===
--- /dev/null
+++ lldb/lit/Process/TestEnvironment.test
@@ -0,0 +1,8 @@
+UNSUPPORTED: system-windows
+
+The double quotes around "BAR" ensure we don't match the command.
+
+RUN: %lldb /usr/bin/env -o 'process launch --environment FOO="BAR"' | 
FileCheck %s
+RUN: %lldb /usr/bin/env -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s
+
+CHECK: FOO=BAR


Index: lldb/source/Commands/CommandObjectProcess.cpp
===
--- lldb/source/Commands/CommandObjectProcess.cpp
+++ lldb/source/Commands/CommandObjectProcess.cpp
@@ -193,7 +193,10 @@
 if (target->GetDisableSTDIO())
   m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
 
-m_options.launch_info.GetEnvironment() = target->GetEnvironment();
+// Merge the launch info environment with the target environment.
+Environment target_env = target->GetEnvironment();
+m_options.launch_info.GetEnvironment().insert(target_env.begin(),
+  target_env.end());
 
 if (!target_settings_argv0.empty()) {
   m_options.launch_info.GetArguments().AppendArgument(
Index: lldb/lit/Process/TestEnvironment.test
===
--- /dev/null
+++ lldb/lit/Process/TestEnvironment.test
@@ -0,0 +1,8 @@
+UNSUPPORTED: system-windows
+
+The double quotes around "BAR" ensure we don't match the command.
+
+RUN: %lldb /usr/bin/env -o 'process launch --environment FOO="BAR"' | FileCheck %s
+RUN: %lldb /usr/bin/env -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s
+
+CHECK: FOO=BAR
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


Re: [Lldb-commits] [lldb] r360564 - @skipIfLinux flaky lldb-mi tests

2019-05-13 Thread Alexander Polyakov via lldb-commits
Hi,

Unfortunately, the next few months I'll be busy with my bachelor's thesis,
so I can't dive into that problem right now.

I've just tested lldb-mi on Ubuntu Linux 18.04 and it seems that there is
some race condition somewhere in lldb-mi or lldb's core, I ran lldb-mi's
LIT test suite for five times and all tests were successfully passed, but
at the sixth try one test unexpectedly failed.

On Mon, May 13, 2019 at 12:17 PM Pavel Labath  wrote:

> On 13/05/2019 11:00, Raphael Isemann wrote:
> > These tests are now SkipIf Windows, FreeBSD, Darwin AND Linux :( So
> > unless someone sets up a Minix or GNU Hurd bot these tests are never
> > run.
>
> Yeah, the state of lldb-mi is... sad :/
>
> >
> > CC'ing Alexander who was IIRC able to fix these tests in the past, so
> > maybe he has an idea what's going on.
>
>
> The most recent failures are here:
>
> http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1354/steps/test/logs/stdio
>
> http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1343/steps/test/logs/stdio
>
> http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/1324/steps/test/logs/stdio
>
> pl
>
>
>

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


[Lldb-commits] [PATCH] D61602: Handle function parameters of RunCommandInterpreter (script bridge)

2019-05-13 Thread Lukas Böger via Phabricator via lldb-commits
lubgr added a comment.

No, I don't have the permissions. Thanks in advance for comitting this.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61602



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


[Lldb-commits] [PATCH] D61864: Merge target and launch info environments

2019-05-13 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

The fix looks good, but it seems like it wouldn't be hard to make the test 
windows-compatible, so I think we should do that. All it would take is to 
compile a very dumb version of "env" which just prints the value of the single 
env var. If you can get it to print in a different format then you can also 
avoid the double quote trick (which also doesn't work on windows).

Also, doesn't debugging of /usr/bin/env fail on darwin with SIP ?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61864



___
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-13 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: clang/include/clang/AST/ASTImporter.h:203
 /// context, or the import error.
-llvm::Expected Import_New(TypeSourceInfo *FromTSI);
-// FIXME: Remove this version.
-TypeSourceInfo *Import(TypeSourceInfo *FromTSI);
+llvm::Expected Import(TypeSourceInfo *FromTSI);
 

martong wrote:
> aprantl wrote:
> > Wouldn't it make more sense to return `Expected`?
> That would not be consistent with the other changes. In this patch we change 
> the signature of each functions similarly:
> From `T foo(...)` to `Expected foo(...)`.
> Also, `TypeSourceInfo` factory functions in `ASTContext` do return with a 
> pointer. For example:
> ```
>   TypeSourceInfo *CreateTypeSourceInfo(QualType T, unsigned Size = 0) const;
> 
>   /// Allocate a TypeSourceInfo where all locations have been
>   /// initialized to a given location, which defaults to the empty
>   /// location.
>   TypeSourceInfo *
>   getTrivialTypeSourceInfo(QualType T,
>SourceLocation Loc = SourceLocation()) const;
> 
> ```
I believe that LLVM's practice of passing non-null pointers around is bad API 
design because it's never quite clear from looking at an API which pointer 
parameters are nullable, so I was hoping that we could correct some of that at 
least in the cases where we introduce API that return Expected<> objects to 
make it obvious that this is either an error or a valid object. If you that the 
perceived inconsistency weighs stronger than the readability improvements let 
me know and I can reconsider.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61438



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


[Lldb-commits] [lldb] r360611 - Remove commented-out code

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 12:17:44 2019
New Revision: 360611

URL: http://llvm.org/viewvc/llvm-project?rev=360611&view=rev
Log:
Remove commented-out code

Modified:
lldb/trunk/source/Commands/CommandObjectProcess.cpp

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=360611&r1=360610&r2=360611&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Mon May 13 12:17:44 2019
@@ -252,49 +252,6 @@ protected:
   ProcessLaunchCommandOptions m_options;
 };
 
-//#define SET1 LLDB_OPT_SET_1
-//#define SET2 LLDB_OPT_SET_2
-//#define SET3 LLDB_OPT_SET_3
-//
-// OptionDefinition
-// CommandObjectProcessLaunch::CommandOptions::g_option_table[] =
-//{
-//  // clang-format off
-//  {SET1 | SET2 | SET3, false, "stop-at-entry", 's', 
OptionParser::eNoArgument,
-//  nullptr, 0, eArgTypeNone,  "Stop at the entry point of the program
-//  when launching a process."},
-//  {SET1,   false, "stdin", 'i',
-//  OptionParser::eRequiredArgument, nullptr, 0, eArgTypeDirectoryName,
-//  "Redirect stdin for the process to ."},
-//  {SET1,   false, "stdout",'o',
-//  OptionParser::eRequiredArgument, nullptr, 0, eArgTypeDirectoryName,
-//  "Redirect stdout for the process to ."},
-//  {SET1,   false, "stderr",'e',
-//  OptionParser::eRequiredArgument, nullptr, 0, eArgTypeDirectoryName,
-//  "Redirect stderr for the process to ."},
-//  {SET1 | SET2 | SET3, false, "plugin",'p',
-//  OptionParser::eRequiredArgument, nullptr, 0, eArgTypePlugin,"Name 
of
-//  the process plugin you want to use."},
-//  {   SET2,false, "tty",   't',
-//  OptionParser::eOptionalArgument, nullptr, 0, eArgTypeDirectoryName, "Start
-//  the process in a terminal. If  is specified, look for a terminal 
whose
-//  name contains , else start the process in a new terminal."},
-//  {  SET3, false, "no-stdio",  'n', 
OptionParser::eNoArgument,
-//  nullptr, 0, eArgTypeNone,  "Do not set up for terminal I/O to go to
-//  running process."},
-//  {SET1 | SET2 | SET3, false, "working-dir",   'w',
-//  OptionParser::eRequiredArgument, nullptr, 0, eArgTypeDirectoryName, "Set 
the
-//  current working directory to  when running the inferior."},
-//  {0, false, nullptr, 0, 0, nullptr, 0, eArgTypeNone, nullptr}
-//  // clang-format on
-//};
-//
-//#undef SET1
-//#undef SET2
-//#undef SET3
-
-// CommandObjectProcessAttach
-
 static constexpr OptionDefinition g_process_attach_options[] = {
 // clang-format off
   { LLDB_OPT_SET_ALL, false, "continue", 'c', 
OptionParser::eNoArgument,   nullptr, {}, 0, eArgTypeNone, 
"Immediately continue the process once attached." },


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


[Lldb-commits] [lldb] r360612 - Merge target and launch info environments

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 12:17:48 2019
New Revision: 360612

URL: http://llvm.org/viewvc/llvm-project?rev=360612&view=rev
Log:
Merge target and launch info environments

Before this change we were overriding the launch info environment with
the target environment. This meant that the environment variables passed
to `process launch --environment <>` were lost. Instead of replacing the
environment, we should merge them.

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

Added:
lldb/trunk/lit/Process/Inputs/
lldb/trunk/lit/Process/Inputs/env.cpp
lldb/trunk/lit/Process/TestEnvironment.test
Modified:
lldb/trunk/source/Commands/CommandObjectProcess.cpp

Added: lldb/trunk/lit/Process/Inputs/env.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Process/Inputs/env.cpp?rev=360612&view=auto
==
--- lldb/trunk/lit/Process/Inputs/env.cpp (added)
+++ lldb/trunk/lit/Process/Inputs/env.cpp Mon May 13 12:17:48 2019
@@ -0,0 +1,7 @@
+#include 
+#include 
+
+int main() {
+  if (const char *env_p = std::getenv("FOO"))
+std::cout << "FOO=" << env_p << '\n';
+}

Added: lldb/trunk/lit/Process/TestEnvironment.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Process/TestEnvironment.test?rev=360612&view=auto
==
--- lldb/trunk/lit/Process/TestEnvironment.test (added)
+++ lldb/trunk/lit/Process/TestEnvironment.test Mon May 13 12:17:48 2019
@@ -0,0 +1,7 @@
+The double quotes around "BAR" ensure we don't match the command.
+
+RUN: %clangxx -std=c++11 %p/Inputs/env.cpp -o %t
+RUN: %lldb %t -o 'process launch --environment FOO="BAR"' | FileCheck %s
+RUN: %lldb %t -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s
+
+CHECK: FOO=BAR

Modified: lldb/trunk/source/Commands/CommandObjectProcess.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectProcess.cpp?rev=360612&r1=360611&r2=360612&view=diff
==
--- lldb/trunk/source/Commands/CommandObjectProcess.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectProcess.cpp Mon May 13 12:17:48 2019
@@ -193,7 +193,10 @@ protected:
 if (target->GetDisableSTDIO())
   m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
 
-m_options.launch_info.GetEnvironment() = target->GetEnvironment();
+// Merge the launch info environment with the target environment.
+Environment target_env = target->GetEnvironment();
+m_options.launch_info.GetEnvironment().insert(target_env.begin(),
+  target_env.end());
 
 if (!target_settings_argv0.empty()) {
   m_options.launch_info.GetArguments().AppendArgument(


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


[Lldb-commits] [PATCH] D61864: Merge target and launch info environments

2019-05-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360612: Merge target and launch info environments 
(authored by JDevlieghere, committed by ).
Herald added a subscriber: teemperor.

Changed prior to commit:
  https://reviews.llvm.org/D61864?vs=199294&id=199305#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61864

Files:
  lit/Process/Inputs/env.cpp
  lit/Process/TestEnvironment.test
  source/Commands/CommandObjectProcess.cpp


Index: lit/Process/TestEnvironment.test
===
--- lit/Process/TestEnvironment.test
+++ lit/Process/TestEnvironment.test
@@ -0,0 +1,7 @@
+The double quotes around "BAR" ensure we don't match the command.
+
+RUN: %clangxx -std=c++11 %p/Inputs/env.cpp -o %t
+RUN: %lldb %t -o 'process launch --environment FOO="BAR"' | FileCheck %s
+RUN: %lldb %t -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s
+
+CHECK: FOO=BAR
Index: lit/Process/Inputs/env.cpp
===
--- lit/Process/Inputs/env.cpp
+++ lit/Process/Inputs/env.cpp
@@ -0,0 +1,7 @@
+#include 
+#include 
+
+int main() {
+  if (const char *env_p = std::getenv("FOO"))
+std::cout << "FOO=" << env_p << '\n';
+}
Index: source/Commands/CommandObjectProcess.cpp
===
--- source/Commands/CommandObjectProcess.cpp
+++ source/Commands/CommandObjectProcess.cpp
@@ -193,7 +193,10 @@
 if (target->GetDisableSTDIO())
   m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
 
-m_options.launch_info.GetEnvironment() = target->GetEnvironment();
+// Merge the launch info environment with the target environment.
+Environment target_env = target->GetEnvironment();
+m_options.launch_info.GetEnvironment().insert(target_env.begin(),
+  target_env.end());
 
 if (!target_settings_argv0.empty()) {
   m_options.launch_info.GetArguments().AppendArgument(


Index: lit/Process/TestEnvironment.test
===
--- lit/Process/TestEnvironment.test
+++ lit/Process/TestEnvironment.test
@@ -0,0 +1,7 @@
+The double quotes around "BAR" ensure we don't match the command.
+
+RUN: %clangxx -std=c++11 %p/Inputs/env.cpp -o %t
+RUN: %lldb %t -o 'process launch --environment FOO="BAR"' | FileCheck %s
+RUN: %lldb %t -o 'env FOO="BAR"' -o 'process launch' | FileCheck %s
+
+CHECK: FOO=BAR
Index: lit/Process/Inputs/env.cpp
===
--- lit/Process/Inputs/env.cpp
+++ lit/Process/Inputs/env.cpp
@@ -0,0 +1,7 @@
+#include 
+#include 
+
+int main() {
+  if (const char *env_p = std::getenv("FOO"))
+std::cout << "FOO=" << env_p << '\n';
+}
Index: source/Commands/CommandObjectProcess.cpp
===
--- source/Commands/CommandObjectProcess.cpp
+++ source/Commands/CommandObjectProcess.cpp
@@ -193,7 +193,10 @@
 if (target->GetDisableSTDIO())
   m_options.launch_info.GetFlags().Set(eLaunchFlagDisableSTDIO);
 
-m_options.launch_info.GetEnvironment() = target->GetEnvironment();
+// Merge the launch info environment with the target environment.
+Environment target_env = target->GetEnvironment();
+m_options.launch_info.GetEnvironment().insert(target_env.begin(),
+  target_env.end());
 
 if (!target_settings_argv0.empty()) {
   m_options.launch_info.GetArguments().AppendArgument(
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61872: [CMake] Simplify lldb-server handling

2019-05-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: sgraenitz, labath, davide.
Herald added subscribers: mgorny, srhines.
Herald added a project: LLDB.

We can piggyback off the existing add_lldb_tool_subdirectory to decide whether 
or not lldb-server should be built.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61872

Files:
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/tools/CMakeLists.txt
  lldb/unittests/tools/CMakeLists.txt


Index: lldb/unittests/tools/CMakeLists.txt
===
--- lldb/unittests/tools/CMakeLists.txt
+++ lldb/unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT 
CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: lldb/cmake/modules/LLDBConfig.cmake
===
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -419,9 +419,9 @@
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
+  set(LLDB_TOOL_LLDB_SERVER_BUILD ON)
 else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll


Index: lldb/unittests/tools/CMakeLists.txt
===
--- lldb/unittests/tools/CMakeLists.txt
+++ lldb/unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: lldb/cmake/modules/LLDBConfig.cmake
===
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -419,9 +419,9 @@
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
 if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
+  set(LLDB_TOOL_LLDB_SERVER_BUILD ON)
 else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61872: [CMake] Simplify lldb-server handling

2019-05-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 199327.

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

https://reviews.llvm.org/D61872

Files:
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/tools/CMakeLists.txt
  lldb/unittests/tools/CMakeLists.txt


Index: lldb/unittests/tools/CMakeLists.txt
===
--- lldb/unittests/tools/CMakeLists.txt
+++ lldb/unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT 
CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: lldb/cmake/modules/LLDBConfig.cmake
===
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -414,14 +414,10 @@
 
 list(APPEND system_libs ${CMAKE_DL_LIBS})
 
-SET(SKIP_LLDB_SERVER_BUILD OFF CACHE BOOL "Skip building lldb-server")
-
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
-else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll


Index: lldb/unittests/tools/CMakeLists.txt
===
--- lldb/unittests/tools/CMakeLists.txt
+++ lldb/unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: lldb/cmake/modules/LLDBConfig.cmake
===
--- lldb/cmake/modules/LLDBConfig.cmake
+++ lldb/cmake/modules/LLDBConfig.cmake
@@ -414,14 +414,10 @@
 
 list(APPEND system_libs ${CMAKE_DL_LIBS})
 
-SET(SKIP_LLDB_SERVER_BUILD OFF CACHE BOOL "Skip building lldb-server")
-
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
-else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61872: [CMake] Simplify lldb-server handling

2019-05-13 Thread Davide Italiano via Phabricator via lldb-commits
davide added inline comments.



Comment at: lldb/tools/CMakeLists.txt:12
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)

This probably predates the use of `add_lldb_tool_subdirectory` in lldb.


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

https://reviews.llvm.org/D61872



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


[Lldb-commits] [lldb] r360621 - [CMake] Simplify lldb-server handling

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 14:25:02 2019
New Revision: 360621

URL: http://llvm.org/viewvc/llvm-project?rev=360621&view=rev
Log:
[CMake] Simplify lldb-server handling

We can piggyback off the existing add_lldb_tool_subdirectory to decide
whether or not lldb-server should be built.

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

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/tools/CMakeLists.txt
lldb/trunk/unittests/tools/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=360621&r1=360620&r2=360621&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Mon May 13 14:25:02 2019
@@ -414,14 +414,10 @@ endif()
 
 list(APPEND system_libs ${CMAKE_DL_LIBS})
 
-SET(SKIP_LLDB_SERVER_BUILD OFF CACHE BOOL "Skip building lldb-server")
-
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
-else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll

Modified: lldb/trunk/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=360621&r1=360620&r2=360621&view=diff
==
--- lldb/trunk/tools/CMakeLists.txt (original)
+++ lldb/trunk/tools/CMakeLists.txt Mon May 13 14:25:02 2019
@@ -9,13 +9,10 @@ add_subdirectory(lldb-test EXCLUDE_FROM_
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()

Modified: lldb/trunk/unittests/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/tools/CMakeLists.txt?rev=360621&r1=360620&r2=360621&view=diff
==
--- lldb/trunk/unittests/tools/CMakeLists.txt (original)
+++ lldb/trunk/unittests/tools/CMakeLists.txt Mon May 13 14:25:02 2019
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT 
CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()


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


[Lldb-commits] [PATCH] D61872: [CMake] Simplify lldb-server handling

2019-05-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB360621: [CMake] Simplify lldb-server handling (authored 
by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61872?vs=199327&id=199328#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61872

Files:
  cmake/modules/LLDBConfig.cmake
  tools/CMakeLists.txt
  unittests/tools/CMakeLists.txt


Index: unittests/tools/CMakeLists.txt
===
--- unittests/tools/CMakeLists.txt
+++ unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT 
CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -414,14 +414,10 @@
 
 list(APPEND system_libs ${CMAKE_DL_LIBS})
 
-SET(SKIP_LLDB_SERVER_BUILD OFF CACHE BOOL "Skip building lldb-server")
-
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
-else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll


Index: unittests/tools/CMakeLists.txt
===
--- unittests/tools/CMakeLists.txt
+++ unittests/tools/CMakeLists.txt
@@ -1,9 +1,6 @@
-add_subdirectory(lldb-mi)
-if(CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|Linux|NetBSD")
-  if ((CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_TEST_DEBUGSERVER) OR (NOT CMAKE_SYSTEM_NAME MATCHES "Darwin" AND SKIP_LLDB_SERVER_BUILD))
-# These tests are meant to test lldb-server/debugserver in isolation, and
-# don't provide any value if run against a server copied from somewhere.
-  else()
-add_subdirectory(lldb-server)
-  endif()
+if(LLDB_TOOL_LLDB_MI_BUILD)
+  add_subdirectory(lldb-mi)
+endif()
+if(LLDB_TOOL_LLDB_SERVER_BUILD)
+  add_subdirectory(lldb-server)
 endif()
Index: tools/CMakeLists.txt
===
--- tools/CMakeLists.txt
+++ tools/CMakeLists.txt
@@ -9,13 +9,10 @@
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
+add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
-
-if (LLDB_CAN_USE_LLDB_SERVER AND NOT SKIP_LLDB_SERVER_BUILD)
-  add_subdirectory(lldb-server)
-endif()
Index: cmake/modules/LLDBConfig.cmake
===
--- cmake/modules/LLDBConfig.cmake
+++ cmake/modules/LLDBConfig.cmake
@@ -414,14 +414,10 @@
 
 list(APPEND system_libs ${CMAKE_DL_LIBS})
 
-SET(SKIP_LLDB_SERVER_BUILD OFF CACHE BOOL "Skip building lldb-server")
-
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-set(LLDB_CAN_USE_LLDB_SERVER 1)
-else()
-set(LLDB_CAN_USE_LLDB_SERVER 0)
+if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61872: [CMake] Simplify lldb-server handling

2019-05-13 Thread Davide Italiano via Phabricator via lldb-commits
davide accepted this revision.
davide added a comment.
This revision is now accepted and ready to land.

LGTM


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

https://reviews.llvm.org/D61872



___
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-13 Thread António Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 199331.
aadsm added a comment.

Use functions instead of subclassing


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 &get_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,100 @@
+//===- 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;
+
+namespace {
+void AcceptThread(Socket *listen_socket, bool child_processes_inherit,
+  Socket **accept_socket, Status *error) {
+  *error = listen_socket->Accept(*accept_socket);
+}
+} // namespace
+
+template 
+void lldb_private::CreateConnectedSockets(
+llvm::StringRef listen_remote_address,
+const std::function &get_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, &accept_socket,
+&accept_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 &s) {
+  

[Lldb-commits] [lldb] r360624 - Disable TestEnvironment on Windows

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 15:02:09 2019
New Revision: 360624

URL: http://llvm.org/viewvc/llvm-project?rev=360624&view=rev
Log:
Disable TestEnvironment on Windows

The input source file seems to be triggering an error in the Visual
Studio headers.

> xstddef:338:2: error: ''auto' return without trailing return type;
> deduced return types are a C++14 extension

I tried converting the test to use the %build stuff Zachary added, but
that seems to be missing some Darwin support. Disabling the test on
Windows in the meantime.

Modified:
lldb/trunk/lit/Process/TestEnvironment.test

Modified: lldb/trunk/lit/Process/TestEnvironment.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Process/TestEnvironment.test?rev=360624&r1=360623&r2=360624&view=diff
==
--- lldb/trunk/lit/Process/TestEnvironment.test (original)
+++ lldb/trunk/lit/Process/TestEnvironment.test Mon May 13 15:02:09 2019
@@ -1,3 +1,5 @@
+UNSUPPORTED: system-windows
+
 The double quotes around "BAR" ensure we don't match the command.
 
 RUN: %clangxx -std=c++11 %p/Inputs/env.cpp -o %t


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


[Lldb-commits] [lldb] r360631 - [CMake] Reinstate LLDB_CAN_USE_LLDB_SERVER

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 15:55:11 2019
New Revision: 360631

URL: http://llvm.org/viewvc/llvm-project?rev=360631&view=rev
Log:
[CMake] Reinstate LLDB_CAN_USE_LLDB_SERVER

We cannot manipulate the LLDB_TOOL_LLDB_SERVER_BUILD directly from
LLDBConfig.cmake because this would set the variable before the option
is defined in AddLLVM.cmake. Instead, we need to use the
LLDB_CAN_USE_LLDB_SERVER variable to conditionally add the lldb-server
subdirectory. This should ensure the variable doesn't get cleared.

Modified:
lldb/trunk/cmake/modules/LLDBConfig.cmake
lldb/trunk/tools/CMakeLists.txt

Modified: lldb/trunk/cmake/modules/LLDBConfig.cmake
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/cmake/modules/LLDBConfig.cmake?rev=360631&r1=360630&r2=360631&view=diff
==
--- lldb/trunk/cmake/modules/LLDBConfig.cmake (original)
+++ lldb/trunk/cmake/modules/LLDBConfig.cmake Mon May 13 15:55:11 2019
@@ -416,8 +416,10 @@ list(APPEND system_libs ${CMAKE_DL_LIBS}
 
 # Figure out if lldb could use lldb-server.  If so, then we'll
 # ensure we build lldb-server when an lldb target is being built.
-if (NOT CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
-  set(LLDB_TOOL_LLDB_SERVER_BUILD OFF)
+if (CMAKE_SYSTEM_NAME MATCHES "Android|Darwin|FreeBSD|Linux|NetBSD")
+  set(LLDB_CAN_USE_LLDB_SERVER 1 INTERNAL)
+else()
+  set(LLDB_CAN_USE_LLDB_SERVER 0 INTERNAL)
 endif()
 
 # Figure out if lldb could use debugserver.  If so, then we'll

Modified: lldb/trunk/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=360631&r1=360630&r2=360631&view=diff
==
--- lldb/trunk/tools/CMakeLists.txt (original)
+++ lldb/trunk/tools/CMakeLists.txt Mon May 13 15:55:11 2019
@@ -9,10 +9,13 @@ add_subdirectory(lldb-test EXCLUDE_FROM_
 
 add_lldb_tool_subdirectory(lldb-instr)
 add_lldb_tool_subdirectory(lldb-mi)
-add_lldb_tool_subdirectory(lldb-server)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
   add_subdirectory(darwin-debug)
   add_subdirectory(debugserver)
 endif()
+
+if (LLDB_CAN_USE_LLDB_SERVER)
+  add_lldb_tool_subdirectory(lldb-server)
+endif()


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


[Lldb-commits] [lldb] r360632 - [Docs] Fix code formattign in variable.rst

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 16:05:51 2019
New Revision: 360632

URL: http://llvm.org/viewvc/llvm-project?rev=360632&view=rev
Log:
[Docs] Fix code formattign in variable.rst

Fixes missing newline between :: and the actual code.

Modified:
lldb/trunk/docs/use/variable.rst

Modified: lldb/trunk/docs/use/variable.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/use/variable.rst?rev=360632&r1=360631&r2=360632&view=diff
==
--- lldb/trunk/docs/use/variable.rst (original)
+++ lldb/trunk/docs/use/variable.rst Mon May 13 16:05:51 2019
@@ -764,6 +764,7 @@ command, supports a --summary option tha
 given instead of the default one.
 
 ::
+
(lldb) type summary add --summary-string "x=${var.integer}" --name 
NamedSummary
(lldb) frame variable one
(i_am_cool) one = int = 3, float = 3.14159, char = 69


___
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-13 Thread J. Ryan Stinnett via Phabricator via lldb-commits
jryans created this revision.
jryans added reviewers: sgraenitz, JDevlieghere.
Herald added a subscriber: mgorny.
Herald added a reviewer: EricWF.
Herald added a project: LLDB.

This adds a specific error message to clarify that lldb requires libcxx when
built together with clang on macOS. In addition, the lldb building docs are also
updated.

Fixes https://bugs.llvm.org/show_bug.cgi?id=41866


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61877

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


Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -152,6 +152,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/CMakeLists.txt
===
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -124,6 +124,11 @@
   message(WARNING "LLDB test suite requires libc++ in 
llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}")
 endif()
   else()
+if(NOT libcxx IN_LIST LLVM_ENABLE_PROJECTS)
+  message(FATAL_ERROR
+"LLDB test suite requires libc++, but it is currently disabled. "
+"Please add `libcxx` to `LLVM_ENABLE_PROJECTS`.")
+endif()
 list(APPEND LLDB_TEST_DEPS cxx)
   endif()
 endif()


Index: lldb/docs/resources/build.rst
===
--- lldb/docs/resources/build.rst
+++ lldb/docs/resources/build.rst
@@ -152,6 +152,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/CMakeLists.txt
===
--- lldb/CMakeLists.txt
+++ lldb/CMakeLists.txt
@@ -124,6 +124,11 @@
   message(WARNING "LLDB test suite requires libc++ in llvm/projects/libcxx or an existing build symlinked to ${cxx_dir}")
 endif()
   else()
+if(NOT libcxx IN_LIST LLVM_ENABLE_PROJECTS)
+  message(FATAL_ERROR
+"LLDB test suite requires libc++, but it is currently disabled. "
+"Please add `libcxx` to `LLVM_ENABLE_PROJECTS`.")
+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] D61877: [CMake] Add error to clarify that lldb requires libcxx

2019-05-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: lldb/CMakeLists.txt:127
   else()
+if(NOT libcxx IN_LIST LLVM_ENABLE_PROJECTS)
+  message(FATAL_ERROR

Should we check that LLVM_ENABLE_PROJECTS is not empty, for people that are 
still using the old layout?


Repository:
  rG LLVM Github Monorepo

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] r360638 - [Docs] Differentiate between public and private API

2019-05-13 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Mon May 13 17:36:05 2019
New Revision: 360638

URL: http://llvm.org/viewvc/llvm-project?rev=360638&view=rev
Log:
[Docs] Differentiate between public and private API

On the homepage we should have a clear distinction between the public
and private C++ APIs.

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=360638&r1=360637&r2=360638&view=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Mon May 13 17:36:05 2019
@@ -61,8 +61,9 @@ Resources
 API Documentation
 =
 
-* `C++ API Documentation `_
-* `Python API Documentation 
`_
+* `Public Python API Reference 
`_
+* `Public C++ API Reference 
`_
+* `Private C++ Reference `_
 
 External Links
 ==


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


[Lldb-commits] [PATCH] D61776: [Target] Generalize some behavior in Thread

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

Unfortunately I can't land this patch as-is. With this patch applied, 
TestObjCExceptions fails. It looks like c++ exceptions are supported at the 
bare minimum as a part of the objc exception handling logic.

It was failing 2 subtests: `test_objc_exceptions_at_throw` and 
`test_cxx_exceptions_at_abort`. The first test was failing because of a minor 
bug that I will include a fix for in this patch. The second test is failing 
because of an assertion that the current exception we get should not be valid, 
but now it is valid. That is because we are able to get the exception object 
from the C++ runtime now. However, the assertion that the exception backtrace 
isn't valid still holds (since that isn't implemented for C++). I'm going to 
update this patch to reflect this new information in the near future and then 
request another review from y'all.


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

https://reviews.llvm.org/D61776



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


[Lldb-commits] [lldb] r360641 - LLDB website: Change the title back to "The LLDB Debugger"

2019-05-13 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Mon May 13 19:31:56 2019
New Revision: 360641

URL: http://llvm.org/viewvc/llvm-project?rev=360641&view=rev
Log:
LLDB website: Change the title back to "The LLDB Debugger"

This is what the old homepage also used.

Modified:
lldb/trunk/docs/conf.py
lldb/trunk/docs/index.rst

Modified: lldb/trunk/docs/conf.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/conf.py?rev=360641&r1=360640&r2=360641&view=diff
==
--- lldb/trunk/docs/conf.py (original)
+++ lldb/trunk/docs/conf.py Mon May 13 19:31:56 2019
@@ -104,7 +104,7 @@ html_theme = 'haiku'
 
 # The name for this set of Sphinx documents.  If None, it defaults to
 # " v documentation".
-#html_title = None
+html_title = 'The LLDB Debugger'
 
 # A shorter title for the navigation bar.  Default is the same as html_title.
 #html_short_title = None
@@ -175,6 +175,9 @@ html_last_updated_fmt = '%b %d, %Y'
 # Output file base name for HTML help builder.
 htmlhelp_basename = 'LLDBdoc'
 
+# If true, the reST sources are included in the HTML build as
+# _sources/name. The default is True.
+html_copy_source = False
 
 # -- Options for LaTeX output 
--
 

Modified: lldb/trunk/docs/index.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/index.rst?rev=360641&r1=360640&r2=360641&view=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Mon May 13 19:31:56 2019
@@ -1,7 +1,9 @@
-.. title:: Welcome to LLDB's documentation!
+.. title:: LLDB Homepage
 
-LLDB
-
+The LLDB Debugger
+=
+
+Welcome to the LLDB version |release| documentation!
 
 LLDB is a next generation, high-performance debugger. It is built as a set of
 reusable components which highly leverage existing libraries in the larger LLVM


___
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-13 Thread Hui Huang via Phabricator via lldb-commits
Hui added inline comments.



Comment at: 
packages/Python/lldbsuite/test/tools/lldb-server/TestGdbRemoteModuleInfo.py:24-27
+# Replace path separators in the json string either with "" or "/" 
on Windows.
+triple = self.dbg.GetSelectedPlatform().GetTriple()
+if re.match(".*-.*-windows", triple):
+module_path = module_path.replace(os.path.sep, '/')

clayborg wrote:
> labath wrote:
> > It sounds like you could just unconditionally replace all backslashes with 
> > double-backslashes here. That would result in us also correctly handling 
> > posix paths that happen to contain a backslash.
> Remove
The 'jModulesInfo' packet is a json string. I tested with json.loads as follows.
It seemed to me that module_path needs to be escaped, i.e. 'd:abc' or be  
'd:/abc'.

not-working case:

```
>>> module_path = 'd:\abc'
>>> json.dumps(module_path)
'"d:\\u0007bc"'
>>> json.loads('[{"[file":"%s"}]' % json.dumps(module_path))
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/json/__init__.py", line 339, in loads
return _default_decoder.decode(s)
  File "/usr/lib/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python2.7/json/decoder.py", line 380, in raw_decode
obj, end = self.scan_once(s, idx)
ValueError: Expecting , delimiter: line 1 column 13 (char 12)

```
working case:

```
>>> module_path = 'd:abc'
>>> json.loads('[{"[file":"%s"}]' % module_path)
[{u'[file': u'd:\\abc'}]
```





Repository:
  rLLDB LLDB

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] D61776: [Target] Generalize some behavior in Thread

2019-05-13 Thread Alex Langford via Phabricator via lldb-commits
xiaobai updated this revision to Diff 199364.
xiaobai added a comment.

- Fix minor bug in ItaniumABILanguageRuntime
- Modify test to accomodate new behavior


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

https://reviews.llvm.org/D61776

Files:
  packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
  
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
  source/Target/Thread.cpp


Index: source/Target/Thread.cpp
===
--- source/Target/Thread.cpp
+++ source/Target/Thread.cpp
@@ -2209,25 +2209,31 @@
   if (auto e = recognized_frame->GetExceptionObject())
 return e;
 
-  // FIXME: For now, only ObjC exceptions are supported. This should really
-  // iterate over all language runtimes and ask them all to give us the current
-  // exception.
-  if (auto runtime = GetProcess()->GetObjCLanguageRuntime())
-if (auto e = runtime->GetExceptionObjectForThread(shared_from_this()))
-  return e;
+  // NOTE: Even though this behavior is generalized, only ObjC is actually
+  // supported at the moment.
+  for (unsigned lang = eLanguageTypeUnknown; lang < eNumLanguageTypes; lang++) 
{
+if (auto runtime = GetProcess()->GetLanguageRuntime(
+static_cast(lang)))
+  if (auto e = runtime->GetExceptionObjectForThread(shared_from_this()))
+return e;
+  }
 
   return ValueObjectSP();
 }
 
 ThreadSP Thread::GetCurrentExceptionBacktrace() {
   ValueObjectSP exception = GetCurrentException();
-  if (!exception) return ThreadSP();
+  if (!exception)
+return ThreadSP();
 
-  // FIXME: For now, only ObjC exceptions are supported. This should really
-  // iterate over all language runtimes and ask them all to give us the current
-  // exception.
-  auto runtime = GetProcess()->GetObjCLanguageRuntime();
-  if (!runtime) return ThreadSP();
+  // NOTE: Even though this behavior is generalized, only ObjC is actually
+  // supported at the moment.
+  for (unsigned lang = eLanguageTypeUnknown; lang < eNumLanguageTypes; lang++) 
{
+if (auto runtime = GetProcess()->GetLanguageRuntime(
+static_cast(lang)))
+  if (auto bt = runtime->GetBacktraceThreadFromException(exception))
+return bt;
+  }
 
-  return runtime->GetBacktraceThreadFromException(exception);
+  return ThreadSP();
 }
Index: 
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
===
--- 
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
+++ 
source/Plugins/LanguageRuntime/CPlusPlus/ItaniumABI/ItaniumABILanguageRuntime.cpp
@@ -594,6 +594,10 @@
   addr_t exception_addr =
   m_process->ReadPointerFromMemory(result_ptr - ptr_size, error);
 
+  if (!error.Success()) {
+return ValueObjectSP();
+  }
+
   lldb_private::formatters::InferiorSizedWord exception_isw(exception_addr,
 *m_process);
   ValueObjectSP exception = ValueObject::CreateValueObjectFromData(
Index: packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
===
--- packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
+++ packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
@@ -196,11 +196,12 @@
 self.expect("thread list",
 substrs=['stopped', 'stop reason = signal SIGABRT'])
 
-self.expect('thread exception', substrs=[])
+self.expect('thread exception', substrs=['exception ='])
 
 process = self.dbg.GetSelectedTarget().process
 thread = process.GetSelectedThread()
 
-# C++ exceptions are not exposed in the API (yet).
-self.assertFalse(thread.GetCurrentException().IsValid())
+self.assertTrue(thread.GetCurrentException().IsValid())
+
+# C++ exception backtraces are not exposed in the API (yet).
 self.assertFalse(thread.GetCurrentExceptionBacktrace().IsValid())


Index: source/Target/Thread.cpp
===
--- source/Target/Thread.cpp
+++ source/Target/Thread.cpp
@@ -2209,25 +2209,31 @@
   if (auto e = recognized_frame->GetExceptionObject())
 return e;
 
-  // FIXME: For now, only ObjC exceptions are supported. This should really
-  // iterate over all language runtimes and ask them all to give us the current
-  // exception.
-  if (auto runtime = GetProcess()->GetObjCLanguageRuntime())
-if (auto e = runtime->GetExceptionObjectForThread(shared_from_this()))
-  return e;
+  // NOTE: Even though this behavior is generalized, only ObjC is actually
+  // supported at the moment.
+  for (unsigned lang = eLanguageTypeUnknown; lang < eNumLanguageTypes; lang++) {
+if (auto runtime = GetProcess()->GetLanguageRuntime(
+static_cast(lang)))
+  

[Lldb-commits] [lldb] r360646 - ARMDefines.h: fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=OFF builds

2019-05-13 Thread Fangrui Song via lldb-commits
Author: maskray
Date: Mon May 13 21:09:52 2019
New Revision: 360646

URL: http://llvm.org/viewvc/llvm-project?rev=360646&view=rev
Log:
ARMDefines.h: fix -Wimplicit-fallthrough in -DLLVM_ENABLE_ASSERTIONS=OFF builds

Reviewed By: JDevlieghere

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

Modified:
lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h

Modified: lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h?rev=360646&r1=360645&r2=360646&view=diff
==
--- lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/ARMDefines.h Mon May 13 21:09:52 
2019
@@ -9,6 +9,8 @@
 #ifndef lldb_ARMDefines_h_
 #define lldb_ARMDefines_h_
 
+#include "llvm/Support/ErrorHandling.h"
+
 #include 
 #include 
 
@@ -68,8 +70,6 @@ typedef enum {
 
 static inline const char *ARMCondCodeToString(uint32_t CC) {
   switch (CC) {
-  default:
-assert(0 && "Unknown condition code");
   case COND_EQ:
 return "eq";
   case COND_NE:
@@ -101,6 +101,7 @@ static inline const char *ARMCondCodeToS
   case COND_AL:
 return "al";
   }
+  llvm_unreachable("Unknown condition code");
 }
 
 static inline bool ARMConditionPassed(const uint32_t condition,


___
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-13 Thread Pavel Labath via Phabricator via lldb-commits
labath accepted this revision.
labath added a comment.
This revision is now accepted and ready to land.

Looks fine to me. Thank you for fixing this.




Comment at: lldb/unittests/Host/SocketTestUtilities.cpp:16
+namespace {
+void AcceptThread(Socket *listen_socket, bool child_processes_inherit,
+  Socket **accept_socket, Status *error) {

LLVM prefers static functions over ones in anonymous namespaces.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61833



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