[Lldb-commits] [PATCH] D60405: MinidumpYAML: Add support for ModuleList stream

2019-04-18 Thread James Henderson via Phabricator via lldb-commits
jhenderson accepted this revision.
jhenderson added inline comments.



Comment at: lib/ObjectYAML/MinidumpYAML.cpp:21
+/// methods, while the final minidump file is written by calling the writeTo
+/// method. The plan versions of allocation functions take a reference to the
+/// data which is to be written (and hence the data must be available until

plan -> plain (?)



Comment at: lib/ObjectYAML/MinidumpYAML.cpp:97
 
-  SmallVector EndianStr(WStr.size() + 1,
-  support::ulittle16_t());
-  copy(WStr, EndianStr.begin());
-  return allocateCallback(
-  sizeof(uint32_t) + EndianStr.size() * sizeof(support::ulittle16_t),
-  [EndianStr](raw_ostream &OS) {
-// Length does not include the null-terminator.
-support::ulittle32_t Length(2 * (EndianStr.size() - 1));
-OS.write(reinterpret_cast(&Length), sizeof(Length));
-OS.write(reinterpret_cast(EndianStr.begin()),
- sizeof(support::ulittle16_t) * EndianStr.size());
-  });
+  // The the utf16 string is null-terminated, but the terminator is not counted
+  // in the string size.

Double "the"


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60405



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


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

2019-04-18 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz created this revision.
sgraenitz added reviewers: friss, bogner, beanz.
Herald added subscribers: aprantl, mgorny.
Herald added a project: LLVM.

Extra flexibility for emitting debug info to external files (remains Darwin 
only for now).
LLDB needs this functionality to emit a LLDB.framework.dSYM instead of 
LLDB.dSYM when building the framework, because the latter could conflict with 
the driver's lldb.dSYM when emitted in the same directory on case-insensitive 
file systems.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60862

Files:
  llvm/cmake/modules/AddLLVM.cmake


Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1604,14 +1604,21 @@
 endif()
   endif()
 
