[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-03 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine updated this revision to Diff 197922.
kkleine added a comment.

- Address formatting issues brought up in 
https://reviews.llvm.org/D61440#1488450


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440

Files:
  lldb/include/lldb/Core/Architecture.h
  lldb/include/lldb/Core/StreamBuffer.h
  lldb/include/lldb/Core/ValueObjectVariable.h
  lldb/include/lldb/Target/DynamicLoader.h
  lldb/include/lldb/Target/StackFrameRecognizer.h
  lldb/include/lldb/Target/StructuredDataPlugin.h
  lldb/include/lldb/Utility/Baton.h
  lldb/include/lldb/Utility/DataBufferLLVM.h
  lldb/include/lldb/Utility/StringExtractorGDBRemote.h
  lldb/source/API/SBBreakpointOptionCommon.h
  lldb/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
  lldb/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
  lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/source/Plugins/Language/ObjC/NSDictionary.h
  lldb/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
  lldb/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/PostfixExpression.cpp
  lldb/source/Target/StructuredDataPlugin.cpp
  lldb/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp
  lldb/unittests/Editline/EditlineTest.cpp
  lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
  lldb/unittests/Symbol/TestClangASTContext.cpp
  lldb/unittests/Target/ProcessInstanceInfoTest.cpp

Index: lldb/unittests/Target/ProcessInstanceInfoTest.cpp
===
--- lldb/unittests/Target/ProcessInstanceInfoTest.cpp
+++ lldb/unittests/Target/ProcessInstanceInfoTest.cpp
@@ -16,13 +16,13 @@
 /// for odd ones.
 class DummyUserIDResolver : public UserIDResolver {
 protected:
-  llvm::Optional DoGetUserName(id_t uid) {
+  llvm::Optional DoGetUserName(id_t uid) override {
 if (uid % 2)
   return ("user" + llvm::Twine(uid)).str();
 return llvm::None;
   }
 
-  llvm::Optional DoGetGroupName(id_t gid) {
+  llvm::Optional DoGetGroupName(id_t gid) override {
 if (gid % 2)
   return ("group" + llvm::Twine(gid)).str();
 return llvm::None;
Index: lldb/unittests/Symbol/TestClangASTContext.cpp
===
--- lldb/unittests/Symbol/TestClangASTContext.cpp
+++ lldb/unittests/Symbol/TestClangASTContext.cpp
@@ -34,12 +34,12 @@
 FileSystem::Terminate();
   }
 
-  virtual void SetUp() override {
+  void SetUp() override {
 std::string triple = HostInfo::GetTargetTriple();
 m_ast.reset(new ClangASTContext(triple.c_str()));
   }
 
-  virtual void TearDown() override { m_ast.reset(); }
+  void TearDown() override { m_ast.reset(); }
 
 protected:
   std::unique_ptr m_ast;
Index: lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===
--- lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ lldb/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -29,11 +29,11 @@
   unsigned stop_reply_called = 0;
   std::vector structured_data_packets;
 
-  void HandleAsyncStdout(llvm::StringRef out) { output += out; }
-  void HandleAsyncMisc(llvm::StringRef data) { misc_data += data; }
-  void HandleStopReply() { ++stop_reply_called; }
+  void HandleAsyncStdout(llvm::StringRef out) override { output += out; }
+  void HandleAsyncMisc(llvm::StringRef data) override { misc_data += data; }
+  void HandleStopReply() override { ++stop_reply_called; }
 
-  void HandleAsyncStructuredDataPacket(llvm::StringRef data) {
+  void HandleAsyncStructuredDataPacket(llvm::StringRef data) override {
 structured_data_packets.push_back(data);
   }
 };
Index: lldb/unittests/Editline/EditlineTest.cpp
===
--- lldb/unittests/Editline/EditlineTest.cpp
+++ lldb/unittests/Editline/EditlineTest.cpp
@@ -250,7 +250,7 @@
 setenv("TERM", "vt100", 1);
   }
 
-  void SetUp() {
+  void SetUp() override {
 FileSystem::Initialize();
 
 // Validate the editline adapter.
@@ -26

[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-03 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.

Looks good now, thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-03 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

@teemperor I've squashed my commits without the last one that did those many 
changes in the file 
`lldb/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp`.
 I hope at least the result is fine now.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


Re: [Lldb-commits] [lldb] r359832 - Initialization: move InstructionEmulation to full initialization

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

On 02/05/2019 23:49, Saleem Abdulrasool via lldb-commits wrote:

Author: compnerd
Date: Thu May  2 14:49:29 2019
New Revision: 359832

URL: http://llvm.org/viewvc/llvm-project?rev=359832&view=rev
Log:
Initialization: move InstructionEmulation to full initialization

The debug server does not need to use the instruction emulation.  This helps
reduce the size of the final lldb-server binary by another ~100K (~1% savings).



I've reverted this patch because it's not correct. lldb-server 
definitely can use instruction emulation (see NativeProcessLinux.cpp for 
example).


What I was trying to say in the IRC discussion that resulted in this 
patch is that lldb-server does not need to use the non-host instruction 
emulation (so you definitely don't need to emulate MIPS, if you're 
targetting ARM, etc.).


So, what you could do is make the instruction emulation set 
target-dependent, similar to how we only include ObjectFileELF on elf 
platforms, and not all object file plugins.


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


[Lldb-commits] [lldb] r359862 - Revert "Initialization: move InstructionEmulation to full initialization"

2019-05-03 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri May  3 00:11:43 2019
New Revision: 359862

URL: http://llvm.org/viewvc/llvm-project?rev=359862&view=rev
Log:
Revert "Initialization: move InstructionEmulation to full initialization"

This change is bogus. lldb-server definitely uses instruction emulation
on some architectures.

Modified:
lldb/trunk/source/API/SystemInitializerFull.cpp
lldb/trunk/source/Initialization/CMakeLists.txt
lldb/trunk/source/Initialization/SystemInitializerCommon.cpp

Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=359862&r1=359861&r2=359862&view=diff
==
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Fri May  3 00:11:43 2019
@@ -43,10 +43,7 @@
 #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
 #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
-#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
-#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
-#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #include "Plugins/Instruction/PPC64/EmulateInstructionPPC64.h"
 #include "Plugins/InstrumentationRuntime/ASan/ASanRuntime.h"
 #include 
"Plugins/InstrumentationRuntime/MainThreadChecker/MainThreadCheckerRuntime.h"
@@ -205,13 +202,8 @@ llvm::Error SystemInitializerFull::Initi
   SymbolFileSymtab::Initialize();
   UnwindAssemblyInstEmulation::Initialize();
   UnwindAssembly_x86::Initialize();
-
-  EmulateInstructionARM::Initialize();
   EmulateInstructionARM64::Initialize();
-  EmulateInstructionMIPS::Initialize();
-  EmulateInstructionMIPS64::Initialize();
   EmulateInstructionPPC64::Initialize();
-
   SymbolFileDWARFDebugMap::Initialize();
   ItaniumABILanguageRuntime::Initialize();
   AppleObjCRuntimeV2::Initialize();
@@ -312,13 +304,8 @@ void SystemInitializerFull::Terminate()
   SymbolFileSymtab::Terminate();
   UnwindAssembly_x86::Terminate();
   UnwindAssemblyInstEmulation::Terminate();
-
-  EmulateInstructionARM::Terminate();
   EmulateInstructionARM64::Terminate();
-  EmulateInstructionMIPS::Terminate();
-  EmulateInstructionMIPS64::Terminate();
   EmulateInstructionPPC64::Terminate();
-
   SymbolFileDWARFDebugMap::Terminate();
   ItaniumABILanguageRuntime::Terminate();
   AppleObjCRuntimeV2::Terminate();

Modified: lldb/trunk/source/Initialization/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/CMakeLists.txt?rev=359862&r1=359861&r2=359862&view=diff
==
--- lldb/trunk/source/Initialization/CMakeLists.txt (original)
+++ lldb/trunk/source/Initialization/CMakeLists.txt Fri May  3 00:11:43 2019
@@ -14,6 +14,9 @@ add_lldb_library(lldbInitialization
   LINK_LIBS
 lldbCore
 lldbHost
+lldbPluginInstructionARM
+lldbPluginInstructionMIPS
+lldbPluginInstructionMIPS64
 lldbPluginProcessGDBRemote
 ${EXTRA_PLUGINS}
 ${LLDB_SYSTEM_LIBS}

Modified: lldb/trunk/source/Initialization/SystemInitializerCommon.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Initialization/SystemInitializerCommon.cpp?rev=359862&r1=359861&r2=359862&view=diff
==
--- lldb/trunk/source/Initialization/SystemInitializerCommon.cpp (original)
+++ lldb/trunk/source/Initialization/SystemInitializerCommon.cpp Fri May  3 
00:11:43 2019
@@ -8,6 +8,9 @@
 
 #include "lldb/Initialization/SystemInitializerCommon.h"
 
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
@@ -96,6 +99,10 @@ llvm::Error SystemInitializerCommon::Ini
 
   process_gdb_remote::ProcessGDBRemoteLog::Initialize();
 
+  EmulateInstructionARM::Initialize();
+  EmulateInstructionMIPS::Initialize();
+  EmulateInstructionMIPS64::Initialize();
+
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -110,6 +117,10 @@ void SystemInitializerCommon::Terminate(
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);
 
+  EmulateInstructionARM::Terminate();
+  EmulateInstructionMIPS::Terminate();
+  EmulateInstructionMIPS64::Terminate();
+
 #if defined(_WIN32)
   ProcessWindowsLog::Terminate();
 #endif


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

[Lldb-commits] [lldb] r359867 - Split TestVLA into two and XFAIL one part

2019-05-03 Thread Pavel Labath via lldb-commits
Author: labath
Date: Fri May  3 01:06:28 2019
New Revision: 359867

URL: http://llvm.org/viewvc/llvm-project?rev=359867&view=rev
Log:
Split TestVLA into two and XFAIL one part

The part which checks whether vla_expr shows up in the variable list
does not pass on non-darwin platforms. Add the appropriate decorator.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=359867&r1=359866&r2=359867&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Fri May  3 
01:06:28 2019
@@ -1,6 +1,6 @@
 import lldb
 from lldbsuite.test.lldbtest import *
-from lldbsuite.test import decorators
+from lldbsuite.test.decorators import *
 import lldbsuite.test.lldbutil as lldbutil
 
 
@@ -8,8 +8,9 @@ class TestVLA(TestBase):
 
 mydir = TestBase.compute_mydir(__file__)
 
-@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0'])
-def test_vla(self):
+@skipIf(compiler="clang", compiler_version=['<', '8.0'])
+@expectedFailureAll(oslist=no_match(lldbplatformutil.getDarwinOSTriples()))
+def test_variable_list(self):
 self.build()
 _, process, _, _ = lldbutil.run_to_source_breakpoint(
 self, "break here", lldb.SBFileSpec('main.c'))
@@ -26,6 +27,12 @@ class TestVLA(TestBase):
 for value in all_locals:
 self.assertFalse("vla_expr" in value.name)
 
+@decorators.skipIf(compiler="clang", compiler_version=['<', '8.0'])
+def test_vla(self):
+self.build()
+_, process, _, _ = lldbutil.run_to_source_breakpoint(
+self, "break here", lldb.SBFileSpec('main.c'))
+
 def test(a, array):
 for i in range(a):
 self.expect("fr v vla[%d]"%i, substrs=["int", "%d"%(a-i)])


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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

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

I think there is a problem with this patch. I don't believe the TestVLA part 
would work on any non-darwin platform (it doesn't on linux: 
http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/923), and it works 
on darwin only accidentally.

The reason the fails on linux is that we don't have a "language runtime" plugin 
for the "C" language, so there is noone to ask if the variable is a runtime 
support value, and so we return false from 
`ValueObject::IsRuntimeSupportValue`. I believe the reason this works on darwin 
is because `ValueObject::IsRuntimeSupportValue` has a fallback (not sure why) 
which explicitly asks for the ObjC runtime if the desired language is not 
present. On linux, we don't have an ObjC runtime..

I can think of a couple of solutions here (adding a C language runtime, 
defaulting to return  `IsArtificial` in ValueObject if no language runtime is 
present) but none of them seemed too obvious to commit straight-away, so I've 
disabled a part of that test for the time being (r359867). Nonetheless, could 
you please take a look at this problem?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61451



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-03 Thread Konrad Wilhelm Kleine via Phabricator via lldb-commits
kwk added a comment.

In D61440#1489064 , @teemperor wrote:

> Looks good now, thanks!


Thank you for being patient with me! Can you merge the change for me please? I 
don't have commit rights, yet.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61440



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


[Lldb-commits] [PATCH] D61481: [DWARF] Reimplement/simplify DWARFUnit::GetID

2019-05-03 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added subscribers: jdoerfert, arphaman.

The implementation of GetID used a relatively complicated algorithm,
which returned some kind of an offset of the unit in some file
(depending on the debug info flavour). The only thing this ID was used
for was to enable subseqent retrieval of the unit from the SymbolFile.

This can be made simpler if we just make the "ID" of the unit an index
into the list of the units belonging to the symbol file. We already
support indexed access to the units, so each unit already has a well
"index" -- this just makes it accessible from within the unit.

To make the distincion between "id" and "offset" clearer (and help catch
any misuses), I also rename DWARFDebugInfo::GetCompileUnit (which
accesses by offset) into DWARFDebugInfo::GetCompileUnitAtOffset.

On its own, this only brings a minor simplification, but it enables
further simplifications in the DIERef class (coming in a follow-up
patch).


https://reviews.llvm.org/D61481

Files:
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -692,8 +692,7 @@
 // Just a normal DWARF file whose user ID for the compile unit is the DWARF
 // offset itself
 
-DWARFUnit *dwarf_cu =
-info->GetCompileUnit((dw_offset_t)comp_unit->GetID());
+DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(comp_unit->GetID());
 if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
   dwarf_cu->SetUserData(comp_unit);
 return dwarf_cu;
@@ -781,7 +780,7 @@
 
   // Figure out the compile unit index if we weren't given one
   if (cu_idx == UINT32_MAX)
-DebugInfo()->GetCompileUnit(dwarf_cu->GetOffset(), &cu_idx);
+cu_idx = dwarf_cu->GetID();
 
   m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(
   cu_idx, cu_sp);
@@ -1764,7 +1763,7 @@
   } else {
 uint32_t cu_idx = DW_INVALID_INDEX;
 DWARFUnit *dwarf_cu =
-debug_info->GetCompileUnit(cu_offset, &cu_idx);
+debug_info->GetCompileUnitAtOffset(cu_offset, &cu_idx);
 if (dwarf_cu) {
   sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
   if (sc.comp_unit) {
@@ -3121,7 +3120,7 @@
 return num_variables;
   }
 } else if (sc.comp_unit) {
-  DWARFUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID());
+  DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(sc.comp_unit->GetID());
 
   if (dwarf_cu == NULL)
 return 0;
Index: source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
===
--- source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -55,7 +55,7 @@
   if (!cu_offset)
 return DIERef();
 
-  DWARFUnit *cu = m_debug_info.GetCompileUnit(*cu_offset);
+  DWARFUnit *cu = m_debug_info.GetCompileUnitAtOffset(*cu_offset);
   if (!cu)
 return DIERef();
 
@@ -164,7 +164,7 @@
 if (!ref)
   continue;
 
-DWARFUnit *cu = m_debug_info.GetCompileUnit(ref.cu_offset);
+DWARFUnit *cu = m_debug_info.GetCompileUnitAtOffset(ref.cu_offset);
 if (!cu || !cu->Supports_DW_AT_APPLE_objc_complete_type()) {
   incomplete_types.push_back(ref);
   continue;
Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -31,7 +31,7 @@
   eProcucerOther
 };
 
-class DWARFUnit {
+class DWARFUnit : public lldb_private::UserID {
   using die_iterator_range =
   llvm::iterator_range;
 
@@ -74,7 +74,6 @@
   virtual uint32_t GetHeaderByteSize() const = 0;
   // Offset of the initial length field.
   dw_offset_t GetOffset() const { return m_offset; }
-  lldb::user_id_t GetID() const;
   /// Get the size in bytes of the length field in the header.
   ///
   /// In DWARF32 this is just 4 bytes
@@ -169,7 +168,7 @@
   }
 
 protected:
-  DWARFUnit(SymbolFileDWARF *dwarf);
+  DWARFUnit(SymbolFileDWARF *dwarf, lldb::user_id_t uid);
 
   SymbolFileDWARF *m_dwarf = nullptr;
   std::unique_ptr m_dwo_symbol_file;
Index: source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
=

[Lldb-commits] [PATCH] D61482: [DWARF] Store compile unit IDs in the DIERef class

2019-05-03 Thread Pavel Labath via Phabricator via lldb-commits
labath created this revision.
labath added reviewers: JDevlieghere, clayborg, aprantl.
Herald added a subscriber: arphaman.

The offset of a compile unit is enough to identify in a section, but
things start to get a lot more complicated when you have multiple object
files, each with potentially several debug-info-carrying sections
floating around.

We were already pushing this concept to its limits split-dwarf, which
required juggling offsets of several units to get things to work.
However, this really become a problem when we tried to introduce
debug_types support, which resulted in a long series of attempts to
"concatenate" various debug info sections so that the unit offset
remains a valid identifier.

Instead of attempting to assign unique offsets to all units that we care
about, this patch does something more fundamental. We just admit that
using offsets as unique identifiers does not scale to all debug info
formats we want to support, and uses a different ID instead.

Decoupling the ID from the offset means the offset can be free to point
to the actual offset of the compile unit in the relevant section,
without any changes to low-level parsing code needed. And using a
surrogate ID means its much easier to map the compile units into a
single address space. At least two strategies are possible after this
patch:
a) map all relevant units into a single continuous sequence of integers
(as if the were all stored in one vector)
b) steal some bits from the cu_idx field and use it as some sort of a
discriminator (essentially creating multiple address spaces)

Additionally, this makes us better prepared for the future, where the
total size of debug info exceeds 4GB. It also simplifies code, as we can
treat different debug info flavours more uniformly.

This patch:

- renames the cu_offset field of DIERef to cu_idx and fixes all uses to treat 
it as such
- removes DWARFUnit::GetBaseObjOffset as it no longer serves any useful 
purpose. Instead the DWO unit is made to share the ID of the "base" unit, as 
they logically represent a single compilation.
- changes SymbolFileDWARFDwo to use the index of the contained unit as its ID 
(this is the same approach taken by SymbolFileDWARFDebugMap).
- has a longer commit message than the code it changes. :)


https://reviews.llvm.org/D61482

Files:
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
  source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -23,7 +23,7 @@
DWARFUnit *dwarf_cu)
 : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
   m_base_dwarf_cu(dwarf_cu) {
-  SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
+  SetID(((lldb::user_id_t)dwarf_cu->GetID()) << 32);
 }
 
 void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
@@ -158,6 +158,6 @@
 
 DWARFDIE
 SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
-  lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
+  assert(m_base_dwarf_cu->GetID() == die_ref.cu_idx);
   return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
 }
Index: source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
===
--- source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -38,13 +38,13 @@
   return m_map.GetValues(regex, info_array);
 }
 
-size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_offset,
+size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_idx,
DIEArray &info_array) const {
   const size_t initial_size = info_array.size();
   const uint32_t size = m_map.GetSize();
   for (uint32_t i = 0; i < size; ++i) {
 const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i);
-if (cu_offset == die_ref.cu_offset)
+if (cu_idx == die_ref.cu_idx)
   info_array.push_back(die_ref);
   }
   return info_array.size() - initial_size;
@@ -56,7 +56,7 @@
 ConstString cstr = m_map.GetCStringAtIndex(i);
 const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i);
 s->Printf("%p: {0x%8.8x/0x%8.8x} \"%s\"\n", (const void *)cstr.GetCString(),
-  die_ref.cu_offset, die_ref.die_offset, cstr.GetCString());
+  die_ref.cu_idx, die_ref.die_offset, cstr.GetCString());
   

