[Lldb-commits] [lldb] r346213 - [PDB] Introduce `MSVCUndecoratedNameParser`

2018-11-06 Thread Aleksandr Urakov via lldb-commits
Author: aleksandr.urakov
Date: Tue Nov  6 00:02:55 2018
New Revision: 346213

URL: http://llvm.org/viewvc/llvm-project?rev=346213&view=rev
Log:
[PDB] Introduce `MSVCUndecoratedNameParser`

This patch introduces the simple MSVCUndecoratedNameParser. It is needed for
parsing names of PDB symbols corresponding to template instantiations. For
example, for the name `operator<'::`2'::B::operator> we can't just split the
name with :: (as it is implemented for now) to retrieve its scopes. This parser
processes such names in a more correct way.

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

Added:
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.h
Modified:
lldb/trunk/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp
lldb/trunk/lit/SymbolFile/PDB/ast-restore.test
lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/PDBASTParser.h
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.cpp
lldb/trunk/source/Plugins/SymbolFile/PDB/SymbolFilePDB.h
lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Modified: lldb/trunk/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp?rev=346213&r1=346212&r2=346213&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp (original)
+++ lldb/trunk/lit/SymbolFile/PDB/Inputs/AstRestoreTest.cpp Tue Nov  6 00:02:55 
2018
@@ -36,7 +36,15 @@ private:
 };
 int Class::ClassStatic = 7;
 
-void foo() { Class::StaticFunc(Class(Enum_0)); }
+template
+struct Template {
+  template
+  void TemplateFunc() {
+T::StaticFunc(T(E));
+  }
+};
+
+void foo() { Template().TemplateFunc(); }
 
 } // namespace N1
 } // namespace N0

Modified: lldb/trunk/lit/SymbolFile/PDB/ast-restore.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/SymbolFile/PDB/ast-restore.test?rev=346213&r1=346212&r2=346213&view=diff
==
--- lldb/trunk/lit/SymbolFile/PDB/ast-restore.test (original)
+++ lldb/trunk/lit/SymbolFile/PDB/ast-restore.test Tue Nov  6 00:02:55 2018
@@ -6,6 +6,7 @@ RUN: lldb-test symbols -dump-ast %t.exe
 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
 RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=INNER %s
+RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=TEMPLATE %s
 RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=FOO %s
 RUN: lldb-test symbols -dump-ast %t.exe | FileCheck --check-prefix=MAIN %s
 
@@ -66,6 +67,11 @@ INNER: };
 INNER: }
 INNER: }
 