-  if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
-if(APPLE)
-  set(output_name "$.dSYM")
+  if(APPLE)
+if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
+  set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
+else()
+  set(file_ext dSYM)
+endif()
+
+set(output_name "$.${file_ext}")
+
+if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
   set(output_path 
"-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
+else()
+  set(output_path "-o=${output_name}")
 endif()
-  endif()
 
-  if(APPLE)
 if(CMAKE_CXX_FLAGS MATCHES "-flto"
   OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
 


Index: llvm/cmake/modules/AddLLVM.cmake
===
--- llvm/cmake/modules/AddLLVM.cmake
+++ llvm/cmake/modules/AddLLVM.cmake
@@ -1604,14 +1604,21 @@
 endif()
   endif()
 
-  if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
-if(APPLE)
-  set(output_name "$.dSYM")
+  if(APPLE)
+if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
+  set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
+else()
+  set(file_ext dSYM)
+endif()
+
+set(output_name "$.${file_ext}")
+
+if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
   set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
+else()
+  set(output_path "-o=${output_name}")
 endif()
-  endif()
 
-  if(APPLE)
 if(CMAKE_CXX_FLAGS MATCHES "-flto"
   OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

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

Enables https://reviews.llvm.org/D60863


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60862



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


[Lldb-commits] [PATCH] D60863: [CMake] Emit LLDB.framework.dSYM to avoid potential name collision with driver's lldb.dSYM

2019-04-18 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz created this revision.
sgraenitz added reviewers: friss, beanz, bogner.
Herald added a subscriber: mgorny.
Herald added a project: LLDB.

Emit framework's dSYM bundle as LLDB.framework.dSYM instead of LLDB.dSYM, 
because the latter could conflict with the driver's lldb.dSYM when emitted in 
the same directory on case-insensitive file systems.
Requires https://reviews.llvm.org/D60862


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D60863

Files:
  lldb/source/API/CMakeLists.txt


Index: lldb/source/API/CMakeLists.txt
===
--- lldb/source/API/CMakeLists.txt
+++ lldb/source/API/CMakeLists.txt
@@ -9,6 +9,10 @@
   set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
 endif()
 
+if(LLDB_BUILD_FRAMEWORK AND LLVM_EXTERNALIZE_DEBUGINFO)
+  set(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION framework.dSYM)
+endif()
+
 add_lldb_library(liblldb SHARED
   SBAddress.cpp
   SBAttachInfo.cpp


Index: lldb/source/API/CMakeLists.txt
===
--- lldb/source/API/CMakeLists.txt
+++ lldb/source/API/CMakeLists.txt
@@ -9,6 +9,10 @@
   set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
 endif()
 
+if(LLDB_BUILD_FRAMEWORK AND LLVM_EXTERNALIZE_DEBUGINFO)
+  set(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION framework.dSYM)
+endif()
+
 add_lldb_library(liblldb SHARED
   SBAddress.cpp
   SBAttachInfo.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r358660 - [lldb] [test] Mark three more tests flakey/xfail on NetBSD

2019-04-18 Thread Michal Gorny via lldb-commits
Author: mgorny
Date: Thu Apr 18 05:31:48 2019
New Revision: 358660

URL: http://llvm.org/viewvc/llvm-project?rev=358660&view=rev
Log:
[lldb] [test] Mark three more tests flakey/xfail on NetBSD

Modified:

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

lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py

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

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py?rev=358660&r1=358659&r2=358660&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/tools/lldb-vscode/launch/TestVSCode_launch.py
 Thu Apr 18 05:31:48 2019
@@ -61,6 +61,7 @@ class TestVSCode_launch(lldbvscode_testc
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
+@expectedFailureNetBSD
 @no_debug_info_test
 def test_cwd(self):
 '''
@@ -89,6 +90,7 @@ class TestVSCode_launch(lldbvscode_testc
 
 @skipIfWindows
 @skipIfDarwin # Skip this test for now until we can figure out why tings 
aren't working on build bots
+@expectedFailureNetBSD
 @no_debug_info_test
 def test_debuggerRoot(self):
 '''


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


[Lldb-commits] [PATCH] D60829: FuncUnwinders: remove "current_offset" from function arguments

2019-04-18 Thread Pavel Labath via Phabricator via lldb-commits
labath added a comment.

Sure, that's no problem. Thanks for letting me know.

BTW, I have a couple more patches in the general unwinding area (part of the 
breakpad unwinding thing), but I still need to clean those up before they can 
be put up for review.


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

https://reviews.llvm.org/D60829



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


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

2019-04-18 Thread Frederic Riss via Phabricator via lldb-commits
friss accepted this revision.
friss added a comment.
This revision is now accepted and ready to land.

LGTM


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60862



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


[Lldb-commits] [PATCH] D60405: MinidumpYAML: Add support for ModuleList stream

2019-04-18 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
labath marked 4 inline comments as done.
Closed by commit rL358672: MinidumpYAML: Add support for ModuleList stream 
(authored by labath, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D60405?vs=194130&id=195743#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D60405

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

Index: llvm/trunk/include/llvm/BinaryFormat/Minidump.h
===
--- llvm/trunk/include/llvm/BinaryFormat/Minidump.h
+++ llvm/trunk/include/llvm/BinaryFormat/Minidump.h
@@ -141,6 +141,10 @@
 };
 static_assert(sizeof(VSFixedFileInfo) == 52, "");
 
+inline bool operator==(const VSFixedFileInfo &LHS, const VSFixedFileInfo &RHS) {
+  return memcmp(&LHS, &RHS, sizeof(VSFixedFileInfo)) == 0;
+}
+
 struct Module {
   support::ulittle64_t BaseOfImage;
   support::ulittle32_t SizeOfImage;
Index: llvm/trunk/include/llvm/Object/Minidump.h
===
--- llvm/trunk/include/llvm/Object/Minidump.h
+++ llvm/trunk/include/llvm/Object/Minidump.h
@@ -43,6 +43,13 @@
   /// file does not contain a stream of this type.
   Optional> getRawStream(minidump::StreamType Type) const;
 
+  /// Returns the raw contents of an object given by the LocationDescriptor. An
+  /// error is returned if the descriptor points outside of the minidump file.
+  Expected>
+  getRawData(minidump::LocationDescriptor Desc) const {
+return getDataSlice(getData(), Desc.RVA, Desc.DataSize);
+  }
+
   /// Returns the minidump string at the given offset. An error is returned if
   /// we fail to parse the string, or the string is invalid UTF16.
   Expected getString(size_t Offset) const;
Index: llvm/trunk/include/llvm/ObjectYAML/MinidumpYAML.h
===
--- llvm/trunk/include/llvm/ObjectYAML/MinidumpYAML.h
+++ llvm/trunk/include/llvm/ObjectYAML/MinidumpYAML.h
@@ -26,6 +26,7 @@
 /// from Types to Kinds is fixed and given by the static getKind function.
 struct Stream {
   enum class StreamKind {
+ModuleList,
 RawContent,
 SystemInfo,
 TextContent,
@@ -49,6 +50,30 @@
  const object::MinidumpFile &File);
 };
 
+/// A stream representing the list of modules loaded in the process. On disk, it
+/// is represented as a sequence of minidump::Module structures. These contain
+/// pointers to other data structures, like the module's name and CodeView
+/// record. In memory, we represent these as the ParsedModule struct, which
+/// groups minidump::Module with all of its dependant structures in a single
+/// entity.
+struct ModuleListStream : public Stream {
+  struct ParsedModule {
+minidump::Module Module;
+std::string Name;
+yaml::BinaryRef CvRecord;
+yaml::BinaryRef MiscRecord;
+  };
+  std::vector Modules;
+
+  ModuleListStream(std::vector Modules = {})
+  : Stream(StreamKind::ModuleList, minidump::StreamType::ModuleList),
+Modules(std::move(Modules)) {}
+
+  static bool classof(const Stream *S) {
+return S->Kind == StreamKind::ModuleList;
+  }
+};
+
 /// A minidump stream represented as a sequence of hex bytes. This is used as a
 /// fallback when no other stream kind is suitable.
 struct RawContentStream : public Stream {
@@ -162,8 +187,12 @@
 LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::minidump::CPUInfo::ArmInfo)
 LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::minidump::CPUInfo::OtherInfo)
 LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::minidump::CPUInfo::X86Info)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::minidump::VSFixedFileInfo)
+LLVM_YAML_DECLARE_MAPPING_TRAITS(
+llvm::MinidumpYAML::ModuleListStream::ParsedModule)
 
 LLVM_YAML_IS_SEQUENCE_VECTOR(std::unique_ptr)
+LLVM_YAML_IS_SEQUENCE_VECTOR(llvm::MinidumpYAML::ModuleListStream::ParsedModule)
 
 LLVM_YAML_DECLARE_MAPPING_TRAITS(llvm::MinidumpYAML::Object)
 
Index: llvm/trunk/test/tools/obj2yaml/basic-minidump.yaml
===
--- llvm/trunk/test/tools/obj2yaml/basic-minidump.yaml
+++ llvm/trunk/test/tools/obj2yaml/basic-minidump.yaml
@@ -15,6 +15,33 @@
   400d9000-400db000 r-xp  b3:04 227/system/bin/app_process
   400db000-400dc000 r--p 1000 b3:04 227/system/bin/app_process
 
+  - Type:ModuleList
+Modules: 
+  - Base of Image:   0x0001020304050607
+Size of Image:   0x08090A0B
+Checksum:0x0C0D0E0F
+Time Date Stamp: 47
+Module Name: a.out
+Version Info:
+  Signature:   0x10111213
+  Struct Version:  0x14151617
+  File Versi

[Lldb-commits] [PATCH] D60817: [NativePDB] Add anonymous namespaces support

2019-04-18 Thread Pavel Labath via Phabricator via lldb-commits
labath added a reviewer: amccarth.
labath added a comment.

Don't know much about PDBs, but the change seems pretty straight-forward to me. 
Zach would be the best person to review this, but he's probably busy with other 
things now. Maybe Adrian could take a look?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60817



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


[Lldb-commits] [PATCH] D60405: MinidumpYAML: Add support for ModuleList stream

2019-04-18 Thread Pavel Labath via Phabricator via lldb-commits
labath added inline comments.



Comment at: lib/ObjectYAML/MinidumpYAML.cpp:21
+/// methods, while the final minidump file is written by calling the writeTo
+/// method. The plan versions of allocation functions take a reference to the
+/// data which is to be written (and hence the data must be available until

jhenderson wrote:
> plan -> plain (?)
yep. thanks.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D60405



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


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

2019-04-18 Thread Frederic Riss via Phabricator via lldb-commits
friss requested changes to this revision.
friss added a comment.
This revision now requires changes to proceed.

Actually, thinking more about this, how do you use it? 
LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION is a global but this would be different 
per target.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60862



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


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

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

In D60862#1471755 , @friss wrote:

> Actually, thinking more about this, how do you use it? 
> LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION is a global but this would be different 
> per target.


It can be set in the scope of the `add_lldb_library` call as in the matching 
LLDB patch https://reviews.llvm.org/D60863


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60862



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


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

2019-04-18 Thread Frederic Riss via Phabricator via lldb-commits
friss accepted this revision.
friss added a comment.
This revision is now accepted and ready to land.

Interesting. Cmake scoping rules are still a mystery to me. So when you 
`set(FOO ...), it's set only for the current scope and in any functions/macros 
you call in that scope? Then this seems like an ok solution.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60862



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


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

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

Yes, scopes are per directory; macros operate on the caller's scope and 
functions add one.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D60862



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


[Lldb-commits] [lldb] r358686 - [CMake] Emit LLDB.framework.dSYM to avoid potential name collision with driver's lldb.dSYM

2019-04-18 Thread Stefan Granitz via lldb-commits
Author: stefan.graenitz
Date: Thu Apr 18 09:37:22 2019
New Revision: 358686

URL: http://llvm.org/viewvc/llvm-project?rev=358686&view=rev
Log:
[CMake] Emit LLDB.framework.dSYM to avoid potential name collision with 
driver's lldb.dSYM

Summary:
Emit framework's dSYM bundle as LLDB.framework.dSYM instead of LLDB.dSYM, 
because the latter could conflict with the driver's lldb.dSYM when emitted in 
the same directory on case-insensitive file systems.
Requires https://reviews.llvm.org/D60862

Reviewers: friss, beanz, bogner

Subscribers: mgorny, lldb-commits, #lldb

Tags: #lldb

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

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

Modified: lldb/trunk/source/API/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/CMakeLists.txt?rev=358686&r1=358685&r2=358686&view=diff
==
--- lldb/trunk/source/API/CMakeLists.txt (original)
+++ lldb/trunk/source/API/CMakeLists.txt Thu Apr 18 09:37:22 2019
@@ -9,6 +9,10 @@ if(NOT LLDB_DISABLE_PYTHON)
   set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
 endif()
 
+if(LLDB_BUILD_FRAMEWORK AND LLVM_EXTERNALIZE_DEBUGINFO)
+  set(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION framework.dSYM)
+endif()
+
 add_lldb_library(liblldb SHARED
   SBAddress.cpp
   SBAttachInfo.cpp


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


[Lldb-commits] [PATCH] D60863: [CMake] Emit LLDB.framework.dSYM to avoid potential name collision with driver's lldb.dSYM

2019-04-18 Thread Phabricator via Phabricator via lldb-commits
This revision was not accepted when it landed; it landed in state "Needs 
Review".
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB358686: [CMake] Emit LLDB.framework.dSYM to avoid 
potential name collision with… (authored by stefan.graenitz, committed by ).
Herald added a subscriber: abidh.

Changed prior to commit:
  https://reviews.llvm.org/D60863?vs=195713&id=195766#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60863

Files:
  source/API/CMakeLists.txt


Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -9,6 +9,10 @@
   set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
 endif()
 
+if(LLDB_BUILD_FRAMEWORK AND LLVM_EXTERNALIZE_DEBUGINFO)
+  set(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION framework.dSYM)
+endif()
+
 add_lldb_library(liblldb SHARED
   SBAddress.cpp
   SBAttachInfo.cpp


Index: source/API/CMakeLists.txt
===
--- source/API/CMakeLists.txt
+++ source/API/CMakeLists.txt
@@ -9,6 +9,10 @@
   set(lldb_python_wrapper ${lldb_scripts_dir}/LLDBWrapPython.cpp)
 endif()
 
+if(LLDB_BUILD_FRAMEWORK AND LLVM_EXTERNALIZE_DEBUGINFO)
+  set(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION framework.dSYM)
+endif()
+
 add_lldb_library(liblldb SHARED
   SBAddress.cpp
   SBAttachInfo.cpp
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D60862: [CMake] Allow custom extensions for externalized debug info

2019-04-18 Thread Phabricator via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL358685: [CMake] Allow custom extensions for externalized 
debug info (authored by stefan.graenitz, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D60862?vs=195712&id=195765#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D60862

Files:
  llvm/trunk/cmake/modules/AddLLVM.cmake


Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1604,14 +1604,21 @@
 endif()
   endif()
 
-  if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
-if(APPLE)
-  set(output_name "$.dSYM")
+  if(APPLE)
+if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
+  set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
+else()
+  set(file_ext dSYM)
+endif()
+
+set(output_name "$.${file_ext}")
+
+if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
   set(output_path 
"-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
+else()
+  set(output_path "-o=${output_name}")
 endif()
-  endif()
 
-  if(APPLE)
 if(CMAKE_CXX_FLAGS MATCHES "-flto"
   OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
 


Index: llvm/trunk/cmake/modules/AddLLVM.cmake
===
--- llvm/trunk/cmake/modules/AddLLVM.cmake
+++ llvm/trunk/cmake/modules/AddLLVM.cmake
@@ -1604,14 +1604,21 @@
 endif()
   endif()
 
-  if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
-if(APPLE)
-  set(output_name "$.dSYM")
+  if(APPLE)
+if(LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION)
+  set(file_ext ${LLVM_EXTERNALIZE_DEBUGINFO_EXTENSION})
+else()
+  set(file_ext dSYM)
+endif()
+
+set(output_name "$.${file_ext}")
+
+if(LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR)
   set(output_path "-o=${LLVM_EXTERNALIZE_DEBUGINFO_OUTPUT_DIR}/${output_name}")
+else()
+  set(output_path "-o=${output_name}")
 endif()
-  endif()
 
-  if(APPLE)
 if(CMAKE_CXX_FLAGS MATCHES "-flto"
   OR CMAKE_CXX_FLAGS_${uppercase_CMAKE_BUILD_TYPE} MATCHES "-flto")
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D60863: [CMake] Emit LLDB.framework.dSYM to avoid potential name collision with driver's lldb.dSYM

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

This was mostly to illustrate usage of the matching LLVM commit. Unlikely to 
break something. Post-commit review should be sufficient.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60863



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


[Lldb-commits] [lldb] r358693 - [Docs] Add LLDB bots

2019-04-18 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Thu Apr 18 10:31:20 2019
New Revision: 358693

URL: http://llvm.org/viewvc/llvm-project?rev=358693&view=rev
Log:
[Docs] Add LLDB bots

Added:
lldb/trunk/docs/resources/bots.rst
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=358693&r1=358692&r2=358693&view=diff
==
--- lldb/trunk/docs/index.rst (original)
+++ lldb/trunk/docs/index.rst Thu Apr 18 10:31:20 2019
@@ -54,6 +54,7 @@ Resources
resources/build
resources/source
resources/test
+   resources/bots
resources/sbapi
resources/external
 

Added: lldb/trunk/docs/resources/bots.rst
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/docs/resources/bots.rst?rev=358693&view=auto
==
--- lldb/trunk/docs/resources/bots.rst (added)
+++ lldb/trunk/docs/resources/bots.rst Thu Apr 18 10:31:20 2019
@@ -0,0 +1,20 @@
+Continuous Integration
+==
+
+Buildbot
+
+
+* `lldb-amd64-ninja-freebsd11 
`_
+* `lldb-x64-windows-ninja 
`_
+* `lldb-x86_64-debian `_
+* `lldb-x86_64-fedora `_
+
+GreenDragon
+---
+
+* `lldb-cmake `_
+* `lldb-cmake-matrix 
`_
+* `lldb-cmake-python3 
`_
+* `lldb-cmake-standalone 
`_
+* `lldb-sanitized 
`_
+* `lldb-xcode `_


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


[Lldb-commits] [lldb] r358696 - [CodeComplete] Remove obsolete isOutputBinary().

2019-04-18 Thread Sam McCall via lldb-commits
Author: sammccall
Date: Thu Apr 18 10:35:55 2019
New Revision: 358696

URL: http://llvm.org/viewvc/llvm-project?rev=358696&view=rev
Log:
[CodeComplete] Remove obsolete isOutputBinary().

Summary:
It's never set to true. Its only effect would be to set stdout to binary mode.
Hopefully we have better ways of doing this by now :-)

Reviewers: hokein

Subscribers: jkorous, arphaman, kadircet, llvm-commits

Tags: #llvm

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

Modified:
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp?rev=358696&r1=358695&r2=358696&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Thu Apr 18 10:35:55 2019
@@ -703,7 +703,7 @@ public:
   ///
   CodeComplete(CompletionRequest &request, clang::LangOptions ops,
std::string expr, unsigned position)
-  : CodeCompleteConsumer(CodeCompleteOptions(), false),
+  : CodeCompleteConsumer(CodeCompleteOptions()),
 m_info(std::make_shared()), 
m_expr(expr),
 m_position(position), m_request(request), m_desc_policy(ops) {
 


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


[Lldb-commits] [PATCH] D60871: [CodeComplete] Remove obsolete isOutputBinary().

2019-04-18 Thread Sam McCall via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB358696: [CodeComplete] Remove obsolete isOutputBinary(). 
(authored by sammccall, committed by ).
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Changed prior to commit:
  https://reviews.llvm.org/D60871?vs=195740&id=195782#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60871

Files:
  source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp


Index: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -703,7 +703,7 @@
   ///
   CodeComplete(CompletionRequest &request, clang::LangOptions ops,
std::string expr, unsigned position)
-  : CodeCompleteConsumer(CodeCompleteOptions(), false),
+  : CodeCompleteConsumer(CodeCompleteOptions()),
 m_info(std::make_shared()), 
m_expr(expr),
 m_position(position), m_request(request), m_desc_policy(ops) {
 


Index: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -703,7 +703,7 @@
   ///
   CodeComplete(CompletionRequest &request, clang::LangOptions ops,
std::string expr, unsigned position)
-  : CodeCompleteConsumer(CodeCompleteOptions(), false),
+  : CodeCompleteConsumer(CodeCompleteOptions()),
 m_info(std::make_shared()), m_expr(expr),
 m_position(position), m_request(request), m_desc_policy(ops) {
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D60817: [NativePDB] Add anonymous namespaces support

2019-04-18 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth added a comment.

Sorry for the slow response; I'm still learning about this code.

I like where this is going.




Comment at: lit/SymbolFile/NativePDB/ast-types.cpp:77
+// FIXME: Should be located in the namespace `A`, in the struct `C<1>`.
+A::C<1>::D AC1D;
+

Is this a new problem because of your change?  Or is this an already existing 
problem you discovered in the process?  Is the cause understood?  Should you 
add a commented-out CHECK showing what the test would be when this problem is 
fixed?



Comment at: source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:575
 std::string ns = name_components.front()->toString();
-context = m_clang.GetUniqueNamespaceDeclaration(ns.c_str(), context);
+context = GetOrCreateNamespaceDecl(ns.c_str(), *context);
 name_components = name_components.drop_front();

Again, I think you should drop the `.c_str()`.



Comment at: source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:812
 clang::NamespaceDecl *
 PdbAstBuilder::GetOrCreateNamespaceDecl(llvm::StringRef name,
 clang::DeclContext &context) {

Normally, I would agree that `StringRef` is the right type for `name`, but 
looking at the three call sites, it seems that this is going to cause a lot of 
unnecessary conversions.

The call sites are all passing std::string::c_str(), which is a `const char *`. 
 So we're constructing a `StringRef` `name` (which involves a `strlen`).  The 
`name` is then passed on as `name.str().c_str()` which constructs a new 
`std::string` only to pass a `const char *` again.

I'd argue that, in this case, we're better off declaring `name` as a `const 
char *`.



Comment at: source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:813
 PdbAstBuilder::GetOrCreateNamespaceDecl(llvm::StringRef name,
 clang::DeclContext &context) {
+  return m_clang.GetUniqueNamespaceDeclaration(

I'd also recommend making `GetOrCreateNamespaceDecl` private, since the only 
callers are here in `PdbAstBuilder.cpp`.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60817



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


[Lldb-commits] [PATCH] D60817: [NativePDB] Add anonymous namespaces support

2019-04-18 Thread Adrian McCarthy via Phabricator via lldb-commits
amccarth marked an inline comment as done.
amccarth added inline comments.



Comment at: source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp:575
 std::string ns = name_components.front()->toString();
-context = m_clang.GetUniqueNamespaceDeclaration(ns.c_str(), context);
+context = GetOrCreateNamespaceDecl(ns.c_str(), *context);
 name_components = name_components.drop_front();

amccarth wrote:
> Again, I think you should drop the `.c_str()`.
Disregard this comment.  I was going to make a different suggestion and this 
was a leftover part of that.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D60817



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


[Lldb-commits] [lldb] r358717 - [crashlog] Strip trailing `\n` from check_output return.

2019-04-18 Thread Davide Italiano via lldb-commits
Author: davide
Date: Thu Apr 18 14:32:36 2019
New Revision: 358717

URL: http://llvm.org/viewvc/llvm-project?rev=358717&view=rev
Log:
[crashlog] Strip trailing `\n` from check_output return.

Generally having spurious `\n` doesn't matter, but here the
returning string is a command which is executed, so  we want
to strip it. Pointed out by Jason.

Modified:
lldb/trunk/examples/python/crashlog.py

Modified: lldb/trunk/examples/python/crashlog.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/crashlog.py?rev=358717&r1=358716&r2=358717&view=diff
==
--- lldb/trunk/examples/python/crashlog.py (original)
+++ lldb/trunk/examples/python/crashlog.py Thu Apr 18 14:32:36 2019
@@ -225,7 +225,7 @@ class CrashLog(symbolication.Symbolicato
 if not os.path.exists(dsymForUUIDBinary):
 try:
 dsymForUUIDBinary = subprocess.check_output('which 
dsymForUUID',
-shell=True)
+
shell=True).rstrip('\n')
 except:
 dsymForUUIDBinary = ""
 


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


[Lldb-commits] [lldb] r358721 - [Python] Simplify the code. NFCI.

2019-04-18 Thread Davide Italiano via lldb-commits
Author: davide
Date: Thu Apr 18 16:24:54 2019
New Revision: 358721

URL: http://llvm.org/viewvc/llvm-project?rev=358721&view=rev
Log:
[Python] Simplify the code. NFCI.

Modified:
lldb/trunk/examples/python/memory.py
lldb/trunk/examples/python/performance.py
lldb/trunk/examples/python/process_events.py
lldb/trunk/examples/python/types.py

Modified: lldb/trunk/examples/python/memory.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/memory.py?rev=358721&r1=358720&r2=358721&view=diff
==
--- lldb/trunk/examples/python/memory.py (original)
+++ lldb/trunk/examples/python/memory.py Thu Apr 18 16:24:54 2019
@@ -15,11 +15,7 @@ import platform
 import os
 import re
 import sys
-
-if sys.version_info.major == 2:
-import commands as subprocess
-else:
-import subprocess
+import subprocess
 
 try:
 # Just try for LLDB in case PYTHONPATH is already correctly setup
@@ -30,7 +26,7 @@ except ImportError:
 platform_system = platform.system()
 if platform_system == 'Darwin':
 # On Darwin, try the currently selected Xcode directory
-xcode_dir = subprocess.getoutput("xcode-select --print-path")
+xcode_dir = subprocess.check_output("xcode-select --print-path", 
shell=True)
 if xcode_dir:
 lldb_python_dirs.append(
 os.path.realpath(

Modified: lldb/trunk/examples/python/performance.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/performance.py?rev=358721&r1=358720&r2=358721&view=diff
==
--- lldb/trunk/examples/python/performance.py (original)
+++ lldb/trunk/examples/python/performance.py Thu Apr 18 16:24:54 2019
@@ -16,14 +16,10 @@ import platform
 import re
 import resource
 import sys
+import subprocess
 import time
 import types
 
-if sys.version_info.major == 2:
-import commands as subprocess
-else:
-import subprocess
-
 #--
 # Code that auto imports LLDB
 #--
@@ -36,7 +32,7 @@ except ImportError:
 platform_system = platform.system()
 if platform_system == 'Darwin':
 # On Darwin, try the currently selected Xcode directory
-xcode_dir = subprocess.getoutput("xcode-select --print-path")
+xcode_dir = subprocess.check_output("xcode-select --print-path", 
shell=True)
 if xcode_dir:
 lldb_python_dirs.append(
 os.path.realpath(

Modified: lldb/trunk/examples/python/process_events.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/process_events.py?rev=358721&r1=358720&r2=358721&view=diff
==
--- lldb/trunk/examples/python/process_events.py (original)
+++ lldb/trunk/examples/python/process_events.py Thu Apr 18 16:24:54 2019
@@ -14,11 +14,7 @@ import optparse
 import os
 import platform
 import sys
-
-if sys.version_info.major == 2:
-import commands as subprocess
-else:
-import subprocess
+import subprocess
 
 #--
 # Code that auto imports LLDB
@@ -32,7 +28,7 @@ except ImportError:
 platform_system = platform.system()
 if platform_system == 'Darwin':
 # On Darwin, try the currently selected Xcode directory
-xcode_dir = subprocess.getoutput("xcode-select --print-path")
+xcode_dir = subprocess.check_output("xcode-select --print-path", 
shell=True)
 if xcode_dir:
 lldb_python_dirs.append(
 os.path.realpath(

Modified: lldb/trunk/examples/python/types.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/examples/python/types.py?rev=358721&r1=358720&r2=358721&view=diff
==
--- lldb/trunk/examples/python/types.py (original)
+++ lldb/trunk/examples/python/types.py Thu Apr 18 16:24:54 2019
@@ -16,11 +16,7 @@ import os
 import re
 import signal
 import sys
-
-if sys.version_info.major == 2:
-import commands as subprocess
-else:
-import subprocess
+import subprocess
 
 try:
 # Just try for LLDB in case PYTHONPATH is already correctly setup
@@ -31,7 +27,7 @@ except ImportError:
 platform_system = platform.system()
 if platform_system == 'Darwin':
 # On Darwin, try the currently selected Xcode directory
-xcode_dir = subprocess.getoutput("xcode-select --print-path")
+xcode_dir = subprocess.check_output("xcode-select --print-path", 
shell=True)
 if xcode_dir:
 lldb_python_dirs.append(
 os.path.realpath(


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

[Lldb-commits] [PATCH] D60817: [NativePDB] Add anonymous namespaces support

2019-04-18 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov marked an inline comment as done.
aleksandr.urakov added inline comments.



Comment at: lit/SymbolFile/NativePDB/ast-types.cpp:77
+// FIXME: Should be located in the namespace `A`, in the struct `C<1>`.
+A::C<1>::D AC1D;
+

amccarth wrote:
> Is this a new problem because of your change?  Or is this an already existing 
> problem you discovered in the process?  Is the cause understood?  Should you 
> add a commented-out CHECK showing what the test would be when this problem is 
> fixed?
It's an existing problem, but I didn't go deep into it yet. I've added the test 
lines describing how it should be, thanks.


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

https://reviews.llvm.org/D60817



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


[Lldb-commits] [PATCH] D60817: [NativePDB] Add anonymous namespaces support

2019-04-18 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov updated this revision to Diff 195863.
aleksandr.urakov added a comment.

Thank you for the comments, I agree with you. I've fixed the patch.


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

https://reviews.llvm.org/D60817

Files:
  lit/SymbolFile/NativePDB/Inputs/ast-types.lldbinit
  lit/SymbolFile/NativePDB/ast-types.cpp
  lit/SymbolFile/NativePDB/typedefs.cpp
  lit/SymbolFile/PDB/ast-restore.test
  source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
  source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h

Index: source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
===
--- source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
+++ source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.h
@@ -59,8 +59,6 @@
   clang::DeclContext *GetOrCreateDeclContextForUid(PdbSymUid uid);
   clang::DeclContext *GetParentDeclContext(PdbSymUid uid);
 
-  clang::NamespaceDecl *GetOrCreateNamespaceDecl(llvm::StringRef name,
- clang::DeclContext &context);
   clang::FunctionDecl *GetOrCreateFunctionDecl(PdbCompilandSymId func_id);
   clang::BlockDecl *GetOrCreateBlockDecl(PdbCompilandSymId block_id);
   clang::VarDecl *GetOrCreateVariableDecl(PdbCompilandSymId scope_id,
@@ -114,6 +112,9 @@
   clang::DeclContext *
   GetParentDeclContextForSymbol(const llvm::codeview::CVSymbol &sym);
 
+  clang::NamespaceDecl *GetOrCreateNamespaceDecl(const char *name,
+ clang::DeclContext &context);
+
   void ParseAllNamespacesPlusChildrenOf(llvm::Optional parent);
   void ParseDeclsForSimpleContext(clang::DeclContext &context);
   void ParseBlockChildren(PdbCompilandSymId block_id);
Index: source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
===
--- source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
+++ source/Plugins/SymbolFile/NativePDB/PdbAstBuilder.cpp
@@ -205,6 +205,10 @@
   return std::move(child);
 }
 
+static bool IsAnonymousNamespaceName(llvm::StringRef name) {
+  return name == "`anonymous namespace'" || name == "`anonymous-namespace'";
+}
+
 PdbAstBuilder::PdbAstBuilder(ObjectFile &obj, PdbIndex &index)
 : m_index(index), m_clang(GetClangASTContext(obj)) {
   BuildParentMap();
@@ -256,7 +260,7 @@
 for (llvm::ms_demangle::Node *scope : scopes) {
   auto *nii = static_cast(scope);
   std::string str = nii->toString();
-  context = m_clang.GetUniqueNamespaceDeclaration(str.c_str(), context);
+  context = GetOrCreateNamespaceDecl(str.c_str(), *context);
 }
 return {context, uname};
   }
@@ -525,7 +529,7 @@
   // If that fails, treat it as a series of namespaces.
   for (const MSVCUndecoratedNameSpecifier &spec : specs) {
 std::string ns_name = spec.GetBaseName().str();
-context = m_clang.GetUniqueNamespaceDeclaration(ns_name.c_str(), context);
+context = GetOrCreateNamespaceDecl(ns_name.c_str(), *context);
   }
   return {context, uname};
 }
@@ -568,7 +572,7 @@
   clang::DeclContext *context = &GetTranslationUnitDecl();
   while (!name_components.empty()) {
 std::string ns = name_components.front()->toString();
-context = m_clang.GetUniqueNamespaceDeclaration(ns.c_str(), context);
+context = GetOrCreateNamespaceDecl(ns.c_str(), *context);
 name_components = name_components.drop_front();
   }
   return context;
@@ -805,9 +809,10 @@
 }
 
 clang::NamespaceDecl *
-PdbAstBuilder::GetOrCreateNamespaceDecl(llvm::StringRef name,
+PdbAstBuilder::GetOrCreateNamespaceDecl(const char *name,
 clang::DeclContext &context) {
-  return m_clang.GetUniqueNamespaceDeclaration(name.str().c_str(), &context);
+  return m_clang.GetUniqueNamespaceDeclaration(
+  IsAnonymousNamespaceName(name) ? nullptr : name, &context);
 }
 
 clang::BlockDecl *
Index: lit/SymbolFile/PDB/ast-restore.test
===
--- lit/SymbolFile/PDB/ast-restore.test
+++ lit/SymbolFile/PDB/ast-restore.test
@@ -1,6 +1,7 @@
 REQUIRES: system-windows, msvc
 RUN: %build --compiler=msvc --nodefaultlib --output=%t.exe %S/Inputs/AstRestoreTest.cpp
-RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=ENUM %s
+RUN: env LLDB_USE_NATIVE_PDB_READER=0 lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=ENUM %s
+RUN: env LLDB_USE_NATIVE_PDB_READER=1 lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=ENUM %s
 RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=GLOBAL %s
 RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=BASE %s
 RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=CLASS %s
Index: lit/SymbolFile/NativePDB/typedefs.cpp
===
--- lit/SymbolFile/NativePDB/typedefs.cpp
+++ lit/SymbolFile/NativePDB/typedefs.cpp
@@ -54,7 +54,7 @@
 }
 
 
-// CHEC