[Lldb-commits] [PATCH] D61482: [DWARF] Store compile unit IDs in the DIERef class

2019-05-03 Thread Pavel Labath via Phabricator via lldb-commits
labath updated this revision to Diff 197936.
labath added a comment.

Fix two more things I noticed when looking at the patch in phab:

- incorrect use of unit offset in DIERef constructor in the DebugMap case (I'm 
guessing this didn't cause any test failures because both offsets and IDs are 
generally zero there).
- incorrect local variable name in ManualDWARFIndex (NFC)


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

https://reviews.llvm.org/D61482

Files:
  source/Plugins/SymbolFile/DWARF/DIERef.cpp
  source/Plugins/SymbolFile/DWARF/DIERef.h
  source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
  source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
  source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Index: source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -23,7 +23,7 @@
DWARFUnit *dwarf_cu)
 : SymbolFileDWARF(objfile.get()), m_obj_file_sp(objfile),
   m_base_dwarf_cu(dwarf_cu) {
-  SetID(((lldb::user_id_t)dwarf_cu->GetOffset()) << 32);
+  SetID(((lldb::user_id_t)dwarf_cu->GetID()) << 32);
 }
 
 void SymbolFileDWARFDwo::LoadSectionData(lldb::SectionType sect_type,
@@ -158,6 +158,6 @@
 
 DWARFDIE
 SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
-  lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
+  assert(m_base_dwarf_cu->GetID() == die_ref.cu_idx);
   return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
 }
Index: source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
===
--- source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -38,13 +38,13 @@
   return m_map.GetValues(regex, info_array);
 }
 
-size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_offset,
+size_t NameToDIE::FindAllEntriesForCompileUnit(dw_offset_t cu_idx,
DIEArray &info_array) const {
   const size_t initial_size = info_array.size();
   const uint32_t size = m_map.GetSize();
   for (uint32_t i = 0; i < size; ++i) {
 const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i);
-if (cu_offset == die_ref.cu_offset)
+if (cu_idx == die_ref.cu_idx)
   info_array.push_back(die_ref);
   }
   return info_array.size() - initial_size;
@@ -56,7 +56,7 @@
 ConstString cstr = m_map.GetCStringAtIndex(i);
 const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i);
 s->Printf("%p: {0x%8.8x/0x%8.8x} \"%s\"\n", (const void *)cstr.GetCString(),
-  die_ref.cu_offset, die_ref.die_offset, cstr.GetCString());
+  die_ref.cu_idx, die_ref.die_offset, cstr.GetCString());
   }
 }
 
Index: source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
===
--- source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
+++ source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.h
@@ -60,7 +60,7 @@
   static void
   IndexUnitImpl(DWARFUnit &unit, const lldb::LanguageType cu_language,
 const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
-const dw_offset_t cu_offset, IndexSet &set);
+IndexSet &set);
 
   /// Non-null value means we haven't built the index yet.
   DWARFDebugInfo *m_debug_info;
Index: source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
===
--- source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -102,19 +102,19 @@
   const LanguageType cu_language = unit.GetLanguageType();
   DWARFFormValue::FixedFormSizes fixed_form_sizes = unit.GetFixedFormSizes();
 