+TEMPLATE: Module: {{.*}}
+TEMPLATE: struct Template {
+TEMPLATE: inline void TemplateFunc<1>();
+TEMPLATE: };
+
 FOO: Module: {{.*}}
 FOO: namespace N0 {
 FOO: namespace N1 {

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt?rev=346213&r1=346212&r2=346213&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt (original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CMakeLists.txt Tue Nov  6 
00:02:55 2018
@@ -18,6 +18,7 @@ add_lldb_library(lldbPluginCPlusPlusLang
   LibStdcpp.cpp
   LibStdcppTuple.cpp
   LibStdcppUniquePointer.cpp
+  MSVCUndecoratedNameParser.cpp
 
   LINK_LIBS
 lldbCore

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=346213&r1=346212&r2=346213&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Tue Nov  
6 00:02:55 2018
@@ -41,6 +41,7 @@
 #include "LibCxxAtomic.h"
 #include "LibCxxVariant.h"
 #include "LibStdcpp.h"
+#include "MSVCUndecoratedNameParser.h"
 
 using namespace lldb;
 using namespace lldb_private;
@@ -265,6 +266,10 @@ bool CPlusPlusLanguage::IsCPPMangledName
 
 bool CPlusPlusLanguage::ExtractContextAndIdentifier(
 const char *name, llvm::StringRef &context, llvm::StringRef &identifier) {
+  if (MSVCUndecoratedNameParser::IsMSVCUndecoratedName(name))
+return MSVCUndecoratedNameParser::ExtractContextAndIdentifier(name, 
context,
+  identifier);
+

[Lldb-commits] [PATCH] D53368: [Symbol] Search symbols with name and type in a symbol file

2018-11-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov added a comment.

Yes, sure. It happens in the following functions:

- `Module::ResolveSymbolContextForAddress`
- `DynamicLoaderHexagonDYLD::SetRendezvousBreakpoint` through 
`findSymbolAddress`
- `DynamicLoaderHexagonDYLD::RendezvousBreakpointHit` through 
`findSymbolAddress`
- `JITLoaderGDB::ReadJITDescriptorImpl`
- `ObjectFileELF::GetAddressClass`
- `ObjectFileELF::GetSymtab`
- `ObjectFileELF::RelocateSection`
- `ObjectFileELF::Dump`
- `ObjectFileMachO::GetAddressClass`
- `ObjectFileMachO::ProcessSegmentCommand`
- `SymbolFileDWARF::GetObjCClassSymbol`
- `SymbolFileDWARF::ParseVariableDIE`
- `SymbolFileDWARFDebugMap::CompileUnitInfo::GetFileRangeMap`
- `SymbolFileDWARFDebugMap::InitOSO`
- `SymbolFileDWARFDebugMap::ResolveSymbolContext`
- `SymbolFileDWARFDebugMap::FindCompleteObjCDefinitionTypeForDIE`
- `SymbolFileSymtab::CalculateAbilities`
- `SymbolFileSymtab::ParseCompileUnitAtIndex`
- `SymbolFileSymtab::ParseCompileUnitFunctions`
- `SymbolFileSymtab::ResolveSymbolContext`
- `ObjectFile::GetAddressClass`
- `SymbolVendor::GetSymtab()`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D53368



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


[Lldb-commits] [PATCH] D54053: [NativePDB] Add the ability to create clang record decls from mangled names.

2018-11-06 Thread Aleksandr Urakov via Phabricator via lldb-commits
aleksandr.urakov accepted this revision.
aleksandr.urakov added a comment.

In https://reviews.llvm.org/D54053#1286653, @zturner wrote:

> Bleh, I think I found a problem with this approach.  Since we assume 
> everything is a namespace, it can lead to ambiguities.  I think we need to 
> actually consult the debug info while parsing components of the mangled name.


Yes, it is what actually we have done in 
`PDBASTParser::GetDeclContextContainingSymbol`. Also I think that it is worth 
to remember if we already have created the class / function parent before, and 
do not create namespaces in this case. For example: 
`N0::N1::CClass::PrivateFunc::__l2::InnerFuncStruct`. We have here the 
`PrivateFunc` function and the `InnerFuncStruct` structure inside it. So we do 
not need to create the `__l2` namespace inside the `PrivateFunc` function 
(moreover, it is not possible to create a namespace inside a class / function).

There is a similar problem with global and static variables and functions. Are 
the mangled names presented for them? Can we solve it in the same way?

Anyway, I think that this patch is a great start!


https://reviews.llvm.org/D54053



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


[Lldb-commits] [lldb] r346220 - Add parens to silence warning

2018-11-06 Thread Benjamin Kramer via lldb-commits
Author: d0k
Date: Tue Nov  6 02:13:37 2018
New Revision: 346220

URL: http://llvm.org/viewvc/llvm-project?rev=346220&view=rev
Log:
Add parens to silence warning

MSVCUndecoratedNameParser.cpp:25:36: warning: '&&' within '||' 
[-Wlogical-op-parentheses]

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp

Modified: 
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp?rev=346220&r1=346219&r2=346220&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp 
Tue Nov  6 02:13:37 2018
@@ -22,7 +22,7 @@ MSVCUndecoratedNameParser::MSVCUndecorat
   // Do not treat `operator<' and `operator<<' as templates
   // (sometimes they represented as `<' and `<<' in the name).
   if (i == last_base_start ||
-  i == last_base_start + 1 && name[last_base_start] == '<')
+  (i == last_base_start + 1 && name[last_base_start] == '<'))
 break;
 
   stack.push(i);


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


[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution

2018-11-06 Thread Stefan Gränitz via Phabricator via lldb-commits
sgraenitz added inline comments.



Comment at: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp:337
+if (llvm::StringRef(First, Last - First).startswith(Search)) {
+  Result += llvm::StringRef(Written, First - Written);
+  Result += Replace;

shafik wrote:
> also `First - Written` is used twice but it is not obvious what the means, 
> naming it via a member function might be helpful.
`First` points to the first char of the input (`Mangled`).
`Written` points to the char of the input, up until we have constructed the 
respective output already.

Quite similar to the previous implementation. Difference is: it used a 
`std::back_insert_iterator`, but I wouldn't say that made it simpler. 
Intelligibility may benefit from comment as in the past:

```
// Write the unmatched part of the original. Then write the
// replacement string. Finally skip the search string in the original.
```

IMHO it's not a high prio.


https://reviews.llvm.org/D54074



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


[Lldb-commits] [PATCH] D53094: [pecoff] Implement ObjectFilePECOFF::GetDependedModules()

2018-11-06 Thread Aaron Smith via Phabricator via lldb-commits
asmith added a comment.

The ability to dump dependent modules is in another review that is waiting on 
this one.
https://reviews.llvm.org/D53096


https://reviews.llvm.org/D53094



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


[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution

2018-11-06 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 172764.
labath added a comment.

Thanks for the review. I have added some comments, and moved appending of the 
unmodified portion of the name into a separate function to aid readability.


https://reviews.llvm.org/D54074

Files:
  source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Index: unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
===
--- unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
+++ unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
@@ -184,4 +184,5 @@
   EXPECT_THAT(FindAlternate("_ZN1A1fEx"), Contains("_ZN1A1fEl"));
   EXPECT_THAT(FindAlternate("_ZN1A1fEy"), Contains("_ZN1A1fEm"));
   EXPECT_THAT(FindAlternate("_ZN1A1fEai"), Contains("_ZN1A1fEci"));
+  EXPECT_THAT(FindAlternate("_bogus"), IsEmpty());
 }
Index: source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -21,7 +21,7 @@
 
 // Other libraries and framework includes
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Demangle/Demangle.h"
+#include "llvm/Demangle/ItaniumDemangle.h"
 
 // Project includes
 #include "lldb/Core/PluginManager.h"
@@ -274,72 +274,89 @@
   return false;
 }
 
-/// Given a mangled function `mangled`, replace all the primitive function type
-/// arguments of `search` with type `replace`.
-static ConstString SubsPrimitiveParmItanium(llvm::StringRef mangled,
-llvm::StringRef search,
-llvm::StringRef replace) {
-  class PrimitiveParmSubs {
-llvm::StringRef mangled;
-llvm::StringRef search;
-llvm::StringRef replace;
-ptrdiff_t read_pos;
-std::string output;
-std::back_insert_iterator writer;
+namespace {
+class NodeAllocator {
+  llvm::BumpPtrAllocator Alloc;
 
-  public:
-PrimitiveParmSubs(llvm::StringRef m, llvm::StringRef s, llvm::StringRef r)
-: mangled(m), search(s), replace(r), read_pos(0),
-  writer(std::back_inserter(output)) {}
-
-void Substitute(llvm::StringRef tail) {
-  assert(tail.data() >= mangled.data() &&
- tail.data() < mangled.data() + mangled.size() &&
- "tail must point into range of mangled");
-
-  if (tail.startswith(search)) {
-auto reader = mangled.begin() + read_pos;
-ptrdiff_t read_len = tail.data() - (mangled.data() + read_pos);
-
-// First write the unmatched part of the original. Then write the
-// replacement string. Finally skip the search string in the original.
-writer = std::copy(reader, reader + read_len, writer);
-writer = std::copy(replace.begin(), replace.end(), writer);
-read_pos += read_len + search.size();
-  }
-}
+public:
+  void reset() { Alloc.Reset(); }
 
-ConstString Finalize() {
-  // If we did a substitution, write the remaining part of the original.
-  if (read_pos > 0) {
-writer = std::copy(mangled.begin() + read_pos, mangled.end(), writer);
-read_pos = mangled.size();
-  }
+  template  T *makeNode(Args &&... args) {
+return new (Alloc.Allocate(sizeof(T), alignof(T)))
+T(std::forward(args)...);
+  }
 
-  return ConstString(output);
-}
+  void *allocateNodeArray(size_t sz) {
+return Alloc.Allocate(sizeof(llvm::itanium_demangle::Node *) * sz,
+  alignof(llvm::itanium_demangle::Node *));
+  }
+};
+
+/// Given a mangled function `Mangled`, replace all the primitive function type
+/// arguments of `Search` with type `Replace`.
+class TypeSubstitutor
+: public llvm::itanium_demangle::AbstractManglingParser {
+  /// Input character until which we have constructed the respective output
+  /// already
+  const char *Written;
+
+  llvm::StringRef Search;
+  llvm::StringRef Replace;
+  llvm::SmallString<128> Result;
+
+  /// Whether we have performed any substitutions.
+  bool Substituted;
+
+  void reset(llvm::StringRef Mangled, llvm::StringRef Search,
+ llvm::StringRef Replace) {
+AbstractManglingParser::reset(Mangled.begin(), Mangled.end());
+Written = Mangled.begin();
+this->Search = Search;
+this->Replace = Replace;
+Result.clear();
+Substituted = false;
+  }
 
-static void Callback(void *context, const char *match) {
-  ((PrimitiveParmSubs *)context)->Substitute(llvm::StringRef(match));
+  void appendUnchangedInput() {
+Result += llvm::StringRef(Written, First - Written);
+Written = First;
+  }
+
+public:
+  TypeSubstitutor() : AbstractManglingParser(nullptr, nullptr) {}
+
+  ConstString substitute(llvm::StringRef Mangled, llvm::StringRef From,
+ llvm::StringRef To) {
+Log *log = GetLogIfAllCategoriesSet(LIBLLDB_LOG_LANG

[Lldb-commits] [lldb] r346233 - CPlusPlusLanguage: Use new demangler API to implement type substitution

2018-11-06 Thread Pavel Labath via lldb-commits
Author: labath
Date: Tue Nov  6 07:41:37 2018
New Revision: 346233

URL: http://llvm.org/viewvc/llvm-project?rev=346233&view=rev
Log:
CPlusPlusLanguage: Use new demangler API to implement type substitution

Summary:
Now that llvm demangler supports more generic customization, we can
implement type substitution directly on top of this API. This will allow
us to remove the specialized hooks which were added to the demangler to
support this use case.

Reviewers: sgraenitz, erik.pilkington, JDevlieghere

Subscribers: lldb-commits

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

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Modified: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp?rev=346233&r1=346232&r2=346233&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp Tue Nov  
6 07:41:37 2018
@@ -21,7 +21,7 @@
 
 // Other libraries and framework includes
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Demangle/Demangle.h"
+#include "llvm/Demangle/ItaniumDemangle.h"
 
 // Project includes
 #include "lldb/Core/PluginManager.h"
@@ -279,72 +279,89 @@ bool CPlusPlusLanguage::ExtractContextAn
   return false;
 }
 
-/// Given a mangled function `mangled`, replace all the primitive function type
-/// arguments of `search` with type `replace`.
-static ConstString SubsPrimitiveParmItanium(llvm::StringRef mangled,
-llvm::StringRef search,
-llvm::StringRef replace) {
-  class PrimitiveParmSubs {
-llvm::StringRef mangled;
-llvm::StringRef search;
-llvm::StringRef replace;
-ptrdiff_t read_pos;
-std::string output;
-std::back_insert_iterator writer;
-
-  public:
-PrimitiveParmSubs(llvm::StringRef m, llvm::StringRef s, llvm::StringRef r)
-: mangled(m), search(s), replace(r), read_pos(0),
-  writer(std::back_inserter(output)) {}
-
-void Substitute(llvm::StringRef tail) {
-  assert(tail.data() >= mangled.data() &&
- tail.data() < mangled.data() + mangled.size() &&
- "tail must point into range of mangled");
-
-  if (tail.startswith(search)) {
-auto reader = mangled.begin() + read_pos;
-ptrdiff_t read_len = tail.data() - (mangled.data() + read_pos);
-
-// First write the unmatched part of the original. Then write the
-// replacement string. Finally skip the search string in the original.
-writer = std::copy(reader, reader + read_len, writer);
-writer = std::copy(replace.begin(), replace.end(), writer);
-read_pos += read_len + search.size();
-  }
-}
+namespace {
+class NodeAllocator {
+  llvm::BumpPtrAllocator Alloc;
+
+public:
+  void reset() { Alloc.Reset(); }
+
+  template  T *makeNode(Args &&... args) {
+return new (Alloc.Allocate(sizeof(T), alignof(T)))
+T(std::forward(args)...);
+  }
 
-ConstString Finalize() {
-  // If we did a substitution, write the remaining part of the original.
-  if (read_pos > 0) {
-writer = std::copy(mangled.begin() + read_pos, mangled.end(), writer);
-read_pos = mangled.size();
-  }
+  void *allocateNodeArray(size_t sz) {
+return Alloc.Allocate(sizeof(llvm::itanium_demangle::Node *) * sz,
+  alignof(llvm::itanium_demangle::Node *));
+  }
+};
 
-  return ConstString(output);
-}
+/// Given a mangled function `Mangled`, replace all the primitive function type
+/// arguments of `Search` with type `Replace`.
+class TypeSubstitutor
+: public llvm::itanium_demangle::AbstractManglingParser {
+  /// Input character until which we have constructed the respective output
+  /// already
+  const char *Written;
+
+  llvm::StringRef Search;
+  llvm::StringRef Replace;
+  llvm::SmallString<128> Result;
+
+  /// Whether we have performed any substitutions.
+  bool Substituted;
+
+  void reset(llvm::StringRef Mangled, llvm::StringRef Search,
+ llvm::StringRef Replace) {
+AbstractManglingParser::reset(Mangled.begin(), Mangled.end());
+Written = Mangled.begin();
+this->Search = Search;
+this->Replace = Replace;
+Result.clear();
+Substituted = false;
+  }
+
+  void appendUnchangedInput() {
+Result += llvm::StringRef(Written, First - Written);
+Written = First;
+  }
 
-static void Callback(void *context, const char *match) {
-  ((PrimitiveParmSubs *)context)->Substitute(llvm::StringRef(match));
+public:
+  TypeSubstitutor() : AbstractManglingParser(nullptr, nullptr) {}
+
+  ConstString substitute(llvm::StringRef Mangled, llvm::StringRef F

[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution

2018-11-06 Thread Pavel Labath via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL346233: CPlusPlusLanguage: Use new demangler API to 
implement type substitution (authored by labath, committed by ).
Herald added a subscriber: llvm-commits.

Repository:
  rL LLVM

https://reviews.llvm.org/D54074

Files:
  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp

Index: lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
===
--- lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
+++ lldb/trunk/unittests/Language/CPlusPlus/CPlusPlusLanguageTest.cpp
@@ -191,4 +191,5 @@
   EXPECT_THAT(FindAlternate("_ZN1A1fEx"), Contains("_ZN1A1fEl"));
   EXPECT_THAT(FindAlternate("_ZN1A1fEy"), Contains("_ZN1A1fEm"));
   EXPECT_THAT(FindAlternate("_ZN1A1fEai"), Contains("_ZN1A1fEci"));
+  EXPECT_THAT(FindAlternate("_bogus"), IsEmpty());
 }
Index: lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
===
--- lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
@@ -21,7 +21,7 @@
 
 // Other libraries and framework includes
 #include "llvm/ADT/StringRef.h"
-#include "llvm/Demangle/Demangle.h"
+#include "llvm/Demangle/ItaniumDemangle.h"
 
 // Project includes
 #include "lldb/Core/PluginManager.h"
@@ -279,72 +279,89 @@
   return false;
 }
 
-/// Given a mangled function `mangled`, replace all the primitive function type
-/// arguments of `search` with type `replace`.
-static ConstString SubsPrimitiveParmItanium(llvm::StringRef mangled,
-llvm::StringRef search,
-llvm::StringRef replace) {
-  class PrimitiveParmSubs {
-llvm::StringRef mangled;
-llvm::StringRef search;
-llvm::StringRef replace;
-ptrdiff_t read_pos;
-std::string output;
-std::back_insert_iterator writer;
+namespace {
+class NodeAllocator {
+  llvm::BumpPtrAllocator Alloc;
+
+public:
+  void reset() { Alloc.Reset(); }
+
+  template  T *makeNode(Args &&... args) {
+return new (Alloc.Allocate(sizeof(T), alignof(T)))
+T(std::forward(args)...);
+  }
 
-  public:
-PrimitiveParmSubs(llvm::StringRef m, llvm::StringRef s, llvm::StringRef r)
-: mangled(m), search(s), replace(r), read_pos(0),
-  writer(std::back_inserter(output)) {}
-
-void Substitute(llvm::StringRef tail) {
-  assert(tail.data() >= mangled.data() &&
- tail.data() < mangled.data() + mangled.size() &&
- "tail must point into range of mangled");
-
-  if (tail.startswith(search)) {
-auto reader = mangled.begin() + read_pos;
-ptrdiff_t read_len = tail.data() - (mangled.data() + read_pos);
-
-// First write the unmatched part of the original. Then write the
-// replacement string. Finally skip the search string in the original.
-writer = std::copy(reader, reader + read_len, writer);
-writer = std::copy(replace.begin(), replace.end(), writer);
-read_pos += read_len + search.size();
-  }
-}
+  void *allocateNodeArray(size_t sz) {
+return Alloc.Allocate(sizeof(llvm::itanium_demangle::Node *) * sz,
+  alignof(llvm::itanium_demangle::Node *));
+  }
+};
 
-ConstString Finalize() {
-  // If we did a substitution, write the remaining part of the original.
-  if (read_pos > 0) {
-writer = std::copy(mangled.begin() + read_pos, mangled.end(), writer);
-read_pos = mangled.size();
-  }
+/// Given a mangled function `Mangled`, replace all the primitive function type
+/// arguments of `Search` with type `Replace`.
+class TypeSubstitutor
+: public llvm::itanium_demangle::AbstractManglingParser {
+  /// Input character until which we have constructed the respective output
+  /// already
+  const char *Written;
+
+  llvm::StringRef Search;
+  llvm::StringRef Replace;
+  llvm::SmallString<128> Result;
+
+  /// Whether we have performed any substitutions.
+  bool Substituted;
+
+  void reset(llvm::StringRef Mangled, llvm::StringRef Search,
+ llvm::StringRef Replace) {
+AbstractManglingParser::reset(Mangled.begin(), Mangled.end());
+Written = Mangled.begin();
+this->Search = Search;
+this->Replace = Replace;
+Result.clear();
+Substituted = false;
+  }
 
-  return ConstString(output);
-}
+  void appendUnchangedInput() {
+Result += llvm::StringRef(Written, First - Written);
+Written = First;
+  }
+
+public:
+  TypeSubstitutor() : AbstractManglingParser(nullptr, nullptr) {}
 
-static void Callback(void *context, const char *match) {
-  ((PrimitiveParmSubs *)context)->Substitute(llvm::StringRef(match));
+  ConstString substitute(llvm::StringRef

[Lldb-commits] [PATCH] D51566: Add a relocation to ObjectFileELF::ApplyRelocations and a test

2018-11-06 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

@lanza Hey Nathan, it looks like your test exposed an UB in 
`ELFObjectFileReader`. May I ask you to take a look?

- TEST 'lldb-Unit :: 
ObjectFile/ELF/./ObjectFileELFTests/ObjectFileELFTest.TestAARCH64Relocations' 
FAILED 

Note: Google Test filter = ObjectFileELFTest.TestAARCH64Relocations
[==] Running 1 test from 1 test case.
[--] Global test environment set-up.
[--] 1 test from ObjectFileELFTest
[ RUN  ] ObjectFileELFTest.TestAARCH64Relocations
/Users/buildslave/jenkins/workspace/lldb-sanitized/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2741:11:
 runtime error: store to misaligned address 0x61f01526 for type 'uint32_t' 
(aka 'unsigned int'), which requires 4 byte alignment
0x61f01526: note: pointer points here
 00 00 04 00 00 00  00 00 08 01 00 00 00 00  0c 00 00 00 00 00 00 00  00 00 00 
00 00 00 00 00  00 00

  ^ 

SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
/Users/buildslave/jenkins/workspace/lldb-sanitized/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2741:11
 in


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51566



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


[Lldb-commits] [PATCH] D54053: [NativePDB] Add the ability to create clang record decls from mangled names.

2018-11-06 Thread Zachary Turner via Phabricator via lldb-commits
zturner added a comment.

In https://reviews.llvm.org/D54053#1288415, @aleksandr.urakov wrote:

> In https://reviews.llvm.org/D54053#1286653, @zturner wrote:
>
> > Bleh, I think I found a problem with this approach.  Since we assume 
> > everything is a namespace, it can lead to ambiguities.  I think we need to 
> > actually consult the debug info while parsing components of the mangled 
> > name.
>
>
> Yes, it is what actually we have done in 
> `PDBASTParser::GetDeclContextContainingSymbol`. Also I think that it is worth 
> to remember if we already have created the class / function parent before, 
> and do not create namespaces in this case. For example: 
> `N0::N1::CClass::PrivateFunc::__l2::InnerFuncStruct`. We have here the 
> `PrivateFunc` function and the `InnerFuncStruct` structure inside it. So we 
> do not need to create the `__l2` namespace inside the `PrivateFunc` function 
> (moreover, it is not possible to create a namespace inside a class / 
> function).
>
> There is a similar problem with global and static variables and functions. 
> Are the mangled names presented for them? Can we solve it in the same way?
>
> Anyway, I think that this patch is a great start!


I actually think I have a totally different solution to this that will be more 
robust.  It will handle the nested classes and namespaces perfectly, but not 
the scoped classes.  But we can deal with that later.  But it gives us the 
highest quality correctness level for this case, which I think is ultimately 
the most common (nested classes are pretty rare).  So we can try the best 
methods first, and fall back to other methods as needed.  I'm going to abandon 
this patch for now, but we'll keep it in mind for later.  I'll upload a new 
patch with the new approach soon.


https://reviews.llvm.org/D54053



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


[Lldb-commits] [PATCH] D54135: Add convenience method in FileSystem to check if a path/filespec is a directory.

2018-11-06 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In https://reviews.llvm.org/D54135#1288254, @krytarowski wrote:

> Why? We already put a lot of effort into reusing code from LLVM.


This is still using code from LLVM, the `FileSystem` class is just an 
abstraction in between:

1. It uses LLVM's virtual file system. The VFS is stateful and the FileSystem 
class maintains this state. If you don't specify a virtual file system it uses 
the "real" file system (the default).
2. It has convenience methods for FileSpecs, so that you don't have to convert 
them at every call site. These functions used to be methods in the FileSpec 
class, something we wanted to get rid of for a while because conceptually the 
latter is just a "smart path".

I started doing all this work to support reproducers in LLDB. We'll need a 
bunch of files that won't live at their original location and the VFS makes it 
possible to deal with that transparently.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D54135



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


[Lldb-commits] [lldb] r346244 - [ObjectFileELF] Fix misaligned read/writes caught by UBSan.

2018-11-06 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Nov  6 09:11:34 2018
New Revision: 346244

URL: http://llvm.org/viewvc/llvm-project?rev=346244&view=rev
Log:
[ObjectFileELF] Fix misaligned read/writes caught by UBSan.

Modified:
lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp

Modified: lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp?rev=346244&r1=346243&r2=346244&view=diff
==
--- lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp (original)
+++ lldb/trunk/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp Tue Nov  6 
09:11:34 2018
@@ -2712,7 +2712,8 @@ unsigned ObjectFileELF::ApplyRelocations
   uint64_t *dst = reinterpret_cast(
   data_buffer_sp->GetBytes() + rel_section->GetFileOffset() +
   ELFRelocation::RelocOffset64(rel));
-  *dst = value + ELFRelocation::RelocAddend64(rel);
+  uint64_t val_offset = value + ELFRelocation::RelocAddend64(rel);
+  memcpy(dst, &val_offset, sizeof(uint64_t));
 }
 break;
   }
@@ -2738,7 +2739,7 @@ unsigned ObjectFileELF::ApplyRelocations
   uint32_t *dst = reinterpret_cast(
   data_buffer_sp->GetBytes() + rel_section->GetFileOffset() +
   ELFRelocation::RelocOffset32(rel));
-  *dst = truncated_addr;
+  memcpy(dst, &truncated_addr, sizeof(uint32_t));
 }
 break;
   }

Modified: lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp?rev=346244&r1=346243&r2=346244&view=diff
==
--- lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp (original)
+++ lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp Tue Nov  6 
09:11:34 2018
@@ -143,10 +143,17 @@ TEST_F(ObjectFileELFTest, GetModuleSpeci
   EXPECT_EQ(Spec.GetUUID(), Uuid);
 }
 
-#define CHECK_ABS32(offset, addend)
\
-  ASSERT_EQ((uint32_t)addend, *(uint32_t *)(bytes + offset))
-#define CHECK_ABS64(offset, addend)
\
-  ASSERT_EQ((uint64_t)addend, *(uint64_t *)(bytes + offset))
+static void CHECK_ABS32(uint8_t *bytes, uint32_t offset, uint32_t addend) {
+  uint32_t res;
+  memcpy(&res, (uint32_t *)(bytes + offset), sizeof(uint32_t));
+  ASSERT_EQ(addend, res);
+}
+
+static void CHECK_ABS64(uint8_t *bytes, uint64_t offset, uint64_t addend) {
+  uint64_t res;
+  memcpy(&res, (uint64_t *)(bytes + offset), sizeof(uint64_t));
+  ASSERT_EQ(addend, res);
+}
 
 TEST_F(ObjectFileELFTest, TestAARCH64Relocations) {
   std::string yaml = GetInputFilePath("debug-info-relocations.pcm.yaml");
@@ -193,13 +200,13 @@ TEST_F(ObjectFileELFTest, TestAARCH64Rel
   // .rela.debug_info contains 9 relocations:
   // 7 R_AARCH64_ABS32 - 2 R_AARCH64_ABS64
   // None have a value. Four have addends.
-  CHECK_ABS32(0x6, 0);
-  CHECK_ABS32(0xC, 0);
-  CHECK_ABS32(0x12, 45);
-  CHECK_ABS32(0x16, 0);
-  CHECK_ABS32(0x1A, 55);
-  CHECK_ABS64(0x1E, 0);
-  CHECK_ABS64(0x2B, 0);
-  CHECK_ABS32(0x39, 73);
-  CHECK_ABS32(0x44, 75);
+  CHECK_ABS32(bytes, 0x6, 0);
+  CHECK_ABS32(bytes, 0xC, 0);
+  CHECK_ABS32(bytes, 0x12, 45);
+  CHECK_ABS32(bytes, 0x16, 0);
+  CHECK_ABS32(bytes, 0x1A, 55);
+  CHECK_ABS64(bytes, 0x1E, 0);
+  CHECK_ABS64(bytes, 0x2B, 0);
+  CHECK_ABS32(bytes, 0x39, 73);
+  CHECK_ABS32(bytes, 0x44, 75);
 }


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


[Lldb-commits] [PATCH] D51566: Add a relocation to ObjectFileELF::ApplyRelocations and a test

2018-11-06 Thread Davide Italiano via Phabricator via lldb-commits
davide added a comment.

In https://reviews.llvm.org/D51566#1288792, @davide wrote:

> @lanza Hey Nathan, it looks like your test exposed an UB in 
> `ELFObjectFileReader`. May I ask you to take a look?
>
> - TEST 'lldb-Unit :: 
> ObjectFile/ELF/./ObjectFileELFTests/ObjectFileELFTest.TestAARCH64Relocations' 
> FAILED  Note: Google Test filter = 
> ObjectFileELFTest.TestAARCH64Relocations [==] Running 1 test from 1 
> test case. [--] Global test environment set-up. [--] 1 test 
> from ObjectFileELFTest [ RUN  ] ObjectFileELFTest.TestAARCH64Relocations 
> /Users/buildslave/jenkins/workspace/lldb-sanitized/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2741:11:
>  runtime error: store to misaligned address 0x61f01526 for type 
> 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment 
> 0x61f01526: note: pointer points here 00 00 04 00 00 00  00 00 08 01 00 
> 00 00 00  0c 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  00 00 ^ SUMMARY: 
> UndefinedBehaviorSanitizer: undefined-behavior 
> /Users/buildslave/jenkins/workspace/lldb-sanitized/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2741:11
>  in




In https://reviews.llvm.org/D51566#1288792, @davide wrote:

> @lanza Hey Nathan, it looks like your test exposed an UB in 
> `ELFObjectFileReader`. May I ask you to take a look?
>
>    TEST 'lldb-Unit :: 
> ObjectFile/ELF/./ObjectFileELFTests/ObjectFileELFTest.TestAARCH64Relocations' 
> FAILED 
>   Note: Google Test filter = ObjectFileELFTest.TestAARCH64Relocations
>   [==] Running 1 test from 1 test case.
>   [--] Global test environment set-up.
>   [--] 1 test from ObjectFileELFTest
>   [ RUN  ] ObjectFileELFTest.TestAARCH64Relocations
>   
> /Users/buildslave/jenkins/workspace/lldb-sanitized/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2741:11:
>  runtime error: store to misaligned address 0x61f01526 for type 
> 'uint32_t' (aka 'unsigned int'), which requires 4 byte alignment
>   0x61f01526: note: pointer points here
>00 00 04 00 00 00  00 00 08 01 00 00 00 00  0c 00 00 00 00 00 00 00  00 00 
> 00 00 00 00 00 00  00 00
>^ 
>   SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior 
> /Users/buildslave/jenkins/workspace/lldb-sanitized/llvm/tools/lldb/source/Plugins/ObjectFile/ELF/ObjectFileELF.cpp:2741:11
>  in 
>  
>


Went ahead and fixed this in r346244. A post commit review would be appreciated.

-

Davide


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51566



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


[Lldb-commits] [PATCH] D54009: Refactor LLDB lit configuration files

2018-11-06 Thread Stella Stamenova via Phabricator via lldb-commits
stella.stamenova added a comment.

In https://reviews.llvm.org/D54009#1284839, @zturner wrote:

> In https://reviews.llvm.org/D54009#1284827, @stella.stamenova wrote:
>
> > Looks good. The formatting in lit.cfg.py is a bit messy (indentations, 
> > especially), but as long as the tests pass, this is an improvement :). 
> > Thanks!
>
>
> Is there something like clang-format for Python?  Happy to fix it if so.  (I 
> don't do a lot of Python so it's hard for me to eyeball it and figure out 
> what's wrong, so I have to say it looks fine to me :))


There's no clang-format for Python that I know of. Since python cares about 
indentation, it's always a good idea to make sure that we use the same number 
of spaces for all of the 'if's and such as it will occasionally lead to hard to 
track down bugs. There are (in the final version) of lit.cfg.py a couple of 
places where two spaces make the indentation and everything else uses four. 
It's not a big deal because of where they are, but something to look out for.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D54009



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


[Lldb-commits] [lldb] r346247 - [ObjectFile] Prefer reinterpret_cast<>

2018-11-06 Thread Davide Italiano via lldb-commits
Author: davide
Date: Tue Nov  6 09:42:14 2018
New Revision: 346247

URL: http://llvm.org/viewvc/llvm-project?rev=346247&view=rev
Log:
[ObjectFile] Prefer reinterpret_cast<>

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

Modified: lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp?rev=346247&r1=346246&r2=346247&view=diff
==
--- lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp (original)
+++ lldb/trunk/unittests/ObjectFile/ELF/TestObjectFileELF.cpp Tue Nov  6 
09:42:14 2018
@@ -145,13 +145,13 @@ TEST_F(ObjectFileELFTest, GetModuleSpeci
 
 static void CHECK_ABS32(uint8_t *bytes, uint32_t offset, uint32_t addend) {
   uint32_t res;
-  memcpy(&res, (uint32_t *)(bytes + offset), sizeof(uint32_t));
+  memcpy(&res, reinterpret_cast(bytes + offset), sizeof(uint32_t));
   ASSERT_EQ(addend, res);
 }
 
 static void CHECK_ABS64(uint8_t *bytes, uint64_t offset, uint64_t addend) {
   uint64_t res;
-  memcpy(&res, (uint64_t *)(bytes + offset), sizeof(uint64_t));
+  memcpy(&res, reinterpret_cast(bytes + offset), sizeof(uint64_t));
   ASSERT_EQ(addend, res);
 }
 


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


[Lldb-commits] [PATCH] D54074: CPlusPlusLanguage: Use new demangler API to implement type substitution

2018-11-06 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

Much better, thank you!


Repository:
  rL LLVM

https://reviews.llvm.org/D54074



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


[Lldb-commits] [PATCH] D51566: Add a relocation to ObjectFileELF::ApplyRelocations and a test

2018-11-06 Thread Nathan Lanza via Phabricator via lldb-commits
lanza added a comment.

LGTM and the test case passes. Thanks a lot, Davide!


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D51566



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


[Lldb-commits] [lldb] r346278 - Add MSVCUndecoratedNameParser.cpp.

2018-11-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov  6 15:01:42 2018
New Revision: 346278

URL: http://llvm.org/viewvc/llvm-project?rev=346278&view=rev
Log:
Add MSVCUndecoratedNameParser.cpp.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346278&r1=346277&r2=346278&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov  6 15:01:42 2018
@@ -476,6 +476,7 @@
266942451A6DC2AC0063BE93 /* MIUtilString.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941EE1A6DC2AC0063BE93 /* MIUtilString.cpp */; 
};
2669424A1A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 266941F81A6DC2AC0063BE93 /* 
MIUtilThreadBaseStd.cpp */; };
2669424B1A6DC2AC0063BE93 /* MIUtilVariant.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp 
*/; };
+   AF395C03219254F300894EC3 /* MSVCUndecoratedNameParser.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = AF395C01219254F200894EC3 /* 
MSVCUndecoratedNameParser.cpp */; };
D67521381EA17C4200439694 /* MainLoop.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = D67521351EA17C3900439694 /* MainLoop.cpp */; };
9A20573A1F3B8E7E00F6C293 /* MainLoopTest.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */; 
};
8C3BD9961EF45DA50016C343 /* MainThreadCheckerRuntime.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD9951EF45D9B0016C343 /* 
MainThreadCheckerRuntime.cpp */; };
@@ -2191,6 +2192,8 @@
266941F91A6DC2AC0063BE93 /* MIUtilThreadBaseStd.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MIUtilThreadBaseStd.h; path = "tools/lldb-mi/MIUtilThreadBaseStd.h"; sourceTree 
= SOURCE_ROOT; };
266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = MIUtilVariant.cpp; path = "tools/lldb-mi/MIUtilVariant.cpp"; sourceTree 
= SOURCE_ROOT; };
266941FB1A6DC2AC0063BE93 /* MIUtilVariant.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
MIUtilVariant.h; path = "tools/lldb-mi/MIUtilVariant.h"; sourceTree = 
SOURCE_ROOT; };
+   AF395C01219254F200894EC3 /* MSVCUndecoratedNameParser.cpp */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
sourcecode.cpp.cpp; name = MSVCUndecoratedNameParser.cpp; path = 
Language/CPlusPlus/MSVCUndecoratedNameParser.cpp; sourceTree = ""; };
+   AF395C00219254F200894EC3 /* MSVCUndecoratedNameParser.h */ = 
{isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; 
name = MSVCUndecoratedNameParser.h; path = 
Language/CPlusPlus/MSVCUndecoratedNameParser.h; sourceTree = ""; };
D67521351EA17C3900439694 /* MainLoop.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = MainLoop.cpp; sourceTree = ""; };
9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = MainLoopTest.cpp; sourceTree = ""; };
8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */ = 
{isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = 
MainThreadCheckerRuntime.cpp; sourceTree = ""; };
@@ -6460,6 +6463,8 @@
94B6385B1B8FB174004FE1E4 /* 
CPlusPlusLanguage.cpp */,
49F811F01E931B1500F4E163 /* 
CPlusPlusNameParser.h */,
49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */,
+   AF395C01219254F200894EC3 /* 
MSVCUndecoratedNameParser.cpp */,
+   AF395C00219254F200894EC3 /* 
MSVCUndecoratedNameParser.h */,
);
name = CPlusPlus;
sourceTree = "";
@@ -7734,6 +7739,7 @@
23F4034D1926E0F60046DC9B /* 
NativeRegisterContextRegisterInfo.cpp in Sources */,
964463EC1A330C0500154ED8 /* 
CompactUnwindInfo.cpp in Sources */,
94B638531B8F8E6C004FE1E4 /* Language.cpp in 
Sources */,
+   AF395C03219254F300894EC3 /* 
MSVCUndecoratedNameParser.cpp in Sources */,
2689001D13353DDE00698AC0 /* 
CommandObjectLog.cpp in Sources */,
262173A318395D4600C52091 /* 
SectionLoadHistory.cpp in Sources */,
2689001E13353DDE00698AC0 /* 

[Lldb-commits] [PATCH] D53959: Remove working directory for debugserver code signing target

2018-11-06 Thread Nathan Lanza via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB346281: Remove working directory for debugserver code 
signing target (authored by lanza, committed by ).
Herald added a subscriber: lldb-commits.

Changed prior to commit:
  https://reviews.llvm.org/D53959?vs=172815&id=172876#toc

Repository:
  rLLDB LLDB

https://reviews.llvm.org/D53959

Files:
  tools/debugserver/source/CMakeLists.txt


Index: tools/debugserver/source/CMakeLists.txt
===
--- tools/debugserver/source/CMakeLists.txt
+++ tools/debugserver/source/CMakeLists.txt
@@ -239,16 +239,14 @@
 codesign --force --sign ${LLDB_CODESIGN_IDENTITY}
 ${entitlements_flags}
 $
-WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
   )
   if(IOS)
 add_custom_command(TARGET debugserver-nonui
   POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE}
   codesign --force --sign ${LLDB_CODESIGN_IDENTITY}
   ${entitlements_flags}
   $
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
 )
   endif()
 endif()


Index: tools/debugserver/source/CMakeLists.txt
===
--- tools/debugserver/source/CMakeLists.txt
+++ tools/debugserver/source/CMakeLists.txt
@@ -239,16 +239,14 @@
 codesign --force --sign ${LLDB_CODESIGN_IDENTITY}
 ${entitlements_flags}
 $
-WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
   )
   if(IOS)
 add_custom_command(TARGET debugserver-nonui
   POST_BUILD
   COMMAND ${CMAKE_COMMAND} -E env CODESIGN_ALLOCATE=${CODESIGN_ALLOCATE}
   codesign --force --sign ${LLDB_CODESIGN_IDENTITY}
   ${entitlements_flags}
   $
-  WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/bin
 )
   endif()
 endif()
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r346283 - Compiler warning pointed out a mistake - fix it.

2018-11-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov  6 16:25:02 2018
New Revision: 346283

URL: http://llvm.org/viewvc/llvm-project?rev=346283&view=rev
Log:

Compiler warning pointed out a mistake - fix it.

Modified:
lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp

Modified: lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp?rev=346283&r1=346282&r2=346283&view=diff
==
--- lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp (original)
+++ lldb/trunk/source/Plugins/Platform/MacOSX/PlatformMacOSX.cpp Tue Nov  6 
16:25:02 2018
@@ -93,7 +93,7 @@ PlatformSP PlatformMacOSX::CreateInstanc
 #if defined(__APPLE__)
 // Only accept "unknown" for vendor if the host is Apple and it "unknown"
 // wasn't specified (it was just returned because it was NOT specified)
-case llvm::Triple::UnknownArch:
+case llvm::Triple::UnknownVendor:
   create = !arch->TripleVendorWasSpecified();
   break;
 #endif


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


Re: [Lldb-commits] [lldb] r346278 - Add MSVCUndecoratedNameParser.cpp.

2018-11-06 Thread Davide Italiano via lldb-commits
Thank you Jason!

--
Davide
On Tue, Nov 6, 2018 at 3:03 PM Jason Molenda via lldb-commits
 wrote:
>
> Author: jmolenda
> Date: Tue Nov  6 15:01:42 2018
> New Revision: 346278
>
> URL: http://llvm.org/viewvc/llvm-project?rev=346278&view=rev
> Log:
> Add MSVCUndecoratedNameParser.cpp.
>
> Modified:
> lldb/trunk/lldb.xcodeproj/project.pbxproj
>
> Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
> URL: 
> http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346278&r1=346277&r2=346278&view=diff
> ==
> --- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
> +++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov  6 15:01:42 2018
> @@ -476,6 +476,7 @@
> 266942451A6DC2AC0063BE93 /* MIUtilString.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 266941EE1A6DC2AC0063BE93 /* MIUtilString.cpp 
> */; };
> 2669424A1A6DC2AC0063BE93 /* MIUtilThreadBaseStd.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 266941F81A6DC2AC0063BE93 /* 
> MIUtilThreadBaseStd.cpp */; };
> 2669424B1A6DC2AC0063BE93 /* MIUtilVariant.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp 
> */; };
> +   AF395C03219254F300894EC3 /* MSVCUndecoratedNameParser.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = AF395C01219254F200894EC3 /* 
> MSVCUndecoratedNameParser.cpp */; };
> D67521381EA17C4200439694 /* MainLoop.cpp in Sources */ = {isa 
> = PBXBuildFile; fileRef = D67521351EA17C3900439694 /* MainLoop.cpp */; };
> 9A20573A1F3B8E7E00F6C293 /* MainLoopTest.cpp in Sources */ = 
> {isa = PBXBuildFile; fileRef = 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp 
> */; };
> 8C3BD9961EF45DA50016C343 /* MainThreadCheckerRuntime.cpp in 
> Sources */ = {isa = PBXBuildFile; fileRef = 8C3BD9951EF45D9B0016C343 /* 
> MainThreadCheckerRuntime.cpp */; };
> @@ -2191,6 +2192,8 @@
> 266941F91A6DC2AC0063BE93 /* MIUtilThreadBaseStd.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = MIUtilThreadBaseStd.h; path = "tools/lldb-mi/MIUtilThreadBaseStd.h"; 
> sourceTree = SOURCE_ROOT; };
> 266941FA1A6DC2AC0063BE93 /* MIUtilVariant.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> name = MIUtilVariant.cpp; path = "tools/lldb-mi/MIUtilVariant.cpp"; 
> sourceTree = SOURCE_ROOT; };
> 266941FB1A6DC2AC0063BE93 /* MIUtilVariant.h */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name 
> = MIUtilVariant.h; path = "tools/lldb-mi/MIUtilVariant.h"; sourceTree = 
> SOURCE_ROOT; };
> +   AF395C01219254F200894EC3 /* MSVCUndecoratedNameParser.cpp */ 
> = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
> sourcecode.cpp.cpp; name = MSVCUndecoratedNameParser.cpp; path = 
> Language/CPlusPlus/MSVCUndecoratedNameParser.cpp; sourceTree = ""; };
> +   AF395C00219254F200894EC3 /* MSVCUndecoratedNameParser.h */ = 
> {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = 
> sourcecode.c.h; name = MSVCUndecoratedNameParser.h; path = 
> Language/CPlusPlus/MSVCUndecoratedNameParser.h; sourceTree = ""; };
> D67521351EA17C3900439694 /* MainLoop.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> path = MainLoop.cpp; sourceTree = ""; };
> 9A2057301F3B8E7600F6C293 /* MainLoopTest.cpp */ = {isa = 
> PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
> path = MainLoopTest.cpp; sourceTree = ""; };
> 8C3BD9951EF45D9B0016C343 /* MainThreadCheckerRuntime.cpp */ = 
> {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; path = 
> MainThreadCheckerRuntime.cpp; sourceTree = ""; };
> @@ -6460,6 +6463,8 @@
> 94B6385B1B8FB174004FE1E4 /* 
> CPlusPlusLanguage.cpp */,
> 49F811F01E931B1500F4E163 /* 
> CPlusPlusNameParser.h */,
> 49F811EF1E931B1500F4E163 /* 
> CPlusPlusNameParser.cpp */,
> +   AF395C01219254F200894EC3 /* 
> MSVCUndecoratedNameParser.cpp */,
> +   AF395C00219254F200894EC3 /* 
> MSVCUndecoratedNameParser.h */,
> );
> name = CPlusPlus;
> sourceTree = "";
> @@ -7734,6 +7739,7 @@
> 23F4034D1926E0F60046DC9B /* 
> NativeRegisterContextRegisterInfo.cpp in Sources */,
> 964463EC1A330C0500154ED8 /* 
> CompactUnwindInfo.cpp in Sources */,
> 94B638531B8F8E6C004FE1E4 /* Language.cpp in 
> Sources */,
> +   AF395C03219254F300894EC3 /* 
> MSVCUndecoratedNamePars

[Lldb-commits] [lldb] r346285 - Standardize the OTHER_LDFLAGS for the lldb-gtest-build target.

2018-11-06 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Tue Nov  6 17:19:52 2018
New Revision: 346285

URL: http://llvm.org/viewvc/llvm-project?rev=346285&view=rev
Log:
Standardize the OTHER_LDFLAGS for the lldb-gtest-build target.

Modified:
lldb/trunk/lldb.xcodeproj/project.pbxproj

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=346285&r1=346284&r2=346285&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Tue Nov  6 17:19:52 2018
@@ -8623,9 +8623,22 @@
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "$(inherited)",
+   "-filelist",
+   "$(LLVM_BUILD_DIR)/archives.txt",
+   "-framework",
+   Foundation,
+   "-framework",
+   DebugSymbols,
+   "-framework",
+   Security,
+   "-framework",
+   CoreServices,
+   "-framework",
+   ApplicationServices,
+   "$(LLDB_GTESTS_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COVERAGE_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
@@ -8713,9 +8726,22 @@
"-Wimplicit-fallthrough",
);
OTHER_LDFLAGS = (
-   "$(LLDB_COMPRESSION_LDFLAGS)",
+   "$(inherited)",
+   "-filelist",
+   "$(LLVM_BUILD_DIR)/archives.txt",
+   "-framework",
+   Foundation,
+   "-framework",
+   DebugSymbols,
+   "-framework",
+   Security,
+   "-framework",
+   CoreServices,
+   "-framework",
+   ApplicationServices,
+   "$(LLDB_GTESTS_LDFLAGS)",
"$(LLDB_ZLIB_LDFLAGS)",
-   "$(LLDB_COVERAGE_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PYTHON_FRAMEWORK_PATH = 
/System/Library/Frameworks/Python.framework/;
PYTHON_VERSION_MAJOR = 2;
@@ -9036,6 +9062,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9078,6 +9106,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9120,6 +9150,8 @@
"-framework",
ApplicationServices,
"$(LLDB_GTESTS_LDFLAGS)",
+   "$(LLDB_ZLIB_LDFLAGS)",
+   "$(LLDB_COMPRESSION_LDFLAGS)",
);
PRODUCT_NAME = "lldb-gtest";
};
@@ -9162,6 +9194,8 @@
"-framework",
   

[Lldb-commits] [lldb] r346294 - Add a break to avoid an unannotated fall-through.

2018-11-06 Thread Eric Christopher via lldb-commits
Author: echristo
Date: Tue Nov  6 21:17:31 2018
New Revision: 346294

URL: http://llvm.org/viewvc/llvm-project?rev=346294&view=rev
Log:
Add a break to avoid an unannotated fall-through.

Modified:
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp

Modified: 
lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp?rev=346294&r1=346293&r2=346294&view=diff
==
--- lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/Language/CPlusPlus/MSVCUndecoratedNameParser.cpp 
Tue Nov  6 21:17:31 2018
@@ -63,6 +63,7 @@ MSVCUndecoratedNameParser::MSVCUndecorat
 name.slice(last_base_start, i - 1));
 
   last_base_start = i + 1;
+  break;
 default:
   break;
 }


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