-  IndexUnitImpl(unit, cu_language, fixed_form_sizes, unit.GetOffset(), set);
+  IndexUnitImpl(unit, cu_language, fixed_form_sizes, set);
 
   SymbolFileDWARFDwo *dwo_symbol_file = unit.GetDwoSymbolFile();
   if (dwo_symbol_file && dwo_symbol_file->GetCompileUnit()) {
 IndexUnitImpl(*dwo_symbol_file->GetCompileUnit(), cu_language,
-  fixed_form_sizes, unit.GetOffset(), set);
+  fixed_form_sizes, set);
   }
 }
 
 void ManualDWARFIndex::IndexUnitImpl(
 DWARFUnit &unit, const LanguageType cu_language,
-const DWARFFormValue::FixedFormSizes &fixed_form_sizes,
-const dw_offset_t cu_offset, IndexSet &set) {
+const DWARFFormValue::FixedFormSizes &fixed_form_sizes, IndexSet &set) {
+  user_id_t unit_id = unit.GetID();
   for (const DWARFDebugInfoEntry &die : unit.dies(

[Lldb-commits] [PATCH] D61478: Move decl completion out of the ASTImporterDelegate and document it [NFC]

2019-05-03 Thread Gabor Marton via Phabricator via lldb-commits
martong added a comment.

This is a good patch, it is good to separate responsibilities and it makes 
cleaner how the clang::ASTImporter is used.




Comment at: lldb/source/Symbol/ClangASTImporter.cpp:250
+/// imported while completing the original Decls).
+class DeportQueueScope : public ClangASTImporter::NewDeclListener {
+  ClangASTImporter::ImporterDelegateSP m_delegate;

The verb `deport` is pretty vague in this context for me. Actually, what this 
class does is importing missing members and methods of classes. Perhaps a 
better name could be `ImportMembersQueueScope` ?
I still don't understand why is it needed to import the members in two steps in 
LLDB: 1. import the class itself without members 2. import the members. So 
perhaps we could have some documentation about that too here.



Comment at: lldb/source/Symbol/ClangASTImporter.cpp:324
+
+NamedDecl *to_named_decl = dyn_cast(to);
+// Check if we already deported this type.

Would it make sense to filter out those TagDecls which are already completed?
E.g.:
```
if (TagDecl *to_tag_decl = dyn_cast(to))
  if (to_tag_decl->isCompleteDefinition()) // skip tags which are already 
completed
return;
```
Or this would not work because there are cases when the tag is completed, but 
the members are still missing? If that is the case could you please document 
that here too?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61478



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


[Lldb-commits] [lldb] r359868 - C.128 override, virtual keyword handling

2019-05-03 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Fri May  3 03:03:28 2019
New Revision: 359868

URL: http://llvm.org/viewvc/llvm-project?rev=359868&view=rev
Log:
C.128 override, virtual keyword handling

Summary:
According to [C128] "Virtual functions should specify exactly one
of `virtual`, `override`, or `final`", I've added override where a
virtual function is overriden but the explicit `override` keyword
was missing. Whenever both `virtual` and `override` were specified,
I removed `virtual`. As C.128 puts it:

> [...] writing more than one of these three is both redundant and
> a potential source of errors.

I anticipate a discussion about whether or not to add `override` to
destructors but I went for it because of an example in [ISOCPP1000].
Let me repeat the comment for you here:

Consider this code:

```
struct Base {
  virtual ~Base(){}
};

struct SubClass : Base {
  ~SubClass() {
std::cout << "It works!\n";
  }
};

int main() {
  std::unique_ptr ptr = std::make_unique();
}
```

If for some odd reason somebody removes the `virtual` keyword from the
`Base` struct, the code will no longer print `It works!`. So adding
`override` to destructors actively protects us from accidentally
breaking our code at runtime.

[C128]: 
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c128-virtual-functions-should-specify-exactly-one-of-virtual-override-or-final
[ISOCPP1000]: 
https://github.com/isocpp/CppCoreGuidelines/issues/1000#issuecomment-476951555

Reviewers: teemperor, JDevlieghere, davide, shafik

Reviewed By: teemperor

Subscribers: kwk, arphaman, kadircet, lldb-commits

Tags: #lldb

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

Modified:
lldb/trunk/include/lldb/Core/Architecture.h
lldb/trunk/include/lldb/Core/StreamBuffer.h
lldb/trunk/include/lldb/Core/ValueObjectVariable.h
lldb/trunk/include/lldb/Target/DynamicLoader.h
lldb/trunk/include/lldb/Target/StackFrameRecognizer.h
lldb/trunk/include/lldb/Target/StructuredDataPlugin.h
lldb/trunk/include/lldb/Utility/Baton.h
lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
lldb/trunk/include/lldb/Utility/StringExtractorGDBRemote.h
lldb/trunk/source/API/SBBreakpointOptionCommon.h

lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp

lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp

lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Symbol/PostfixExpression.cpp
lldb/trunk/source/Target/StructuredDataPlugin.cpp
lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp
lldb/trunk/unittests/Editline/EditlineTest.cpp
lldb/trunk/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
lldb/trunk/unittests/Symbol/TestClangASTContext.cpp
lldb/trunk/unittests/Target/ProcessInstanceInfoTest.cpp

Modified: lldb/trunk/include/lldb/Core/Architecture.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Architecture.h?rev=359868&r1=359867&r2=359868&view=diff
==
--- lldb/trunk/include/lldb/Core/Architecture.h (original)
+++ lldb/trunk/include/lldb/Core/Architecture.h Fri May  3 03:03:28 2019
@@ -16,7 +16,7 @@ namespace lldb_private {
 class Architecture : public PluginInterface {
 public:
   Architecture() = default;
-  virtual ~Architecture() = default;
+  ~Architecture() override = default;
 
   /// This is currently intended to handle cases where a
   /// program stops at an instruction that won't get executed and it

Modified: lldb/trunk/include/lldb/Core/StreamBuffer.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/StreamBuffer.h?rev=359868&r1=359867&r2=359868&view=diff
=

[Lldb-commits] [PATCH] D61473: ExpressionParser: only force link MCJIT when needed

2019-05-03 Thread Pavel Labath via Phabricator via lldb-commits
labath requested changes to this revision.
labath added a comment.
This revision now requires changes to proceed.

Did you run the test suite with this change? I get about 200 failures 
(non-shlib build), which is not surprising as without this lldb will not 
actually have a jit engine to evaluate the expressions with.

The best thing to do here would be make sure lldb-server never even pulls the 
ClangExpressionParser library into its dependency graph, but in the current 
state of the graph, that would likely take the rest of this year. So given the 
simplicity of this change, and the amount of code it saves us, I think we could 
settle for something slightly sub-optimal, but which will still produce the 
desired effect.

What I propose is to move this header into the SystemInitializerFull class. 
That should still result in MCJIT being linked into liblldb (as it should be), 
but exclude it from lldb-server. The SystemInitializerFull class is a slightly 
odd place for this, but *only* slightly, because it's where we do the rest of 
llvm initialization (`llvm::InitializeAllTargets()` and friends), and the 
nature of this header is very initialization-like.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61473



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


[Lldb-commits] [PATCH] D61440: C.128 override, virtual keyword handling

2019-05-03 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL359868: C.128 override, virtual keyword handling (authored 
by teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61440?vs=197922&id=197941#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61440

Files:
  lldb/trunk/include/lldb/Core/Architecture.h
  lldb/trunk/include/lldb/Core/StreamBuffer.h
  lldb/trunk/include/lldb/Core/ValueObjectVariable.h
  lldb/trunk/include/lldb/Target/DynamicLoader.h
  lldb/trunk/include/lldb/Target/StackFrameRecognizer.h
  lldb/trunk/include/lldb/Target/StructuredDataPlugin.h
  lldb/trunk/include/lldb/Utility/Baton.h
  lldb/trunk/include/lldb/Utility/DataBufferLLVM.h
  lldb/trunk/include/lldb/Utility/StringExtractorGDBRemote.h
  lldb/trunk/source/API/SBBreakpointOptionCommon.h
  
lldb/trunk/source/Plugins/DynamicLoader/Darwin-Kernel/DynamicLoaderDarwinKernel.cpp
  lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.h
  lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOS.h
  lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangDiagnostic.h
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/trunk/source/Plugins/Language/CPlusPlus/CPlusPlusLanguage.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.h
  lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/RenderScript/RenderScriptRuntime/RenderScriptExpressionOpts.h
  lldb/trunk/source/Plugins/ObjectFile/PECOFF/ObjectFilePECOFF.h
  lldb/trunk/source/Plugins/Platform/gdb-server/PlatformRemoteGDBServer.h
  lldb/trunk/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
  lldb/trunk/source/Plugins/Process/minidump/ProcessMinidump.cpp
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.cpp
  lldb/trunk/source/Plugins/StructuredData/DarwinLog/StructuredDataDarwinLog.h
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Symbol/PostfixExpression.cpp
  lldb/trunk/source/Target/StructuredDataPlugin.cpp
  lldb/trunk/tools/intel-features/intel-mpx/cli-wrapper-mpxtable.cpp
  lldb/trunk/unittests/Editline/EditlineTest.cpp
  lldb/trunk/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
  lldb/trunk/unittests/Symbol/TestClangASTContext.cpp
  lldb/trunk/unittests/Target/ProcessInstanceInfoTest.cpp

Index: lldb/trunk/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
===
--- lldb/trunk/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
+++ lldb/trunk/unittests/Process/gdb-remote/GDBRemoteClientBaseTest.cpp
@@ -29,11 +29,11 @@
   unsigned stop_reply_called = 0;
   std::vector structured_data_packets;
 
-  void HandleAsyncStdout(llvm::StringRef out) { output += out; }
-  void HandleAsyncMisc(llvm::StringRef data) { misc_data += data; }
-  void HandleStopReply() { ++stop_reply_called; }
+  void HandleAsyncStdout(llvm::StringRef out) override { output += out; }
+  void HandleAsyncMisc(llvm::StringRef data) override { misc_data += data; }
+  void HandleStopReply() override { ++stop_reply_called; }
 
-  void HandleAsyncStructuredDataPacket(llvm::StringRef data) {
+  void HandleAsyncStructuredDataPacket(llvm::StringRef data) override {
 structured_data_packets.push_back(data);
   }
 };
Index: lldb/trunk/unittests/Symbol/TestClangASTContext.cpp
===
--- lldb/trunk/unittests/Symbol/TestClangASTContext.cpp
+++ lldb/trunk/unittests/Symbol/TestClangASTContext.cpp
@@ -34,12 +34,12 @@
 FileSystem::Terminate();
   }
 
-  virtual void SetUp() override {
+  void SetUp() override {
 std::string triple = HostInfo::GetTargetTriple();
 m_ast.reset(new ClangASTContext(triple.c_str()));
   }
 
-  virtual void TearDown() override { m_ast.reset(); }
+  void TearDown() override { m_ast.reset(); }
 
 protected:
   std::unique_ptr m_ast;
Index: lldb/trunk/unittests/Editline/EditlineTest.cpp
===
--- lldb/trunk/unittests/Editline/EditlineTest.cpp
+++ lldb/trunk/unittests/Editline/EditlineTest.cpp
@@ -250,7 +250,7 @@
 setenv("TERM", "vt100", 1);
   }
 
-  void SetUp() {
+  void SetUp() override {
 FileSystem::Initialize();
 
 // Validate the editline adapter.
@@ -263,7 +263,7 @@
 std::make_shared([&] { _el_adapter.ConsumeAllOutput(); });
   }
 
-  void TearDown() {
+  void TearDown() override {
 _el_adapter.CloseInput();
 if (_sp_output_thread)
   _sp_output_thread->join();
Index: lldb/trunk/unittests/Target/ProcessInstanceInfoTest.

[Lldb-commits] [PATCH] D61483: [www] list command: lldb run

2019-05-03 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.
kwk edited the summary of this revision.
kkleine updated this revision to Diff 197943.
kkleine added a comment.

Amend previous commit with copy paste error.


The `run` command is only an abbreviation for the more verbose `process
launch -- ` but it works just as with GDB and therefore should be
mentioned in the GDB to LLDB command map.

Here's the help documentation for the `run` command in lldb which gives
proof:

  (lldb) help run
   Launch the executable in the debugger.
  
  Syntax: run []
  
  Command Options Usage:
run []
  
  'run' is an abbreviation for 'process launch -c /bin/sh --'


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D61483

Files:
  lldb/www/lldb-gdb.html


Index: lldb/www/lldb-gdb.html
===
--- lldb/www/lldb-gdb.html
+++ lldb/www/lldb-gdb.html
@@ -58,6 +58,7 @@
 (gdb) r 
 
 
+(lldb) run 
 (lldb) process launch -- 
 (lldb) r 
 


Index: lldb/www/lldb-gdb.html
===
--- lldb/www/lldb-gdb.html
+++ lldb/www/lldb-gdb.html
@@ -58,6 +58,7 @@
 (gdb) r 
 
 
+(lldb) run 
 (lldb) process launch -- 
 (lldb) r 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61483: [www] list command: lldb run

2019-05-03 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine updated this revision to Diff 197943.
kkleine added a comment.

Amend previous commit with copy paste error.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61483

Files:
  lldb/www/lldb-gdb.html


Index: lldb/www/lldb-gdb.html
===
--- lldb/www/lldb-gdb.html
+++ lldb/www/lldb-gdb.html
@@ -58,6 +58,7 @@
 (gdb) r 
 
 
+(lldb) run 
 (lldb) process launch -- 
 (lldb) r 
 


Index: lldb/www/lldb-gdb.html
===
--- lldb/www/lldb-gdb.html
+++ lldb/www/lldb-gdb.html
@@ -58,6 +58,7 @@
 (gdb) r 
 
 
+(lldb) run 
 (lldb) process launch -- 
 (lldb) r 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61483: [www] list command: lldb run

2019-05-03 Thread Konrad Kleine via Phabricator via lldb-commits
kkleine updated this revision to Diff 197944.
kkleine added a comment.

- [www] move `run ` command down for educational purposes


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61483

Files:
  lldb/www/lldb-gdb.html


Index: lldb/www/lldb-gdb.html
===
--- lldb/www/lldb-gdb.html
+++ lldb/www/lldb-gdb.html
@@ -59,6 +59,7 @@
 
 
 (lldb) process launch -- 
+(lldb) run 
 (lldb) r 
 
 


Index: lldb/www/lldb-gdb.html
===
--- lldb/www/lldb-gdb.html
+++ lldb/www/lldb-gdb.html
@@ -59,6 +59,7 @@
 
 
 (lldb) process launch -- 
+(lldb) run 
 (lldb) r 
 
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61483: [www] list command: lldb run

2019-05-03 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor accepted this revision.
teemperor added a comment.
This revision is now accepted and ready to land.

LGTM, seems consistent with the row above


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61483



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


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

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

- Log and do not assert anywhere


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61438

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

Index: lldb/source/Symbol/CxxModuleHandler.cpp
===
--- lldb/source/Symbol/CxxModuleHandler.cpp
+++ lldb/source/Symbol/CxxModuleHandler.cpp
@@ -9,6 +9,7 @@
 #include "lldb/Symbol/CxxModuleHandler.h"
 
 #include "lldb/Symbol/ClangASTContext.h"
+#include "lldb/Utility/Log.h"
 #include "clang/Sema/Lookup.h"
 #include "llvm/Support/Error.h"
 
@@ -214,12 +215,16 @@
   // Import the foreign template arguments.
   llvm::SmallVector imported_args;
 
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+
   // If this logic is changed, also update templateArgsAreSupported.
   for (const TemplateArgument &arg : foreign_args.asArray()) {
 switch (arg.getKind()) {
 case TemplateArgument::Type: {
-  llvm::Expected type = m_importer->Import_New(arg.getAsType());
+  llvm::Expected type = m_importer->Import(arg.getAsType());
   if (!type) {
+if (log)
+  log->Printf("Couldn't import type!");
 llvm::consumeError(type.takeError());
 return {};
   }
@@ -229,8 +234,10 @@
 case TemplateArgument::Integral: {
   llvm::APSInt integral = arg.getAsIntegral();
   llvm::Expected type =
-  m_importer->Import_New(arg.getIntegralType());
+  m_importer->Import(arg.getIntegralType());
   if (!type) {
+if (log)
+  log->Printf("Couldn't import type!");
 llvm::consumeError(type.takeError());
 return {};
   }
Index: lldb/source/Symbol/ClangASTImporter.cpp
===
--- lldb/source/Symbol/ClangASTImporter.cpp
+++ lldb/source/Symbol/ClangASTImporter.cpp
@@ -62,8 +62,16 @@
 
   ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
-  if (delegate_sp)
-return delegate_sp->Import(type);
+  if (delegate_sp) {
+if (llvm::Expected ret_or_error = delegate_sp->Import(type))
+  return *ret_or_error;
+else {
+  if (Log *log =
+  lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS))
+log->Printf("Couldn't import type!");
+  llvm::consumeError(ret_or_error.takeError());
+}
+  }
 
   return QualType();
 }
@@ -106,7 +114,7 @@
   ASTImporterDelegate::CxxModuleScope std_scope(*delegate_sp, dst_ast);
 
   if (delegate_sp) {
-clang::Decl *result = delegate_sp->Import(decl);
+llvm::Expected result = delegate_sp->Import(decl);
 
 if (!result) {
   Log *log(lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS));
@@ -127,9 +135,13 @@
   "metadata 0x%" PRIx64,
   decl->getDeclKindName(), user_id);
   }
+
+  llvm::consumeError(result.takeError());
+
+  return nullptr;
 }
 
-return result;
+return *result;
   }
 
   return nullptr;
@@ -641,7 +653,11 @@
 TagDecl *origin_tag_decl = llvm::dyn_cast(decl_origin.decl);
 
 for (Decl *origin_child_decl : origin_tag_decl->decls()) {
-  delegate_sp->Import(origin_child_decl);
+  llvm::Expected imported_or_err =
+  delegate_sp->Import(origin_child_decl);
+  if (!imported_or_err)
+// FIXME return with false?
+consumeError(imported_or_err.takeError());
 }
 
 if (RecordDecl *record_decl = dyn_cast(origin_tag_decl)) {
@@ -666,7 +682,11 @@
   llvm::dyn_cast(decl_origin.decl);
 
   for (Decl *origin_child_decl : origin_interface_decl->decls()) {
-delegate_sp->Import(origin_child_decl);
+llvm::Expected imported_or_err =
+delegate_sp->Import(origin_child_decl);
+if (!imported_or_err)
+  // FIXME return with false?
+  consumeError(imported_or_err.takeError());
   }
 
   return true;
@@ -919,7 +939,15 @@
   to_cxx_record->startDefinition();
   */
 
-  ImportDefinition(from);
+  Log *log = lldb_private::GetLogIfAllCategoriesSet(LIBLLDB_LOG_EXPRESSIONS);
+
+  llvm::Error Err = ImportDefinition(from);
+  if (Err) {
+if (log)
+  log->Printf("[ClangASTImporter] Error during importing definition!");
+return;
+  }
+
 
   if (clang::TagDecl *to_tag = dyn_cast(to)) {
 if (clang::TagDecl *from_tag = dyn_cast(from)) {
@@ -949,13 +977,18 @@
   if 

[Lldb-commits] [PATCH] D61483: [www] list command: lldb run

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

This is the old documentation. You should edit the new one in 
`docs/use/map.rst`.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61483



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


[Lldb-commits] [PATCH] D61018: RegisterContextLLDB: Push CFA value on DWARF stack when evaluating register expressions

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

Jason, could you take a quick look at this. I don't expect this to be too 
contentious...


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

https://reviews.llvm.org/D61018



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


[Lldb-commits] [PATCH] D61498: 01/06: Merge GetCompileUnit + GetCompileUnitContainingDIEOffset

2019-05-03 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, JDevlieghere.
jankratochvil added a project: LLDB.
Herald added a subscriber: abidh.

These two methods are very similar and various refactorizations need to modify 
both similar ways. Merge them as a template.

One could also just remove `GetCompileUnit` and make 
`GetCompileUnitContainingDIEOffset` to also accept offset of the CU itself 
(currently it accepts only DIE offsets after the CU header). But that would be 
less safe regarding some internal sanity checking.

The whole patchset available for testing as: `git clone -b debugtypes 
git://git.jankratochvil.net/lldb`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61498

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h

Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
@@ -74,7 +74,46 @@
   // accessors are called.
   void ParseCompileUnitHeadersIfNeeded();
 
+  template
+  DWARFUnit *GetCompileUnitTmpl(
+  Contains contains, dw_offset_t offset, uint32_t *idx_ptr = NULL);
+
   DISALLOW_COPY_AND_ASSIGN(DWARFDebugInfo);
 };
 
+template
+DWARFUnit *DWARFDebugInfo::GetCompileUnitTmpl(
+Contains contains, dw_offset_t offset, uint32_t *idx_ptr) {
+  ParseCompileUnitHeadersIfNeeded();
+
+  DWARFUnitSP cu_sp;
+
+  // Watch out for single compile unit executable as they are pretty common
+  const size_t num_cus = m_compile_units.size();
+  if (num_cus == 1) {
+if (contains(*m_compile_units[0], offset)) {
+  if (idx_ptr)
+*idx_ptr = 0;
+  return m_compile_units[0].get();
+}
+  } else if (num_cus) {
+CompileUnitColl::const_iterator end_pos = m_compile_units.end();
+CompileUnitColl::const_iterator begin_pos = m_compile_units.begin();
+CompileUnitColl::const_iterator pos = std::upper_bound(
+begin_pos, end_pos, offset, OffsetLessThanCompileUnitOffset);
+if (pos != begin_pos) {
+  --pos;
+  if (contains(**pos, offset)) {
+if (idx_ptr)
+  *idx_ptr = pos - begin_pos;
+return (*pos).get();
+  }
+}
+  }
+
+  if (idx_ptr)
+*idx_ptr = DW_INVALID_INDEX;
+  return nullptr;
+}
+
 #endif // SymbolFileDWARF_DWARFDebugInfo_h_
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
@@ -125,35 +125,10 @@
 
 DWARFUnit *DWARFDebugInfo::GetCompileUnit(dw_offset_t cu_offset,
  uint32_t *idx_ptr) {
-  DWARFUnitSP cu_sp;
-  uint32_t cu_idx = DW_INVALID_INDEX;
-  if (cu_offset != DW_INVALID_OFFSET) {
-ParseCompileUnitHeadersIfNeeded();
-
-// Watch out for single compile unit executable as they are pretty common
-const size_t num_cus = m_compile_units.size();
-if (num_cus == 1) {
-  if (m_compile_units[0]->GetOffset() == cu_offset) {
-cu_sp = m_compile_units[0];
-cu_idx = 0;
-  }
-} else if (num_cus) {
-  CompileUnitColl::const_iterator end_pos = m_compile_units.end();
-  CompileUnitColl::const_iterator begin_pos = m_compile_units.begin();
-  CompileUnitColl::const_iterator pos = std::upper_bound(
-  begin_pos, end_pos, cu_offset, OffsetLessThanCompileUnitOffset);
-  if (pos != begin_pos) {
---pos;
-if ((*pos)->GetOffset() == cu_offset) {
-  cu_sp = *pos;
-  cu_idx = std::distance(begin_pos, pos);
-}
-  }
-}
-  }
-  if (idx_ptr)
-*idx_ptr = cu_idx;
-  return cu_sp.get();
+  return GetCompileUnitTmpl(
+  [](const DWARFUnit &unit, dw_offset_t cu_offset) {
+return unit.GetOffset() == cu_offset;
+  }, cu_offset, idx_ptr);
 }
 
 DWARFUnit *DWARFDebugInfo::GetCompileUnit(const DIERef &die_ref) {
@@ -165,28 +140,10 @@
 
 DWARFUnit *
 DWARFDebugInfo::GetCompileUnitContainingDIEOffset(dw_offset_t die_offset) {
-  ParseCompileUnitHeadersIfNeeded();
-
-  DWARFUnitSP cu_sp;
-
-  // Watch out for single compile unit executable as they are pretty common
-  const size_t num_cus = m_compile_units.size();
-  if (num_cus == 1) {
-if (m_compile_units[0]->ContainsDIEOffset(die_offset))
-  return m_compile_units[0].get();
-  } else if (num_cus) {
-CompileUnitColl::const_iterator end_pos = m_compile_units.end();
-CompileUnitColl::const_iterator begin_pos = m_compile_units.begin();
-CompileUnitColl::const_iterator pos = std::upper_bound(
-begin_pos, end_pos, die_offset, OffsetLessThanCompileUnitOffset);
-if (pos != begin_pos) {
-  --pos;
-  if ((*pos)->ContainsDIEOffset(die_offset))
-return (*pos).get();
-}
-  }
-
-  return nullptr;
+  

[Lldb-commits] [PATCH] D61501: 02/06: Finish renaming CompileUnit->Unit

2019-05-03 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, JDevlieghere.
jankratochvil added a project: LLDB.
Herald added subscribers: lldb-commits, jdoerfert, abidh, arphaman, aprantl.

D42892  changed a lot of code to use 
superclass `DWARFUnit` instead of its subclass `DWARFCompileUnit`.

Finish this change more thoroughly for any `*CompileUnit*`->`*Unit*` names. 
Later patch will introduce `DWARFTypeUnit` which needs to be sometimes 
different from `DWARFCompileUnit` and it would be confusing without this 
renaming.

The whole patchset available for testing as: `git clone -b debugtypes 
git://git.jankratochvil.net/lldb`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61501

Files:
  lldb/source/Plugins/SymbolFile/DWARF/AppleDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugAranges.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -56,7 +56,7 @@
 DWARFUnit *SymbolFileDWARFDwo::GetCompileUnit() {
   // Only dwo files with 1 compile unit is supported
   if (GetNumCompileUnits() == 1)
-return DebugInfo()->GetCompileUnitAtIndex(0);
+return DebugInfo()->GetUnitAtIndex(0);
   else
 return nullptr;
 }
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -301,13 +301,13 @@
 if (dwarf_cu == 0)
   return 0;
 GetTypes(dwarf_cu->DIE(), dwarf_cu->GetOffset(),
- dwarf_cu->GetNextCompileUnitOffset(), type_mask, type_set);
+ dwarf_cu->GetNextUnitOffset(), type_mask, type_set);
   } else {
 DWARFDebugInfo *info = DebugInfo();
 if (info) {
-  const size_t num_cus = info->GetNumCompileUnits();
+  const size_t num_cus = info->GetNumUnits();
   for (size_t cu_idx = 0; cu_idx < num_cus; ++cu_idx) {
-dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
+dwarf_cu = info->GetUnitAtIndex(cu_idx);
 if (dwarf_cu) {
   GetTypes(dwarf_cu->DIE(), 0, UINT32_MAX, type_mask, type_set);
 }
@@ -693,7 +693,7 @@
 // offset itself
 
 DWARFUnit *dwarf_cu =
-info->GetCompileUnit((dw_offset_t)comp_unit->GetID());
+info->GetUnit((dw_offset_t)comp_unit->GetID());
 if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
   dwarf_cu->SetUserData(comp_unit);
 return dwarf_cu;
@@ -781,7 +781,7 @@
 
   // Figure out the compile unit index if we weren't given one
   if (cu_idx == UINT32_MAX)
-DebugInfo()->GetCompileUnit(dwarf_cu->GetOffset(), &cu_idx);
+DebugInfo()->GetUnit(dwarf_cu->GetOffset(), &cu_idx);
 
   m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(
   cu_idx, cu_sp);
@@ -797,7 +797,7 @@
 uint32_t SymbolFileDWARF::GetNumCompileUnits() {
   DWARFDebugInfo *info = DebugInfo();
   if (info)
-return info->GetNumCompileUnits();
+return info->GetNumUnits();
   return 0;
 }
 
@@ -806,7 +806,7 @@
   CompUnitSP cu_sp;
   DWARFDebugInfo *info = DebugInfo();
   if (info) {
-DWARFUnit *dwarf_cu = info->GetCompileUnitAtIndex(cu_idx);
+DWARFUnit *dwarf_cu = info->GetUnitAtIndex(cu_idx);
 if (dwarf_cu)
   cu_sp = ParseCompileUnit(dwarf_cu, cu_idx);
   }
@@ -1599,7 +1599,7 @@
 
   const uint32_t num_compile_units = GetNumCompileUnits();
   for (uint32_t cu_idx = 0; cu_idx < num_compile_units; ++cu_idx) {
-DWARFUnit *dwarf_cu = debug_info->GetCompileUnitAtIndex(cu_idx);
+DWARFUnit *dwarf_cu = debug_info->GetUnitAtIndex(cu_idx);
 
 const DWARFBaseDIE die = dwarf_cu->GetUnitDIEOnly();
 if (die && !die.HasChildren()) {
@@ -1764,7 +1764,7 @@
   } else {
 uint32_t cu_idx = DW_INVALID_INDEX;
 DWARFUnit *dwarf_cu =
-debug_info->GetCompileUnit(cu_offset, &cu_idx);
+debug_info->GetUnit(cu_offset, &cu_idx);
 if (dwarf_cu) {
   sc.comp_unit = GetCompUnitForDWARFCompUnit(d

[Lldb-commits] [PATCH] D61502: 03/06: New CUDIERef

2019-05-03 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, JDevlieghere.
jankratochvil added a project: LLDB.
Herald added a subscriber: aprantl.

New `CUDIERef` contains `DWARFUnit *` + `dw_offset_t`; compared to `DIERef` 
which contains the CU as `dw_offset_t` which is difficult to use/lookup.

It is required as so far `dw_offset_t` was global for the whole 
`SymbolFileDWARF` but with `.debug_types` the same `dw_offset_t` may mean two 
different things depending on its section (=CU).

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

The whole patchset available for testing as: `git clone -b debugtypes 
git://git.jankratochvil.net/lldb`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61502

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

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -3309,7 +3309,7 @@
 }
   } break;
   case DW_AT_specification:
-spec_die = GetDIE(DIERef(form_value));
+spec_die = form_value.Reference().GetDIE();
 break;
   case DW_AT_start_scope: {
 if (form_value.Form() == DW_FORM_sec_offset) {
@@ -3584,13 +3584,12 @@
 case DW_TAG_subprogram:
 case DW_TAG_inlined_subroutine:
 case DW_TAG_lexical_block: {
-  if (die.GetAttributeValueAsReference(
-  DW_AT_specification, DW_INVALID_OFFSET) == spec_block_die_offset)
+  if (die.GetAttributeValueAsCUDIERef(
+  DW_AT_specification).DIEOffset() == spec_block_die_offset)
 return die;
 
-  if (die.GetAttributeValueAsReference(DW_AT_abstract_origin,
-   DW_INVALID_OFFSET) ==
-  spec_block_die_offset)
+  if (die.GetAttributeValueAsCUDIERef(
+  DW_AT_abstract_origin).DIEOffset() == spec_block_die_offset)
 return die;
 } break;
 }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -550,12 +550,10 @@
 if (die_offset == (*pos).GetOffset())
   return DWARFDIE(this, &(*pos));
   }
-} else {
-  // Don't specify the compile unit offset as we don't know it because the
-  // DIE belongs to
-  // a different compile unit in the same symbol file.
-  return m_dwarf->DebugInfo()->GetDIEForDIEOffset(die_offset);
-}
+} else
+  GetSymbolFileDWARF()->GetObjectFile()->GetModule()->ReportError(
+  "GetDIE for DIE 0x%" PRIx32 " is outside of its CU 0x%" PRIx32,
+  die_offset, GetOffset());
   }
   return DWARFDIE(); // Not found
 }
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
@@ -14,6 +14,7 @@
 
 class DWARFUnit;
 class SymbolFileDWARF;
+class DWARFDIE;
 
 class DWARFFormValue {
 public:
@@ -54,10 +55,25 @@
 eValueTypeBlock
   };
 
+  class CUDIERef {
+  public:
+CUDIERef(const DWARFUnit *cu, dw_offset_t die_offset)
+: m_cu(cu), m_die_offset(die_offset) {
+  assert(m_cu != nullptr);
+}
+CUDIERef() : m_cu(nullptr), m_die_offset(DW_INVALID_OFFSET) {}
+const DWARFUnit *CU() const { return m_cu; }
+dw_offset_t DIEOffset() const { return m_die_offset; }
+DWARFDIE GetDIE() const;
+explicit operator bool() const { return m_cu != nullptr; }
+  private:
+const DWARFUnit *const m_cu;
+dw_offset_t const m_die_offset;
+  };
+
   DWARFFormValue();
   DWARFFormValue(const DWARFUnit *cu);
   DWARFFormValue(const DWARFUnit *cu, dw_form_t form);
-  const DWARFUnit *GetCompileUnit() const { return m_cu; }
   void SetCompileUnit(const DWARFUnit *cu) { m_cu = cu; }
   dw_form_t Form() const { return m_form; }
   dw_form_t& FormRef() { return m_form; }
@@ -70,7 +86,7 @@

[Lldb-commits] [PATCH] D61503: 04/06: Track .debug_types vs. .debug_info difference

2019-05-03 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, JDevlieghere.
jankratochvil added a project: LLDB.
Herald added subscribers: jdoerfert, abidh, arphaman, aprantl.

Steal one bit from `DIERef`'s `die_offset`. That will make DWO's maximum CU 
size 4GB->2GB which should be OK. It will unfortunately also limit non-DWO 
DWARF size 4GB->2GB. That should be fixed by D61482 
 (then this patch will to steal the bit from 
`cu_index`/`cu_offset`).

The whole patchset available for testing as: `git clone -b debugtypes 
git://git.jankratochvil.net/lldb`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61503

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DIERef.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFBaseDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/HashedNameToDIE.h
  lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -692,6 +692,9 @@
 // Just a normal DWARF file whose user ID for the compile unit is the DWARF
 // offset itself
 
+auto offset = comp_unit->GetID();
+bool is_types_section = (offset & DIERef::UID_IS_TYPES_SECTION) != 0;
+offset &= ~DIERef::UID_IS_TYPES_SECTION;
 DWARFUnit *dwarf_cu =
 info->GetUnit((dw_offset_t)comp_unit->GetID());
 if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
Index: lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/NameToDIE.cpp
@@ -56,7 +56,8 @@
 ConstString cstr = m_map.GetCStringAtIndex(i);
 const DIERef &die_ref = m_map.GetValueAtIndexUnchecked(i);
 s->Printf("%p: {0x%8.8x/0x%8.8x} \"%s\"\n", (const void *)cstr.GetCString(),
-  die_ref.cu_offset, die_ref.die_offset, cstr.GetCString());
+  die_ref.cu_offset, dw_offset_t(die_ref.die_offset),
+  cstr.GetCString());
   }
 }
 
Index: lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndex.cpp
@@ -245,6 +245,7 @@
   }
 }
 
+bool is_types_section = unit.IsTypesSection();
 switch (tag) {
 case DW_TAG_inlined_subroutine:
 case DW_TAG_subprogram:
@@ -259,22 +260,25 @@
 objc_method.GetFullNameWithoutCategory(true));
 ConstString objc_class_name_no_category(objc_method.GetClassName());
 set.function_fullnames.Insert(ConstString(name),
-  DIERef(cu_offset, die.GetOffset()));
+  DIERef(cu_offset, die.GetOffset(),
+  is_types_section));
 if (objc_class_name_with_category)
   set.objc_class_selectors.Insert(
   objc_class_name_with_category,
-  DIERef(cu_offset, die.GetOffset()));
+  DIERef(cu_offset, die.GetOffset(), is_types_section));
 if (objc_class_name_no_category &&
 objc_class_name_no_category != objc_class_name_with_category)
   set.objc_class_selectors.Insert(
   objc_class_name_no_category,
-  DIERef(cu_offset, die.GetOffset()));
+  DIERef(cu_offset, die.GetOffset(), is_types_section));
 if (objc_selector_name)
   set.function_selectors.Insert(objc_selector_name,
-DIERef(cu_offset, die.GetOffset()));
+DIERef(cu_offset, die.GetOffset(),
+is_types_section));
 if (objc_fullname_no_category_name)
   set.function_fullnames.Insert(objc_fullname_no_category_name,
-DIERef(cu_offset, die.GetOffset()));
+DIERef(cu_offset, die.GetOffset(),
+is_types_section));

[Lldb-commits] [PATCH] D61504: 05/06: Track CUs and TUs separately

2019-05-03 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, JDevlieghere.
jankratochvil added a project: LLDB.
Herald added subscribers: jdoerfert, arphaman.
jankratochvil added a parent revision: D61503: 04/06: Track .debug_types vs. 
.debug_info difference.

There is one: `FIXME: May DW_ATOM_cu_offset somehow contain a TypeUnit?`

The whole patchset available for testing as: `git clone -b debugtypes 
git://git.jankratochvil.net/lldb`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61504

Files:
  lldb/source/Plugins/SymbolFile/DWARF/DIERef.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.cpp
@@ -159,5 +159,10 @@
 DWARFDIE
 SymbolFileDWARFDwo::GetDIE(const DIERef &die_ref) {
   lldbassert(m_base_dwarf_cu->GetOffset() == die_ref.cu_offset);
-  return DebugInfo()->GetDIEForDIEOffset(die_ref.die_offset);
+  lldbassert(DebugInfo()->GetNumUnits() == 1);
+  DWARFUnit *cu = DebugInfo()->GetUnitContainingDIEOffset(
+  die_ref.die_offset, die_ref.IsTypesSection());
+  if (cu)
+return cu->GetDIE(die_ref.die_offset);
+  return DWARFDIE();
 }
Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -695,8 +695,8 @@
 auto offset = comp_unit->GetID();
 bool is_types_section = (offset & DIERef::UID_IS_TYPES_SECTION) != 0;
 offset &= ~DIERef::UID_IS_TYPES_SECTION;
-DWARFUnit *dwarf_cu =
-info->GetUnit((dw_offset_t)comp_unit->GetID());
+DWARFUnit *dwarf_cu = is_types_section
+? info->GetTypesSectionUnit(offset) : info->GetCompileUnit(offset);
 if (dwarf_cu && dwarf_cu->GetUserData() == NULL)
   dwarf_cu->SetUserData(comp_unit);
 return dwarf_cu;
@@ -779,16 +779,22 @@
   cu_sp->GetSupportFiles().Replace(0, cu_file_spec);
 }
   }
+}
 
-  dwarf_cu->SetUserData(cu_sp.get());
-
-  // Figure out the compile unit index if we weren't given one
-  if (cu_idx == UINT32_MAX)
-DebugInfo()->GetUnit(dwarf_cu->GetOffset(), &cu_idx);
+dwarf_cu->SetUserData(cu_sp.get());
 
-  m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(
-  cu_idx, cu_sp);
+// Figure out the compile unit index if we weren't given one
+if (cu_idx == UINT32_MAX) {
+  if (dwarf_cu->IsTypesSection()) {
+DebugInfo()->GetTypesSectionUnit(dwarf_cu->GetOffset(),
+&cu_idx);
+cu_idx += DebugInfo()->GetNumOnlyCompileUnits();
+  } else
+DebugInfo()->GetCompileUnit(dwarf_cu->GetOffset(), &cu_idx);
 }
+
+m_obj_file->GetModule()->GetSymbolVendor()->SetCompileUnitAtIndex(
+cu_idx, cu_sp);
   }
 }
   }
@@ -1766,8 +1772,7 @@
 }
   } else {
 uint32_t cu_idx = DW_INVALID_INDEX;
-DWARFUnit *dwarf_cu =
-debug_info->GetUnit(cu_offset, &cu_idx);
+DWARFUnit *dwarf_cu = debug_info->GetCompileUnit(cu_offset, &cu_idx);
 if (dwarf_cu) {
   sc.comp_unit = GetCompUnitForDWARFCompUnit(dwarf_cu, cu_idx);
   if (sc.comp_unit) {
@@ -3124,7 +3129,7 @@
 return num_variables;
   }
 } else if (sc.comp_unit) {
-  DWARFUnit *dwarf_cu = info->GetUnit(sc.comp_unit->GetID());
+  DWARFUnit *dwarf_cu = info->GetCompileUnit(sc.comp_unit->GetID());
 
   if (dwarf_cu == NULL)
 return 0;
Index: lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DebugNamesDWARFIndex.cpp
@@ -55,7 +55,8 @@
   if (!cu_offset)
 return DIERef();
 
-  DWARFUnit *cu = m_debug_info.GetUnit(*cu_offset);
+  // FIXME: May DW_ATOM_cu_offset somehow contain a TypeUnit?
+  DWARFUnit *cu = m_debug_info.GetCompileUnit(*cu_offset);
   if (!cu)
 return DIERef();
 
@@ -164,7 +165,7 @@
 if (!ref)
   continue;
 
-DWARFUnit *cu = m_debug_info.GetUnit(ref.cu_offset);
+DWARFUnit *cu = m_debug_info.GetUnit(ref);

[Lldb-commits] [PATCH] D61505: 06/06: Implement .debug_types

2019-05-03 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: clayborg, labath, JDevlieghere.
jankratochvil added a project: LLDB.
Herald added subscribers: teemperor, mgorny.
jankratochvil added a parent revision: D61504: 05/06: Track CUs and TUs 
separately.

It is a rebased patch D32167  by @clayborg.

DWO still does work (no regression), .debug_types also work now but 
DWO+.debug_types does not work together (while it does work for example in 
GDB). I have a work in progress as an additional patch for that, not yet 
finished. DWO+.debug_types has no testcase now so there is no new FAIL testcase.

The whole patchset available for testing as: `git clone -b debugtypes 
git://git.jankratochvil.net/lldb`


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61505

Files:
  lldb/packages/Python/lldbsuite/test/lldbtest.py
  lldb/packages/Python/lldbsuite/test/make/Makefile.rules
  lldb/packages/Python/lldbsuite/test/plugins/builder_base.py
  lldb/packages/Python/lldbsuite/test/test_categories.py
  lldb/source/Plugins/SymbolFile/DWARF/CMakeLists.txt
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFCompileUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFFormValue.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFTypeUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
  lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
  lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp

Index: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
@@ -440,20 +440,6 @@
 if (section_list == NULL)
   return 0;
 
-// On non Apple platforms we might have .debug_types debug info that is
-// created by using "-fdebug-types-section". LLDB currently will try to
-// load this debug info, but it causes crashes during debugging when types
-// are missing since it doesn't know how to parse the info in the
-// .debug_types type units. This causes all complex debug info types to be
-// unresolved. Because this causes LLDB to crash and since it really
-// doesn't provide a solid debuggiung experience, we should disable trying
-// to debug this kind of DWARF until support gets added or deprecated.
-if (section_list->FindSectionByName(ConstString(".debug_types"))) {
-  m_obj_file->GetModule()->ReportWarning(
-"lldb doesn’t support .debug_types debug info");
-  return 0;
-}
-
 uint64_t debug_abbrev_file_size = 0;
 uint64_t debug_info_file_size = 0;
 uint64_t debug_line_file_size = 0;
@@ -766,7 +752,7 @@
 cu_sp = std::make_shared(
 module_sp, dwarf_cu, cu_file_spec, dwarf_cu->GetID(),
 cu_language, is_optimized ? eLazyBoolYes : eLazyBoolNo);
-if (cu_sp) {
+if (dwarf_cu->GetAsCompileUnit() && cu_sp) {
   // If we just created a compile unit with an invalid file spec,
   // try and get the first entry in the supports files from the
   // line table as that should be the compile unit.
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.h
@@ -16,12 +16,15 @@
 #include 
 
 class DWARFUnit;
+class DWARFTypeUnit;
 class DWARFCompileUnit;
 class NameToDIE;
 class SymbolFileDWARF;
 class SymbolFileDWARFDwo;
 
 typedef std::shared_ptr DWARFUnitSP;
+typedef std::shared_ptr DWARFTypeUnitSP;
+typedef std::shared_ptr DWARFCompileUnitSP;
 
 enum DWARFProducer {
   eProducerInvalid = 0,
@@ -38,6 +41,12 @@
 public:
   virtual ~DWARFUnit();
 
+  llvm::Error ExtractHeader(SymbolFileDWARF *dwarf2Data,
+const lldb_private::DWARFDataExtractor &debug_info,
+lldb::offset_t *offset_ptr);
+
+  DWARFTypeUnit *GetAsTypeUnit();
+  DWARFCompileUnit *GetAsCompileUnit();
   virtual bool IsTypesSection() const = 0;
   void ExtractUnitDIEIfNeeded();
   void ExtractDIEsIfNeeded();
@@ -169,6 +178,8 @@
 return die_iterator_range(m_die_array.begin(), m_die_array.end());
   }
 
+  DWARFDIE FindTypeSignatureDIE(uint64_t type_sig) const;
+
 protected:
   DWARFUnit(SymbolFileDWARF *dwarf);
 
Index: lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
===
--- lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
+++ lldb/source/Plugins/SymbolFile/DWARF/DWARFUnit.cpp
@@ -16,9 +16,12 @@
 #include "lldb/U

[Lldb-commits] [PATCH] D61498: 01/06: Merge GetCompileUnit + GetCompileUnitContainingDIEOffset

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

What you could do instead is have a single function which returns the CU if it 
is in the range `cu.GetOffset()  <= input < cu.GetNextUnitOffset()`, then the 
wrapper functions could just perform a more stricter check on the returned cu 
(I.e. no templates or callbacks).

This may lower the need for this refactoring, but independently of that, I 
don't believe we should touch this function without simplifying it into 
something more like

  uint32_t index = DW_INVALID_INDEX;
  DWARFUnit result = nullptr;
  auto pos = llvm::lower_bound(m_compile_units, offset, 
OffsetLessThanCompileUnitOffset);
  if (pos != m_compile_units.end() && ???) {
index = std::distance(...);
result = ...
  }
  if (idx_ptr) *idx_ptr = index;
  return result;

as the current implementation is hard to understand for no good reason.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61498



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


[Lldb-commits] [PATCH] D61501: 02/06: Finish renaming CompileUnit->Unit

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



Comment at: lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp:1767
 DWARFUnit *dwarf_cu =
-debug_info->GetCompileUnit(cu_offset, &cu_idx);
+debug_info->GetUnit(cu_offset, &cu_idx);
 if (dwarf_cu) {

did you clang-format the patch? It looks like this could fit on a single line 
now..


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61501



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


[Lldb-commits] [PATCH] D61504: 05/06: Track CUs and TUs separately

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

> FIXME: May DW_ATOM_cu_offset somehow contain a TypeUnit?

Nope. In fact, until very recently attempting to generate a debug_types section 
on a mac crashed the compiler (now it just aborts the compilation iirc).


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61504



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


[Lldb-commits] [PATCH] D61482: [DWARF] Store compile unit IDs in the DIERef class

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

Hm... looking at @jankratochvil's patches, I realized that I completely omitted 
HashedNameToDIE from this patch (it used `emplace_back` to construct DIERefs, 
so it snuck past me). Thinking about it, I guess the best way to handle that 
would be to set the cu_idx to the invalid value for DIERefs created there, as 
the offset is sufficient to identify the die in those cases (which I guess is 
also the reason why all tests passed). That shouldn't impact the performance in 
any way as one way or the other one has to do a binary search to convert the 
offset into a DWARFUnit*. I'll try to update that on monday...


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

https://reviews.llvm.org/D61482



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


[Lldb-commits] [PATCH] D61473: ExpressionParser: only force link MCJIT when needed

2019-05-03 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd updated this revision to Diff 198020.
compnerd added a comment.

Move the inclusion as suggested.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61473

Files:
  source/API/SystemInitializerFull.cpp
  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
@@ -41,11 +41,6 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/TargetSelect.h"

-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wglobal-constructors"
-#include "llvm/ExecutionEngine/MCJIT.h"
-#pragma clang diagnostic pop
-
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Support/DynamicLibrary.h"
Index: source/API/SystemInitializerFull.cpp
===
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -114,6 +114,11 @@

 #include "llvm/Support/TargetSelect.h"

+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wglobal-constructors"
+#include "llvm/ExecutionEngine/MCJIT.h"
+#pragma clang diagnostic pop
+
 #include 

 using namespace lldb_private;


Index: source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
@@ -41,11 +41,6 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/TargetSelect.h"

-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wglobal-constructors"
-#include "llvm/ExecutionEngine/MCJIT.h"
-#pragma clang diagnostic pop
-
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Support/DynamicLibrary.h"
Index: source/API/SystemInitializerFull.cpp
===
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -114,6 +114,11 @@

 #include "llvm/Support/TargetSelect.h"

+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wglobal-constructors"
+#include "llvm/ExecutionEngine/MCJIT.h"
+#pragma clang diagnostic pop
+
 #include 

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


[Lldb-commits] [PATCH] D61481: [DWARF] Reimplement/simplify DWARFUnit::GetID

2019-05-03 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere accepted this revision.
JDevlieghere added a comment.
This revision is now accepted and ready to land.

LGTM with one inline comment.




Comment at: source/Plugins/SymbolFile/DWARF/DWARFDebugInfo.h:43
   size_t GetNumCompileUnits();
   DWARFUnit *GetCompileUnitAtIndex(uint32_t idx);
+  DWARFUnit *GetCompileUnitAtOffset(dw_offset_t cu_offset,

This should probably take a `lldb::user_id_t` then?


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

https://reviews.llvm.org/D61481



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


[Lldb-commits] [PATCH] D61473: ExpressionParser: only force link MCJIT when needed

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

Thanks. Let's give that a shot.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61473



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


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

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

IIUC, when Expected returns fails, it returns an Error object that might have 
information about what went wrong.  Would it be possible to include the 
contents of that error n the log message?  We often get "I can't run an 
expression in a really complex proprietary code base" and need to try to sort 
out what went wrong from these logs.  So every crumb of information we can 
preserve is useful...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61438



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


[Lldb-commits] [PATCH] D61292: Include inlined functions when figuring out a contiguous address range

2019-05-03 Thread António Afonso via Phabricator via lldb-commits
aadsm marked an inline comment as done.
aadsm added a comment.

@labath thank you for your kind words!




Comment at: lldb/unittests/Symbol/TestLineEntry.cpp:96-122
+llvm::Expected LineEntryTest::GetModule() {
+  if (m_module_sp)
+return m_module_sp;
+
+  std::string yaml = GetInputFilePath("inlined-functions.yaml");
+  llvm::SmallString<128> obj;
+

labath wrote:
> aadsm wrote:
> > jingham wrote:
> > > It looks like this bit of business has been copied around in a bunch of 
> > > other tests in the unittest framework.  Could we put this in a common 
> > > place (like make a LLDBUnitTest : testing::Test class that does this?
> > How about adding a new function to TestUtilities.cpp named `ReadYAMLObject`?
> A utility function sounds nice. (a test class would be fine too, but I'd name 
> it a bit less generic, as not all of our unit tests are in business of 
> running yaml2obj and creating modules).
> 
> The part I'm not so sure about is the location. Originally the idea was that 
> we would have a special subfolder for test helpers related to each module 
> under test, but then at some point that got changed into `TestingSupport` 
> which sounds more generic (this evolution here is visible in the fact that 
> the cmake target name in that folder is called `lldbUtilityHelpers`). If we 
> put this function there then we'd have to pull in the Core module (and 
> everything that goes with it). Though that isn't that bad on it's own, it is 
> a bit unfortunate, as right now the `Utility` unit test executable is our 
> best defense against unexpected dependencies creeping into the main module. 
> After this, that executable would link in the whole world again, and we'd 
> lose this defense.
> 
> Another possibility might be to just put the yaml2obj (which is the main 
> source of mess here) part in that file, and leave the construction of the 
> Module object to the users.
Yeah, the way I did it locally was to create a function that only handles the 
yaml2obj part. Some tests use the file for other things other than creating a 
ModuleSpec.
I also put the responsibility of creating and cleaning up the object file in 
the caller. I was not sure how to handle the clean up of the temporary file for 
all different cases. Here's how it looks like from the caller side.

```
llvm::SmallString<128> obj;
if (auto ec = llvm::sys::fs::createTemporaryFile("source-%%", "obj", obj))
  return llvm::errorCodeToError(ec);
llvm::FileRemover obj_remover(obj);
if (auto error = ReadYAMLObjectFile("inlined-functions.yaml", obj))
  return llvm::Error(std::move(error));
```
What do you think?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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


[Lldb-commits] [PATCH] D59960: Fix for ambiguous lookup in expressions between local variable and namespace

2019-05-03 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik updated this revision to Diff 198061.
shafik added a comment.

Updating after https://reviews.llvm.org/D46551 landed


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

https://reviews.llvm.org/D59960

Files:
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/Makefile
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/TestNamespaceLocalVarSameNameObjC.py
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/main.mm
  
packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/util.mm
  source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

Index: source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
===
--- source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
+++ source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
@@ -200,17 +200,31 @@
 
 static void AddLocalVariableDecls(const lldb::VariableListSP &var_list_sp,
   StreamString &stream,
-  const std::string &expr) {
+  const std::string &expr,
+  lldb::LanguageType wrapping_language) {
   for (size_t i = 0; i < var_list_sp->GetSize(); i++) {
 lldb::VariableSP var_sp = var_list_sp->GetVariableAtIndex(i);
 
 ConstString var_name = var_sp->GetName();
-if (!var_name || var_name == "this" || var_name == ".block_descriptor")
+
+
+// We can check for .block_descriptor w/o checking for langauge since this
+// is not a valid identifier in either C or C++.
+if (!var_name || var_name == ConstString(".block_descriptor"))
   continue;
 
 if (!expr.empty() && !ExprBodyContainsVar(expr, var_name.GetStringRef()))
   continue;
 
+if ((var_name == ConstString("self") || var_name == ConstString("_cmd")) &&
+(wrapping_language == lldb::eLanguageTypeObjC ||
+ wrapping_language == lldb::eLanguageTypeObjC_plus_plus))
+  continue;
+
+if (var_name == ConstString("this") &&
+wrapping_language == lldb::eLanguageTypeC_plus_plus)
+  continue;
+
 stream.Printf("using $__lldb_local_vars::%s;\n", var_name.AsCString());
   }
 }
@@ -291,16 +305,14 @@
   }
 }
 
-if (add_locals) {
-  if (Language::LanguageIsCPlusPlus(frame->GetLanguage())) {
-if (target->GetInjectLocalVariables(&exe_ctx)) {
-  lldb::VariableListSP var_list_sp =
-  frame->GetInScopeVariableList(false, true);
-  AddLocalVariableDecls(var_list_sp, lldb_local_var_decls,
-force_add_all_locals ? "" : m_body);
-}
+if (add_locals)
+  if (target->GetInjectLocalVariables(&exe_ctx)) {
+lldb::VariableListSP var_list_sp =
+frame->GetInScopeVariableList(false, true);
+AddLocalVariableDecls(var_list_sp, lldb_local_var_decls,
+  force_add_all_locals ? "" : m_body,
+  wrapping_language);
   }
-}
   }
 
   if (m_wrap) {
@@ -378,11 +390,12 @@
 "@implementation $__lldb_objc_class ($__lldb_category)   \n"
 "+(void)%s:(void *)$__lldb_arg   \n"
 "{   \n"
+"%s; \n"
 "%s"
 "}   \n"
 "@end\n",
 module_imports.c_str(), m_name.c_str(), m_name.c_str(),
-tagged_body.c_str());
+lldb_local_var_decls.GetData(), tagged_body.c_str());
   } else {
 wrap_stream.Printf(
 "%s"
@@ -392,11 +405,12 @@
 "@implementation $__lldb_objc_class ($__lldb_category)  \n"
 "-(void)%s:(void *)$__lldb_arg  \n"
 "{  \n"
+"%s; \n"
 "%s"
 "}  \n"
 "@end   \n",
 module_imports.c_str(), m_name.c_str(), m_name.c_str(),
-tagged_body.c_str());
+lldb_local_var_decls.GetData(), tagged_body.c_str());
   }
   break;
 }
Index: packages/Python/lldbsuite/test/expression_

[Lldb-commits] [lldb] r359921 - Fix for ambiguous lookup in expressions between local variable and namespace

2019-05-03 Thread Shafik Yaghmour via lldb-commits
Author: shafik
Date: Fri May  3 12:59:22 2019
New Revision: 359921

URL: http://llvm.org/viewvc/llvm-project?rev=359921&view=rev
Log:
Fix for ambiguous lookup in expressions between local variable and namespace

Summary:
In an Objective-C context a local variable and namespace can cause an ambiguous 
name lookup when used in an expression. The solution involves mimicking the 
existing C++ solution which is to add local using declarations for local 
variables. This causes a different type of lookup to be used which eliminates 
the namespace during acceptable results filtering.

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

Added:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/Makefile

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/TestNamespaceLocalVarSameNameObjC.py

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/main.mm

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/util.mm
Modified:

lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile?rev=359921&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile
 Fri May  3 12:59:22 2019
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py?rev=359921&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py
 Fri May  3 12:59:22 2019
@@ -0,0 +1,24 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestNamespaceLocalVarSameNameCppAndC(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessDarwin
+@add_test_categories(["gmodules"])
+def test_namespace_local_var_same_name_cpp_and_c(self):
+self.build()
+
+(self.target, self.process, _, bkpt) = 
lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.expect("expr error",
+substrs=['(int) $0 = 1'])
+
+lldbutil.continue_to_breakpoint(self.process, bkpt)
+
+self.expect("expr error",
+substrs=['(int) $1 = 1'])

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp?rev=359921&view=auto
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
 (added)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
 Fri May  3 12:59:22 2019
@@ -0,0 +1,21 @@
+namespace error {
+  int x;
+}
+
+struct A {
+  void foo() {
+int error=1;
+
+return; // break here
+  }
+};
+
+int main() {
+ int error=1;
+
+ A a;
+
+ a.foo();
+
+ return 0; // break here
+}

Added: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command

[Lldb-commits] [PATCH] D59960: Fix for ambiguous lookup in expressions between local variable and namespace

2019-05-03 Thread Shafik Yaghmour 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 rL359921: Fix for ambiguous lookup in expressions between 
local variable and namespace (authored by shafik, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D59960?vs=198061&id=198071#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D59960

Files:
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/TestNamespaceLocalVarSameNameCppAndC.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/Makefile
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/TestNamespaceLocalVarSameNameObjC.py
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/main.mm
  
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/util.mm
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/Makefile
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/Makefile
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+OBJCXX_SOURCES := main.mm util.mm
+include $(LEVEL)/Makefile.rules
+
+LDFLAGS += -framework Foundation
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/main.mm
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/main.mm
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/main.mm
@@ -0,0 +1,16 @@
+#import 
+@interface Util : NSObject
++ (void)debugPrintErrorStatic;
+- (void)debugPrintError;
+@end
+
+int main(int argc, const char * argv[]) {
+  [Util debugPrintErrorStatic];
+
+  Util *u = [[Util alloc] init];
+
+  [u debugPrintError];
+
+  return 0;
+}
+
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/TestNamespaceLocalVarSameNameObjC.py
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/TestNamespaceLocalVarSameNameObjC.py
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/TestNamespaceLocalVarSameNameObjC.py
@@ -0,0 +1,24 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestNamespaceLocalVarSameNameObjC(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipUnlessDarwin
+@add_test_categories(["gmodules"])
+def test_namespace_local_var_same_name_obj_c(self):
+self.build()
+
+(self.target, self.process, _, bkpt) = lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("util.mm", False))
+
+self.expect("expr error",
+substrs=['(NSError *) $0 ='])
+
+lldbutil.continue_to_breakpoint(self.process, bkpt)
+
+self.expect("expr error",
+substrs=['(NSError *) $1 ='])
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/util.mm
===
--- lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/util.mm
+++ lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_obj_c/util.mm
@@ -0,0 +1,22 @@
+#import 
+
+namespace error {
+int blah;
+}
+
+@interface Util : NSObject
++ (void)debugPrintErrorStatic;
+- (void)debugPrintError;
+@end
+
+@implementation Util
++ (void)debugPrintErrorStatic {
+  NSError* error = [NSError errorWithDomain:NSURLErrorDomain code:-1 userInfo:nil];
+  NSLog(@"xxx, error = %@", error); // break here
+}
+
+- (void)debugPrintError {
+  NSError* error = [NSError errorWithDomain:NSURLErrorDomain code:-1 userInfo:nil];
+  NSLog(@"xxx, error = %@", error); // break here
+}
+@end
Index: lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_sam

[Lldb-commits] [PATCH] D61533: Make lldb-mi optional and change how we deal with missing tools in lit

2019-05-03 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: davide.
Herald added a subscriber: mgorny.

https://reviews.llvm.org/D61533

Files:
  lldb/lit/CMakeLists.txt
  lldb/lit/lit.site.cfg.py.in
  lldb/lit/tools/lldb-instr/lit.local.cfg
  lldb/tools/CMakeLists.txt


Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Index: lldb/lit/tools/lldb-instr/lit.local.cfg
===
--- lldb/lit/tools/lldb-instr/lit.local.cfg
+++ lldb/lit/tools/lldb-instr/lit.local.cfg
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-inst" in config.available_features:
 config.unsupported = True
Index: lldb/lit/lit.site.cfg.py.in
===
--- lldb/lit/lit.site.cfg.py.in
+++ lldb/lit/lit.site.cfg.py.in
@@ -18,8 +18,6 @@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: lldb/lit/CMakeLists.txt
===
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -37,8 +37,6 @@
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 


Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Index: lldb/lit/tools/lldb-instr/lit.local.cfg
===
--- lldb/lit/tools/lldb-instr/lit.local.cfg
+++ lldb/lit/tools/lldb-instr/lit.local.cfg
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-inst" in config.available_features:
 config.unsupported = True
Index: lldb/lit/lit.site.cfg.py.in
===
--- lldb/lit/lit.site.cfg.py.in
+++ lldb/lit/lit.site.cfg.py.in
@@ -18,8 +18,6 @@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: lldb/lit/CMakeLists.txt
===
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -37,8 +37,6 @@
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359925 - Supply a default implementation of IsRuntimeSupportValue.

2019-05-03 Thread Adrian Prantl via lldb-commits
Author: adrian
Date: Fri May  3 13:28:19 2019
New Revision: 359925

URL: http://llvm.org/viewvc/llvm-project?rev=359925&view=rev
Log:
Supply a default implementation of IsRuntimeSupportValue.

Thanks to Pavel for pointing this out.

Modified:
lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
lldb/trunk/source/Core/ValueObject.cpp

Modified: lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py?rev=359925&r1=359924&r2=359925&view=diff
==
--- lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py (original)
+++ lldb/trunk/packages/Python/lldbsuite/test/lang/c/vla/TestVLA.py Fri May  3 
13:28:19 2019
@@ -9,7 +9,6 @@ class TestVLA(TestBase):
 mydir = TestBase.compute_mydir(__file__)
 
 @skipIf(compiler="clang", compiler_version=['<', '8.0'])
-@expectedFailureAll(oslist=no_match(lldbplatformutil.getDarwinOSTriples()))
 def test_variable_list(self):
 self.build()
 _, process, _, _ = lldbutil.run_to_source_breakpoint(

Modified: lldb/trunk/source/Core/ValueObject.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/ValueObject.cpp?rev=359925&r1=359924&r2=359925&view=diff
==
--- lldb/trunk/source/Core/ValueObject.cpp (original)
+++ lldb/trunk/source/Core/ValueObject.cpp Fri May  3 13:28:19 2019
@@ -31,6 +31,7 @@
 #include "lldb/Symbol/Declaration.h"
 #include "lldb/Symbol/SymbolContext.h"
 #include "lldb/Symbol/Type.h"
+#include "lldb/Symbol/Variable.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Language.h"
 #include "lldb/Target/LanguageRuntime.h"
@@ -1704,6 +1705,9 @@ bool ValueObject::IsRuntimeSupportValue(
   runtime = process->GetObjCLanguageRuntime();
 if (runtime)
   return runtime->IsRuntimeSupportValue(*this);
+// If there is no language runtime, trust the compiler to mark all
+// runtime support variables as artificial.
+return GetVariable() && GetVariable()->IsArtificial();
   }
   return false;
 }


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


[Lldb-commits] [PATCH] D61451: Hide runtime support values such as clang's __vla_expr from frame variable

2019-05-03 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

In D61451#1489109 , @labath wrote:

> I think there is a problem with this patch. I don't believe the TestVLA part 
> would work on any non-darwin platform (it doesn't on linux: 
> http://lab.llvm.org:8014/builders/lldb-x86_64-debian/builds/923), and it 
> works on darwin only accidentally.
>
> The reason the fails on linux is that we don't have a "language runtime" 
> plugin for the "C" language, so there is noone to ask if the variable is a 
> runtime support value, and so we return false from 
> `ValueObject::IsRuntimeSupportValue`. I believe the reason this works on 
> darwin is because `ValueObject::IsRuntimeSupportValue` has a fallback (not 
> sure why) which explicitly asks for the ObjC runtime if the desired language 
> is not present. On linux, we don't have an ObjC runtime..
>
> I can think of a couple of solutions here (adding a C language runtime, 
> defaulting to return  `IsArtificial` in ValueObject if no language runtime is 
> present) but none of them seemed too obvious to commit straight-away, so I've 
> disabled a part of that test for the time being (r359867). Nonetheless, could 
> you please take a look at this problem?


Thanks for pointing this out. This should be addressed by r359925.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D61451



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


[Lldb-commits] [PATCH] D61533: Make lldb-mi optional and change how we deal with missing tools in lit

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



Comment at: lldb/lit/tools/lldb-instr/lit.local.cfg:1
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-inst" in config.available_features:
 config.unsupported = True

lldb-instr.


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

https://reviews.llvm.org/D61533



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


[Lldb-commits] [PATCH] D61533: Make lldb-mi optional and change how we deal with missing tools in lit

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

Fix typo


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

https://reviews.llvm.org/D61533

Files:
  lldb/lit/CMakeLists.txt
  lldb/lit/lit.site.cfg.py.in
  lldb/lit/tools/lldb-instr/lit.local.cfg
  lldb/tools/CMakeLists.txt


Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Index: lldb/lit/tools/lldb-instr/lit.local.cfg
===
--- lldb/lit/tools/lldb-instr/lit.local.cfg
+++ lldb/lit/tools/lldb-instr/lit.local.cfg
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-instr" in config.available_features:
 config.unsupported = True
Index: lldb/lit/lit.site.cfg.py.in
===
--- lldb/lit/lit.site.cfg.py.in
+++ lldb/lit/lit.site.cfg.py.in
@@ -18,8 +18,6 @@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: lldb/lit/CMakeLists.txt
===
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -37,8 +37,6 @@
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 


Index: lldb/tools/CMakeLists.txt
===
--- lldb/tools/CMakeLists.txt
+++ lldb/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Index: lldb/lit/tools/lldb-instr/lit.local.cfg
===
--- lldb/lit/tools/lldb-instr/lit.local.cfg
+++ lldb/lit/tools/lldb-instr/lit.local.cfg
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-instr" in config.available_features:
 config.unsupported = True
Index: lldb/lit/lit.site.cfg.py.in
===
--- lldb/lit/lit.site.cfg.py.in
+++ lldb/lit/lit.site.cfg.py.in
@@ -18,8 +18,6 @@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
Index: lldb/lit/CMakeLists.txt
===
--- lldb/lit/CMakeLists.txt
+++ lldb/lit/CMakeLists.txt
@@ -37,8 +37,6 @@
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61533: Make lldb-mi optional and change how we deal with missing tools in lit

2019-05-03 Thread Jonas Devlieghere 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 rL359926: Make lldb-mi optional and change how we deal with 
missing tools in lit (authored by JDevlieghere, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D61533?vs=198076&id=198077#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D61533

Files:
  lldb/trunk/lit/CMakeLists.txt
  lldb/trunk/lit/lit.site.cfg.py.in
  lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
  lldb/trunk/tools/CMakeLists.txt


Index: lldb/trunk/tools/CMakeLists.txt
===
--- lldb/trunk/tools/CMakeLists.txt
+++ lldb/trunk/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Index: lldb/trunk/lit/CMakeLists.txt
===
--- lldb/trunk/lit/CMakeLists.txt
+++ lldb/trunk/lit/CMakeLists.txt
@@ -37,8 +37,6 @@
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 
Index: lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
===
--- lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
+++ lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-instr" in config.available_features:
 config.unsupported = True
Index: lldb/trunk/lit/lit.site.cfg.py.in
===
--- lldb/trunk/lit/lit.site.cfg.py.in
+++ lldb/trunk/lit/lit.site.cfg.py.in
@@ -18,8 +18,6 @@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.


Index: lldb/trunk/tools/CMakeLists.txt
===
--- lldb/trunk/tools/CMakeLists.txt
+++ lldb/trunk/tools/CMakeLists.txt
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")
Index: lldb/trunk/lit/CMakeLists.txt
===
--- lldb/trunk/lit/CMakeLists.txt
+++ lldb/trunk/lit/CMakeLists.txt
@@ -37,8 +37,6 @@
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 
Index: lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
===
--- lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
+++ lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-instr" in config.available_features:
 config.unsupported = True
Index: lldb/trunk/lit/lit.site.cfg.py.in
===
--- lldb/trunk/lit/lit.site.cfg.py.in
+++ lldb/trunk/lit/lit.site.cfg.py.in
@@ -18,8 +18,6 @@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359926 - Make lldb-mi optional and change how we deal with missing tools in lit

2019-05-03 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Fri May  3 13:33:58 2019
New Revision: 359926

URL: http://llvm.org/viewvc/llvm-project?rev=359926&view=rev
Log:
Make lldb-mi optional and change how we deal with missing tools in lit

We don't need the variables in lit, we can use the capabilities to check
if the utility exists.

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

Modified:
lldb/trunk/lit/CMakeLists.txt
lldb/trunk/lit/lit.site.cfg.py.in
lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
lldb/trunk/tools/CMakeLists.txt

Modified: lldb/trunk/lit/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/CMakeLists.txt?rev=359926&r1=359925&r2=359926&view=diff
==
--- lldb/trunk/lit/CMakeLists.txt (original)
+++ lldb/trunk/lit/CMakeLists.txt Fri May  3 13:33:58 2019
@@ -37,8 +37,6 @@ endif()
 # the value is not canonicalized within LLVM
 llvm_canonicalize_cmake_booleans(
   LLDB_DISABLE_PYTHON
-  LLDB_TOOL_LLDB_INSTR_BUILD
-  LLDB_TOOL_LLDB_VSCODE_BUILD
   LLVM_ENABLE_ZLIB
   LLDB_IS_64_BITS)
 

Modified: lldb/trunk/lit/lit.site.cfg.py.in
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/lit.site.cfg.py.in?rev=359926&r1=359925&r2=359926&view=diff
==
--- lldb/trunk/lit/lit.site.cfg.py.in (original)
+++ lldb/trunk/lit/lit.site.cfg.py.in Fri May  3 13:33:58 2019
@@ -18,8 +18,6 @@ config.have_zlib = @LLVM_ENABLE_ZLIB@
 config.host_triple = "@LLVM_HOST_TRIPLE@"
 config.lldb_bitness = 64 if @LLDB_IS_64_BITS@ else 32
 config.lldb_disable_python = @LLDB_DISABLE_PYTHON@
-config.have_lldb_instr = @LLDB_TOOL_LLDB_INSTR_BUILD@
-config.have_lldb_vscode = @LLDB_TOOL_LLDB_VSCODE_BUILD@
 
 # Support substitution of the tools and libs dirs with user parameters. This is
 # used when we can't determine the tool dir at configuration time.

Modified: lldb/trunk/lit/tools/lldb-instr/lit.local.cfg
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/tools/lldb-instr/lit.local.cfg?rev=359926&r1=359925&r2=359926&view=diff
==
--- lldb/trunk/lit/tools/lldb-instr/lit.local.cfg (original)
+++ lldb/trunk/lit/tools/lldb-instr/lit.local.cfg Fri May  3 13:33:58 2019
@@ -1,4 +1,2 @@
-import sys
-  
-if not config.have_lldb_instr:
+if not "lldb-instr" in config.available_features:
 config.unsupported = True

Modified: lldb/trunk/tools/CMakeLists.txt
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/CMakeLists.txt?rev=359926&r1=359925&r2=359926&view=diff
==
--- lldb/trunk/tools/CMakeLists.txt (original)
+++ lldb/trunk/tools/CMakeLists.txt Fri May  3 13:33:58 2019
@@ -1,7 +1,6 @@
 add_subdirectory(argdumper)
 add_subdirectory(driver)
 add_subdirectory(intel-features)
-add_subdirectory(lldb-mi)
 
 # We want lldb-test to be built only when it's needed,
 # i.e. if a target requires it as dependency. The typical
@@ -9,6 +8,7 @@ add_subdirectory(lldb-mi)
 add_subdirectory(lldb-test EXCLUDE_FROM_ALL)
 
 add_lldb_tool_subdirectory(lldb-instr)
+add_lldb_tool_subdirectory(lldb-mi)
 add_lldb_tool_subdirectory(lldb-vscode)
 
 if (CMAKE_SYSTEM_NAME MATCHES "Darwin")


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


[Lldb-commits] [PATCH] D61469: [Alias] Add 're' alias for register

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

LGTM


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61469



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


[Lldb-commits] [lldb] r359927 - [Alias] Add 're' alias for register

2019-05-03 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Fri May  3 13:37:09 2019
New Revision: 359927

URL: http://llvm.org/viewvc/llvm-project?rev=359927&view=rev
Log:
[Alias] Add 're' alias for register

This patch makes `re` an alias for `register`. Currently `re` gives
you the choice between `register` and `reproducer`. Given that you use
`register` a lot more often, it should win for the common substring.

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

Modified:

lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
lldb/trunk/source/Interpreter/CommandInterpreter.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py?rev=359927&r1=359926&r2=359927&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
 Fri May  3 13:37:09 2019
@@ -187,7 +187,8 @@ class RegisterCommandsTestCase(TestBase)
 elif not value.IsValid():
 return  # If register doesn't exist, skip this test
 
-self.runCmd("register write " + register + " \'" + new_value + "\'")
+# Also test the 're' alias.
+self.runCmd("re write " + register + " \'" + new_value + "\'")
 self.expect(
 "register read " +
 register,

Modified: lldb/trunk/source/Interpreter/CommandInterpreter.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Interpreter/CommandInterpreter.cpp?rev=359927&r1=359926&r2=359927&view=diff
==
--- lldb/trunk/source/Interpreter/CommandInterpreter.cpp (original)
+++ lldb/trunk/source/Interpreter/CommandInterpreter.cpp Fri May  3 13:37:09 
2019
@@ -429,6 +429,11 @@ void CommandInterpreter::Initialize() {
 AddAlias("var", cmd_obj_sp);
 AddAlias("vo", cmd_obj_sp, "--object-description");
   }
+
+  cmd_obj_sp = GetCommandSPExact("register", false);
+  if (cmd_obj_sp) {
+AddAlias("re", cmd_obj_sp);
+  }
 }
 
 void CommandInterpreter::Clear() {


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


[Lldb-commits] [PATCH] D61469: [Alias] Add 're' alias for register

2019-05-03 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rLLDB359927: [Alias] Add 're' alias for register 
(authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D61469?vs=197872&id=198078#toc

Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61469

Files:
  
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
  source/Interpreter/CommandInterpreter.cpp


Index: source/Interpreter/CommandInterpreter.cpp
===
--- source/Interpreter/CommandInterpreter.cpp
+++ source/Interpreter/CommandInterpreter.cpp
@@ -429,6 +429,11 @@
 AddAlias("var", cmd_obj_sp);
 AddAlias("vo", cmd_obj_sp, "--object-description");
   }
+
+  cmd_obj_sp = GetCommandSPExact("register", false);
+  if (cmd_obj_sp) {
+AddAlias("re", cmd_obj_sp);
+  }
 }
 
 void CommandInterpreter::Clear() {
Index: 
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
===
--- 
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ 
packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -187,7 +187,8 @@
 elif not value.IsValid():
 return  # If register doesn't exist, skip this test
 
-self.runCmd("register write " + register + " \'" + new_value + "\'")
+# Also test the 're' alias.
+self.runCmd("re write " + register + " \'" + new_value + "\'")
 self.expect(
 "register read " +
 register,


Index: source/Interpreter/CommandInterpreter.cpp
===
--- source/Interpreter/CommandInterpreter.cpp
+++ source/Interpreter/CommandInterpreter.cpp
@@ -429,6 +429,11 @@
 AddAlias("var", cmd_obj_sp);
 AddAlias("vo", cmd_obj_sp, "--object-description");
   }
+
+  cmd_obj_sp = GetCommandSPExact("register", false);
+  if (cmd_obj_sp) {
+AddAlias("re", cmd_obj_sp);
+  }
 }
 
 void CommandInterpreter::Clear() {
Index: packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
===
--- packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
+++ packages/Python/lldbsuite/test/functionalities/register/register_command/TestRegisters.py
@@ -187,7 +187,8 @@
 elif not value.IsValid():
 return  # If register doesn't exist, skip this test
 
-self.runCmd("register write " + register + " \'" + new_value + "\'")
+# Also test the 're' alias.
+self.runCmd("re write " + register + " \'" + new_value + "\'")
 self.expect(
 "register read " +
 register,
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r359929 - [lldb] Remove the 'www' folder.

2019-05-03 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Fri May  3 13:42:45 2019
New Revision: 359929

URL: http://llvm.org/viewvc/llvm-project?rev=359929&view=rev
Log:
[lldb] Remove the 'www' folder.

Now that the new website is live and everything is generated from the
repository, we don't need the www folder anymore.

Removed:
lldb/trunk/www/

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


[Lldb-commits] [lldb] r359930 - [test] Make check more strict

2019-05-03 Thread Jonas Devlieghere via lldb-commits
Author: jdevlieghere
Date: Fri May  3 13:58:56 2019
New Revision: 359930

URL: http://llvm.org/viewvc/llvm-project?rev=359930&view=rev
Log:
[test] Make check more strict

Before this change the test would always pass if the path to the test
contained the number 11 in it. Thanks to Ted for pointing this out.

Modified:
lldb/trunk/lit/Commands/command-source.test

Modified: lldb/trunk/lit/Commands/command-source.test
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lit/Commands/command-source.test?rev=359930&r1=359929&r2=359930&view=diff
==
--- lldb/trunk/lit/Commands/command-source.test (original)
+++ lldb/trunk/lit/Commands/command-source.test Fri May  3 13:58:56 2019
@@ -8,5 +8,5 @@
 bogus
 p 10+1
 
-# CONTINUE: 11
-# STOP-NOT: 11
+# CONTINUE: $0 = 11
+# STOP-NOT: $0 = 11


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


[Lldb-commits] [lldb] r359931 - Fixed some minor style issues in rLLDB359921 [NFC]

2019-05-03 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Fri May  3 14:01:45 2019
New Revision: 359931

URL: http://llvm.org/viewvc/llvm-project?rev=359931&view=rev
Log:
Fixed some minor style issues in rLLDB359921 [NFC]

Ran clang-format on the added test file and use the new StringRef
comparison over the temporary ConstStrings. Also aligned the
end of one of the code string literals.

Modified:

lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp

lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp

Modified: 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp?rev=359931&r1=359930&r2=359931&view=diff
==
--- 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
 (original)
+++ 
lldb/trunk/packages/Python/lldbsuite/test/expression_command/namespace_local_var_same_name_cpp_and_c/main.cpp
 Fri May  3 14:01:45 2019
@@ -1,21 +1,21 @@
 namespace error {
-  int x;
+int x;
 }
 
 struct A {
   void foo() {
-int error=1;
+int error = 1;
 
 return; // break here
   }
 };
 
 int main() {
- int error=1;
+  int error = 1;
 
- A a;
+  A a;
 
- a.foo();
+  a.foo();
 
- return 0; // break here
+  return 0; // break here
 }

Modified: 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp?rev=359931&r1=359930&r2=359931&view=diff
==
--- 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp 
(original)
+++ 
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionSourceCode.cpp 
Fri May  3 14:01:45 2019
@@ -210,18 +210,18 @@ static void AddLocalVariableDecls(const
 
 // We can check for .block_descriptor w/o checking for langauge since this
 // is not a valid identifier in either C or C++.
-if (!var_name || var_name == ConstString(".block_descriptor"))
+if (!var_name || var_name == ".block_descriptor")
   continue;
 
 if (!expr.empty() && !ExprBodyContainsVar(expr, var_name.GetStringRef()))
   continue;
 
-if ((var_name == ConstString("self") || var_name == ConstString("_cmd")) &&
+if ((var_name == "self" || var_name == "_cmd") &&
 (wrapping_language == lldb::eLanguageTypeObjC ||
  wrapping_language == lldb::eLanguageTypeObjC_plus_plus))
   continue;
 
-if (var_name == ConstString("this") &&
+if (var_name == "this" &&
 wrapping_language == lldb::eLanguageTypeC_plus_plus)
   continue;
 
@@ -405,7 +405,7 @@ bool ClangExpressionSourceCode::GetText(
 "@implementation $__lldb_objc_class ($__lldb_category)  \n"
 "-(void)%s:(void *)$__lldb_arg  \n"
 "{  \n"
-"%s; \n"
+"%s;\n"
 "%s"
 "}  \n"
 "@end   \n",


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


[Lldb-commits] [lldb] r359944 - ExpressionParser: only force link MCJIT when needed

2019-05-03 Thread Saleem Abdulrasool via lldb-commits
Author: compnerd
Date: Fri May  3 16:19:27 2019
New Revision: 359944

URL: http://llvm.org/viewvc/llvm-project?rev=359944&view=rev
Log:
ExpressionParser: only force link MCJIT when needed

This was added to support FreeBSD.  The inclusion of this header increases the
size of `lldb-server` due to MCJIT being forcefully preserved.  Conditionalise
the inclusion to shared builds of LLVM which will allow for MCJIT to be stripped
if unnecessary when performing static linking of tools.  This shaves off ~28% of
the binary size for lldb-server when linked with gold using
`-ffunction-sections` and `-fdata-sections`.

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

Modified: lldb/trunk/source/API/SystemInitializerFull.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/API/SystemInitializerFull.cpp?rev=359944&r1=359943&r2=359944&view=diff
==
--- lldb/trunk/source/API/SystemInitializerFull.cpp (original)
+++ lldb/trunk/source/API/SystemInitializerFull.cpp Fri May  3 16:19:27 2019
@@ -114,6 +114,11 @@
 
 #include "llvm/Support/TargetSelect.h"
 
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wglobal-constructors"
+#include "llvm/ExecutionEngine/MCJIT.h"
+#pragma clang diagnostic pop
+
 #include 
 
 using namespace lldb_private;

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=359944&r1=359943&r2=359944&view=diff
==
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
(original)
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp 
Fri May  3 16:19:27 2019
@@ -41,11 +41,6 @@
 #include "llvm/Support/FileSystem.h"
 #include "llvm/Support/TargetSelect.h"
 
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wglobal-constructors"
-#include "llvm/ExecutionEngine/MCJIT.h"
-#pragma clang diagnostic pop
-
 #include "llvm/IR/LLVMContext.h"
 #include "llvm/IR/Module.h"
 #include "llvm/Support/DynamicLibrary.h"


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


[Lldb-commits] [PATCH] D61473: ExpressionParser: only force link MCJIT when needed

2019-05-03 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd closed this revision.
compnerd added a comment.

SVN r359944


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61473



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


[Lldb-commits] [PATCH] D61543: Initialization: move InstructionEmulation to full initialization

2019-05-03 Thread Saleem Abdulrasool via Phabricator via lldb-commits
compnerd created this revision.
compnerd added reviewers: labath, xiaobai, clayborg.
Herald added a subscriber: mgorny.
Herald added a project: LLDB.

The debug server does not need to use the instruction emulation.  This helps
reduce the size of the final lldb-server binary by another ~100K (~1% savings).


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D61543

Files:
  source/API/SystemInitializerFull.cpp
  source/Initialization/CMakeLists.txt
  source/Initialization/SystemInitializerCommon.cpp
  tools/lldb-server/CMakeLists.txt
  tools/lldb-server/SystemInitializerLLGS.cpp

Index: tools/lldb-server/SystemInitializerLLGS.cpp
===
--- tools/lldb-server/SystemInitializerLLGS.cpp
+++ tools/lldb-server/SystemInitializerLLGS.cpp
@@ -19,6 +19,23 @@
 using HostObjectFile = ObjectFileELF;
 #endif

+#if defined(__arm__) || defined(__arm) || defined(_ARM) || defined(_M_ARM)
+#define _M_ARM
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
+#endif
+
+#if defined(__mips__) || defined(mips) || defined(__mips) ||   \
+defined(__MIPS__) || defined(_M_MIPS)
+#define _M_MIPS
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#endif
+
+#if defined(__mips64__) || defined(mips64) || defined(__mips64) || \
+defined(__MIPS64__) || defined(_M_MIPS64)
+#define _M_MIPS64
+#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
+#endif
+
 using namespace lldb_private;

 llvm::Error SystemInitializerLLGS::Initialize() {
@@ -27,10 +44,31 @@

   HostObjectFile::Initialize();

+#if defined(_M_ARM)
+  EmulateInstructionARM::Initialize();
+#endif
+#if defined(_M_MIPS)
+  EmulateInstructionMIPS::Initialize();
+#endif
+#if defined(_M_MIPS64)
+  EmulateInstructionMIPS64::Initialize();
+#endif
+
   return llvm::Error::success();
 }

 void SystemInitializerLLGS::Terminate() {
   HostObjectFile::Terminate();
+
+#if defined(_M_ARM)
+  EmulateInstructionARM::Terminate();
+#endif
+#if defined(_M_MIPS)
+  EmulateInstructionMIPS::Terminate();
+#endif
+#if defined(_M_MIPS64)
+  EmulateInstructionMIPS64::Terminate();
+#endif
+
   SystemInitializerCommon::Terminate();
 }
Index: tools/lldb-server/CMakeLists.txt
===
--- tools/lldb-server/CMakeLists.txt
+++ tools/lldb-server/CMakeLists.txt
@@ -67,6 +67,9 @@
   lldbHost
   lldbInitialization
   ${LLDB_PLUGINS}
+  lldbPluginInstructionARM
+  lldbPluginInstructionMIPS
+  lldbPluginInstructionMIPS64
   ${LLDB_SYSTEM_LIBS}

 LINK_COMPONENTS
Index: source/Initialization/SystemInitializerCommon.cpp
===
--- source/Initialization/SystemInitializerCommon.cpp
+++ source/Initialization/SystemInitializerCommon.cpp
@@ -8,9 +8,6 @@

 #include "lldb/Initialization/SystemInitializerCommon.h"

-#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
-#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
-#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #include "Plugins/Process/gdb-remote/ProcessGDBRemoteLog.h"
 #include "lldb/Host/FileSystem.h"
 #include "lldb/Host/Host.h"
@@ -99,10 +96,6 @@

   process_gdb_remote::ProcessGDBRemoteLog::Initialize();

-  EmulateInstructionARM::Initialize();
-  EmulateInstructionMIPS::Initialize();
-  EmulateInstructionMIPS64::Initialize();
-
 #if defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__)
   ProcessPOSIXLog::Initialize();
 #endif
@@ -117,10 +110,6 @@
   static Timer::Category func_cat(LLVM_PRETTY_FUNCTION);
   Timer scoped_timer(func_cat, LLVM_PRETTY_FUNCTION);

-  EmulateInstructionARM::Terminate();
-  EmulateInstructionMIPS::Terminate();
-  EmulateInstructionMIPS64::Terminate();
-
 #if defined(_WIN32)
   ProcessWindowsLog::Terminate();
 #endif
Index: source/Initialization/CMakeLists.txt
===
--- source/Initialization/CMakeLists.txt
+++ source/Initialization/CMakeLists.txt
@@ -14,9 +14,6 @@
   LINK_LIBS
 lldbCore
 lldbHost
-lldbPluginInstructionARM
-lldbPluginInstructionMIPS
-lldbPluginInstructionMIPS64
 lldbPluginProcessGDBRemote
 ${EXTRA_PLUGINS}
 ${LLDB_SYSTEM_LIBS}
Index: source/API/SystemInitializerFull.cpp
===
--- source/API/SystemInitializerFull.cpp
+++ source/API/SystemInitializerFull.cpp
@@ -43,7 +43,10 @@
 #include "Plugins/DynamicLoader/POSIX-DYLD/DynamicLoaderPOSIXDYLD.h"
 #include "Plugins/DynamicLoader/Static/DynamicLoaderStatic.h"
 #include "Plugins/DynamicLoader/Windows-DYLD/DynamicLoaderWindowsDYLD.h"
+#include "Plugins/Instruction/ARM/EmulateInstructionARM.h"
 #include "Plugins/Instruction/ARM64/EmulateInstructionARM64.h"
+#include "Plugins/Instruction/MIPS/EmulateInstructionMIPS.h"
+#include "Plugins/Instruction/MIPS64/EmulateInstructionMIPS64.h"
 #include "Plugins/Instruct

[Lldb-commits] [PATCH] D61543: Initialization: move InstructionEmulation to full initialization

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

lgtm


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D61543



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


[Lldb-commits] [PATCH] D61235: Add more information to the log timer dump

2019-05-03 Thread António Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 198114.
aadsm added a comment.
Herald added subscribers: jdoerfert, MaskRay, eraman, arichardson, mgorny, 
emaste.
Herald added a reviewer: espindola.

- Renamed CompareFileAndLine to FileAndLineEqual and made it return a bool
- Made include_inlined_functions a mandatory parameter in 
GetSameLineContiguousAddressRange
- Fix documentation
- Refactored the object file creation from YAML
- Got rid of a bunch of macros
- Improved the test case


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61235

Files:
  lldb/include/lldb/Core/AddressRange.h
  lldb/include/lldb/Symbol/Block.h
  lldb/include/lldb/Symbol/Declaration.h
  lldb/include/lldb/Symbol/LineEntry.h
  lldb/source/Core/AddressRange.cpp
  lldb/source/Symbol/Block.cpp
  lldb/source/Symbol/Declaration.cpp
  lldb/source/Symbol/LineEntry.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Target/ThreadPlanStepOut.cpp
  lldb/source/Target/ThreadPlanStepRange.cpp
  lldb/tools/lldb-test/lldb-test.cpp
  lldb/unittests/Core/CMakeLists.txt
  lldb/unittests/Core/MangledTest.cpp
  lldb/unittests/Interpreter/TestCompletion.cpp
  lldb/unittests/ObjectFile/ELF/CMakeLists.txt
  lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
  lldb/unittests/Symbol/CMakeLists.txt
  lldb/unittests/Symbol/Inputs/inlined-functions.yaml
  lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
  lldb/unittests/Symbol/TestLineEntry.cpp
  lldb/unittests/TestingSupport/CMakeLists.txt
  lldb/unittests/TestingSupport/TestUtilities.cpp
  lldb/unittests/TestingSupport/TestUtilities.h

Index: lldb/unittests/TestingSupport/TestUtilities.h
===
--- lldb/unittests/TestingSupport/TestUtilities.h
+++ lldb/unittests/TestingSupport/TestUtilities.h
@@ -9,11 +9,26 @@
 #ifndef LLDB_UNITTESTS_UTILITY_HELPERS_TESTUTILITIES_H
 #define LLDB_UNITTESTS_UTILITY_HELPERS_TESTUTILITIES_H
 
+#include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Error.h"
 #include 
 
+#define ASSERT_NO_ERROR(x) \
+  if (std::error_code ASSERT_NO_ERROR_ec = x) {\
+llvm::SmallString<128> MessageStorage; \
+llvm::raw_svector_ostream Message(MessageStorage); \
+Message << #x ": did not return errc::success.\n"  \
+<< "error number: " << ASSERT_NO_ERROR_ec.value() << "\n"  \
+<< "error message: " << ASSERT_NO_ERROR_ec.message() << "\n";  \
+GTEST_FATAL_FAILURE_(MessageStorage.c_str());  \
+  } else { \
+  }
+
 namespace lldb_private {
 std::string GetInputFilePath(const llvm::Twine &name);
+llvm::Error ReadYAMLObjectFile(const llvm::Twine &yaml_name,
+   llvm::SmallString<128> &obj);
 }
 
 #endif
Index: lldb/unittests/TestingSupport/TestUtilities.cpp
===
--- lldb/unittests/TestingSupport/TestUtilities.cpp
+++ lldb/unittests/TestingSupport/TestUtilities.cpp
@@ -9,7 +9,9 @@
 #include "TestUtilities.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/Program.h"
 
 extern const char *TestMainArgv0;
 
@@ -19,3 +21,24 @@
   llvm::sys::path::append(result, "Inputs", name);
   return result.str();
 }
+
+llvm::Error
+lldb_private::ReadYAMLObjectFile(const llvm::Twine &yaml_name,
+ llvm::SmallString<128> &object_file) {
+  std::string yaml = GetInputFilePath(yaml_name);
+  llvm::StringRef args[] = {YAML2OBJ, yaml};
+  llvm::StringRef obj_ref = object_file;
+  const llvm::Optional redirects[] = {llvm::None, obj_ref,
+   llvm::None};
+  if (llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects) != 0)
+return llvm::createStringError(llvm::inconvertibleErrorCode(),
+   "Error running yaml2obj %s.", yaml.c_str());
+  uint64_t size;
+  if (auto ec = llvm::sys::fs::file_size(object_file, size))
+return llvm::errorCodeToError(ec);
+  if (size == 0)
+return llvm::createStringError(
+llvm::inconvertibleErrorCode(),
+"Empty object file created from yaml2obj %s.", yaml.c_str());
+  return llvm::Error::success();
+}
\ No newline at end of file
Index: lldb/unittests/TestingSupport/CMakeLists.txt
===
--- lldb/unittests/TestingSupport/CMakeLists.txt
+++ lldb/unittests/TestingSupport/CMakeLists.txt
@@ -9,3 +9,6 @@
   LINK_COMPONENTS
 Support
   )
+
+add_dependencies(lldbUtilityHelpers yaml2obj)
+add_definitions(-DYAML2OBJ="

[Lldb-commits] [PATCH] D61292: Include inlined functions when figuring out a contiguous address range

2019-05-03 Thread António Afonso via Phabricator via lldb-commits
aadsm updated this revision to Diff 198115.
aadsm added a comment.
Herald added subscribers: MaskRay, arichardson, emaste.
Herald added a reviewer: espindola.

- Renamed CompareFileAndLine to FileAndLineEqual and made it return a bool
- Made include_inlined_functions a mandatory parameter in 
GetSameLineContiguousAddressRange
- Fix documentation
- Refactored the object file creation from YAML
- Got rid of a bunch of macros
- Improved the test case


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292

Files:
  lldb/include/lldb/Core/AddressRange.h
  lldb/include/lldb/Symbol/Block.h
  lldb/include/lldb/Symbol/Declaration.h
  lldb/include/lldb/Symbol/LineEntry.h
  lldb/source/Core/AddressRange.cpp
  lldb/source/Symbol/Block.cpp
  lldb/source/Symbol/Declaration.cpp
  lldb/source/Symbol/LineEntry.cpp
  lldb/source/Target/Thread.cpp
  lldb/source/Target/ThreadPlanStepOut.cpp
  lldb/source/Target/ThreadPlanStepRange.cpp
  lldb/tools/lldb-test/lldb-test.cpp
  lldb/unittests/Core/CMakeLists.txt
  lldb/unittests/Core/MangledTest.cpp
  lldb/unittests/Interpreter/TestCompletion.cpp
  lldb/unittests/ObjectFile/ELF/CMakeLists.txt
  lldb/unittests/ObjectFile/ELF/TestObjectFileELF.cpp
  lldb/unittests/Symbol/CMakeLists.txt
  lldb/unittests/Symbol/Inputs/inlined-functions.yaml
  lldb/unittests/Symbol/TestDWARFCallFrameInfo.cpp
  lldb/unittests/Symbol/TestLineEntry.cpp
  lldb/unittests/TestingSupport/CMakeLists.txt
  lldb/unittests/TestingSupport/TestUtilities.cpp
  lldb/unittests/TestingSupport/TestUtilities.h

Index: lldb/unittests/TestingSupport/TestUtilities.h
===
--- lldb/unittests/TestingSupport/TestUtilities.h
+++ lldb/unittests/TestingSupport/TestUtilities.h
@@ -9,11 +9,26 @@
 #ifndef LLDB_UNITTESTS_UTILITY_HELPERS_TESTUTILITIES_H
 #define LLDB_UNITTESTS_UTILITY_HELPERS_TESTUTILITIES_H
 
+#include "llvm/ADT/SmallString.h"
 #include "llvm/ADT/Twine.h"
+#include "llvm/Support/Error.h"
 #include 
 
+#define ASSERT_NO_ERROR(x) \
+  if (std::error_code ASSERT_NO_ERROR_ec = x) {\
+llvm::SmallString<128> MessageStorage; \
+llvm::raw_svector_ostream Message(MessageStorage); \
+Message << #x ": did not return errc::success.\n"  \
+<< "error number: " << ASSERT_NO_ERROR_ec.value() << "\n"  \
+<< "error message: " << ASSERT_NO_ERROR_ec.message() << "\n";  \
+GTEST_FATAL_FAILURE_(MessageStorage.c_str());  \
+  } else { \
+  }
+
 namespace lldb_private {
 std::string GetInputFilePath(const llvm::Twine &name);
+llvm::Error ReadYAMLObjectFile(const llvm::Twine &yaml_name,
+   llvm::SmallString<128> &obj);
 }
 
 #endif
Index: lldb/unittests/TestingSupport/TestUtilities.cpp
===
--- lldb/unittests/TestingSupport/TestUtilities.cpp
+++ lldb/unittests/TestingSupport/TestUtilities.cpp
@@ -9,7 +9,9 @@
 #include "TestUtilities.h"
 #include "llvm/ADT/SmallString.h"
 #include "llvm/Support/FileSystem.h"
+#include "llvm/Support/FormatVariadic.h"
 #include "llvm/Support/Path.h"
+#include "llvm/Support/Program.h"
 
 extern const char *TestMainArgv0;
 
@@ -19,3 +21,24 @@
   llvm::sys::path::append(result, "Inputs", name);
   return result.str();
 }
+
+llvm::Error
+lldb_private::ReadYAMLObjectFile(const llvm::Twine &yaml_name,
+ llvm::SmallString<128> &object_file) {
+  std::string yaml = GetInputFilePath(yaml_name);
+  llvm::StringRef args[] = {YAML2OBJ, yaml};
+  llvm::StringRef obj_ref = object_file;
+  const llvm::Optional redirects[] = {llvm::None, obj_ref,
+   llvm::None};
+  if (llvm::sys::ExecuteAndWait(YAML2OBJ, args, llvm::None, redirects) != 0)
+return llvm::createStringError(llvm::inconvertibleErrorCode(),
+   "Error running yaml2obj %s.", yaml.c_str());
+  uint64_t size;
+  if (auto ec = llvm::sys::fs::file_size(object_file, size))
+return llvm::errorCodeToError(ec);
+  if (size == 0)
+return llvm::createStringError(
+llvm::inconvertibleErrorCode(),
+"Empty object file created from yaml2obj %s.", yaml.c_str());
+  return llvm::Error::success();
+}
\ No newline at end of file
Index: lldb/unittests/TestingSupport/CMakeLists.txt
===
--- lldb/unittests/TestingSupport/CMakeLists.txt
+++ lldb/unittests/TestingSupport/CMakeLists.txt
@@ -9,3 +9,6 @@
   LINK_COMPONENTS
 Support
   )
+
+add_dependencies(lldbUtilityHelpers yaml2obj)
+add_definitions(-DYAML2OBJ="$")
\ No newline at end of f

[Lldb-commits] [PATCH] D61235: Add more information to the log timer dump

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

Undo the previous changes because I updated to the wrong diff.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61235

Files:
  lldb/include/lldb/Utility/Timer.h
  lldb/source/Utility/Timer.cpp
  lldb/unittests/Utility/TimerTest.cpp

Index: lldb/unittests/Utility/TimerTest.cpp
===
--- lldb/unittests/Utility/TimerTest.cpp
+++ lldb/unittests/Utility/TimerTest.cpp
@@ -61,7 +61,9 @@
   StreamString ss;
   Timer::DumpCategoryTimes(&ss);
   double seconds1, seconds2;
-  ASSERT_EQ(2, sscanf(ss.GetData(), "%lf sec for CAT1%*[\n ]%lf sec for CAT2",
+  ASSERT_EQ(2, sscanf(ss.GetData(),
+  "%lf sec (total: %*lfs; child: %*lfs; count: %*d) for "
+  "CAT1%*[\n ]%lf sec for CAT2",
   &seconds1, &seconds2))
   << "String: " << ss.GetData();
   EXPECT_LT(0.01, seconds1);
@@ -69,3 +71,38 @@
   EXPECT_LT(0.001, seconds2);
   EXPECT_GT(0.1, seconds2);
 }
+
+TEST(TimerTest, CategoryTimesStats) {
+  Timer::ResetCategoryTimes();
+  {
+static Timer::Category tcat1("CAT1");
+Timer t1(tcat1, ".");
+std::this_thread::sleep_for(std::chrono::milliseconds(100));
+static Timer::Category tcat2("CAT2");
+{
+  Timer t2(tcat2, ".");
+  std::this_thread::sleep_for(std::chrono::milliseconds(10));
+}
+{
+  Timer t3(tcat2, ".");
+  std::this_thread::sleep_for(std::chrono::milliseconds(10));
+}
+  }
+  // Example output:
+  // 0.105202764 sec (total: 0.132s; child: 0.027s; count: 1) for CAT1
+  // 0.026772798 sec (total: 0.027s; child: 0.000s; count: 2) for CAT2
+  StreamString ss;
+  Timer::DumpCategoryTimes(&ss);
+  double seconds1, total1, child1, seconds2;
+  int count1, count2;
+  ASSERT_EQ(
+  6, sscanf(ss.GetData(),
+"%lf sec (total: %lfs; child: %lfs; count: %d) for CAT1%*[\n ]"
+"%lf sec (total: %*lfs; child: %*lfs; count: %d) for CAT2",
+&seconds1, &total1, &child1, &count1, &seconds2, &count2))
+  << "String: " << ss.GetData();
+  EXPECT_NEAR(total1 - child1, seconds1, 0.002)
+  EXPECT_EQ(1, count1);
+  EXPECT_NEAR(total1, seconds2, 0.002)
+  EXPECT_EQ(2, count2);
+}
Index: lldb/source/Utility/Timer.cpp
===
--- lldb/source/Utility/Timer.cpp
+++ lldb/source/Utility/Timer.cpp
@@ -41,6 +41,8 @@
 
 Timer::Category::Category(const char *cat) : m_name(cat) {
   m_nanos.store(0, std::memory_order_release);
+  m_nanos_total.store(0, std::memory_order_release);
+  m_count.store(0, std::memory_order_release);
   Category *expected = g_categories;
   do {
 m_next = expected;
@@ -93,6 +95,8 @@
 
   // Keep total results for each category so we can dump results.
   m_category.m_nanos += std::chrono::nanoseconds(timer_dur).count();
+  m_category.m_nanos_total += std::chrono::nanoseconds(total_dur).count();
+  m_category.m_count++;
 }
 
 void Timer::SetDisplayDepth(uint32_t depth) { g_display_depth = depth; }
@@ -100,25 +104,38 @@
 /* binary function predicate:
  * - returns whether a person is less than another person
  */
-
-typedef std::pair TimerEntry;
-
-static bool CategoryMapIteratorSortCriterion(const TimerEntry &lhs,
- const TimerEntry &rhs) {
-  return lhs.second > rhs.second;
+namespace {
+struct Stats {
+  const char *name;
+  uint64_t nanos;
+  uint64_t nanos_total;
+  uint64_t count;
+};
+} // namespace
+
+static bool CategoryMapIteratorSortCriterion(const Stats &lhs,
+ const Stats &rhs) {
+  return lhs.nanos > rhs.nanos;
 }
 
 void Timer::ResetCategoryTimes() {
-  for (Category *i = g_categories; i; i = i->m_next)
+  for (Category *i = g_categories; i; i = i->m_next) {
 i->m_nanos.store(0, std::memory_order_release);
+i->m_nanos_total.store(0, std::memory_order_release);
+i->m_count.store(0, std::memory_order_release);
+  }
 }
 
 void Timer::DumpCategoryTimes(Stream *s) {
-  std::vector sorted;
+  std::vector sorted;
   for (Category *i = g_categories; i; i = i->m_next) {
 uint64_t nanos = i->m_nanos.load(std::memory_order_acquire);
-if (nanos)
-  sorted.push_back(std::make_pair(i->m_name, nanos));
+if (nanos) {
+  uint64_t nanos_total = i->m_nanos_total.load(std::memory_order_acquire);
+  uint64_t count = i->m_count.load(std::memory_order_acquire);
+  Stats stats{i->m_name, nanos, nanos_total, count};
+  sorted.push_back(stats);
+}
   }
   if (sorted.empty())
 return; // Later code will break without any elements.
@@ -126,6 +143,9 @@
   // Sort by time
   llvm::sort(sorted.begin(), sorted.end(), CategoryMapIteratorSortCriterion);
 
-  for (const auto &timer : sorted)
-s->Printf("%.9f sec for %s\n", timer.second / 10., timer.first);
+  for (

[Lldb-commits] [PATCH] D61292: Include inlined functions when figuring out a contiguous address range

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

LGTM, you should probably wait on Pavel's okay to the testing framework changes 
since that's more his baby...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61292



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