[Lldb-commits] [PATCH] D63540: Fix lookup of symbols at the same address with no size vs. size

2019-12-13 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil added a comment.

@omjavaid Do you still see any regression of this patch after D71498 
?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63540



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


[Lldb-commits] [PATCH] D71498: Fix ARM32 inferior calls

2019-12-13 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: omjavaid, labath.
jankratochvil added a project: LLDB.
Herald added subscribers: kristof.beyls, aprantl.
jankratochvil added a reviewer: jasonmolenda.

  echo -e '#include \nint main(void){\nsync();return 0;}'|./bin/clang 
-g -x c -;./bin/lldb -o 'file ./a.out' -o 'b main' -o r -o 'p (void)sync()'

Actual:

  error: Expression can't be run, because there is no JIT compiled function

Expected:

  

Casting from 32-bit `void *` to `uint64_t` requires an intermediate `uintptr_t` 
cast otherwise the pointer gets sign-extended:

  echo -e '#include \n#include \nint main(void){void 
*p=(void *)0x8000;unsigned long long ull=(unsigned long long)p;unsigned 
long long ull2=(unsigned long long)(uintptr_t)p;printf("p=%p ull=0x%llx 
ull2=0x%llx\\n",p,ull,ull2);return 0;}'|gcc -Wall -m32 -x c -;./a.out 
  : In function ‘main’:
  :3:66: warning: cast from pointer to integer of different size 
[-Wpointer-to-int-cast]
  p=0x8000 ull=0x8000 ull2=0x8000

With debug output:
Actual:

  IRMemoryMap::WriteMemory (0xb6ff8640, 0xb6f82158, 0x112) went to 
[0xb6ff8640..0xb6ff86b3)
  Code can be run in the target.
  Found function, has local address 0xb6f84000 and remote address 
0x
  Couldn't disassemble function : Couldn't find code range for function 
_Z12$__lldb_exprPv
  Sections:
  [0xb6f84000+0x3c]->0xb6ff9020 (alignment 4, section ID 0, name .text)
  ...
  HandleCommand, command did not succeed
  error: Expression can't be run, because there is no JIT compiled function

Expected:

  IRMemoryMap::WriteMemory (0xb6ff8640, 0xb6faa15c, 0x128) went to 
[0xb6ff8640..0xb6ff86c3)
  IRExecutionUnit::GetRemoteAddressForLocal() found 0xb6fac000 in 
[0xb6fac000..0xb6fac040], and returned 0xb6ff9020 from [0xb6ff9020..0xb6ff9060].
  Code can be run in the target.
  Found function, has local address 0xb6fac000 and remote address 0xb6ff9020
  Function's code range is [0xb6ff9020+0x40]
  ...
  Function data has contents:
  0xb6ff9020: 10 4c 2d e9 08 b0 8d e2 08 d0 4d e2 00 40 a0 e1
  ...
  Function disassembly:
  0xb6ff9020: 0xe92d4c10   push   {r4, r10, r11, lr}

Effect of this patch on ARM32:

  -=before patch
  +=after patch
   
  -Unexpected Passing Tests (1):
  +Unexpected Passing Tests (3):
  +lldb-api :: commands/expression/char/TestExprsChar.py
  +lldb-api :: commands/expression/ir-interpreter/TestIRInterpreter.py
   lldb-api :: linux/builtin_trap/TestBuiltinTrap.py
  
   
  -Failing Tests (102):
  +Failing Tests (43):
  -lldb-api :: 
commands/expression/argument_passing_restrictions/TestArgumentPassingRestrictions.py
  -lldb-api :: 
commands/expression/call-function/TestCallStdStringFunction.py
  -lldb-api :: commands/expression/call-function/TestCallStopAndContinue.py
  -lldb-api :: 
commands/expression/call-function/TestCallUserDefinedFunction.py
  -lldb-api :: 
commands/expression/call-overridden-method/TestCallOverriddenMethod.py
  -lldb-api :: commands/expression/call-restarts/TestCallThatRestarts.py
  -lldb-api :: commands/expression/char/TestExprsChar.py
  -lldb-api :: 
commands/expression/class_template_specialization_empty_pack/TestClassTemplateSpecializationParametersHandling.py
  -lldb-api :: commands/expression/context-object/TestContextObject.py
  -lldb-api :: commands/expression/dont_allow_jit/TestAllowJIT.py
  -lldb-api :: commands/expression/entry-bp/TestExprEntryBP.py
  -lldb-api :: 
commands/expression/expr-in-syscall/TestExpressionInSyscall.py
  -lldb-api :: commands/expression/formatters/TestFormatters.py
  -lldb-api :: commands/expression/inline-namespace/TestInlineNamespace.py
  -lldb-api :: commands/expression/no-deadlock/TestExprDoesntBlock.py
  -lldb-api :: 
commands/expression/persistent_types/TestNestedPersistentTypes.py
  -lldb-api :: commands/expression/persistent_types/TestPersistentTypes.py
  -lldb-api :: commands/expression/pr35310/TestExprsBug35310.py
  -lldb-api :: commands/expression/radar_9531204/TestPrintfAfterUp.py
  -lldb-api :: commands/expression/radar_9673664/TestExprHelpExamples.py
   lldb-api :: commands/expression/rdar44436068/Test128BitsInteger.py
  -lldb-api :: 
commands/expression/static-initializers/TestStaticInitializers.py
  -lldb-api :: commands/expression/test/TestExprs.py
  -lldb-api :: commands/expression/timeout/TestCallWithTimeout.py
  -lldb-api :: commands/expression/unwind_expression/TestUnwindExpression.py
  -lldb-api :: commands/expression/xvalue/TestXValuePrinting.py
   lldb-api :: commands/register/register/register_command/TestRegisters.py
   lldb-api :: commands/watchpoints/hello_watchlocation/TestWatchLocation.py
   lldb-api :: 
commands/watchpoints/multi_watchpoint_slots/TestWatchpointMultipleSlots.py
   lldb-api :: commands/watchpoints/watchpoint_size/TestWatchpointSizes.py
   

[Lldb-commits] [PATCH] D71487: [LLDB] Fix address computation for member function linked with lld

2019-12-13 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/test/Shell/Expr/TestFunctionAddress.lldb:6
+next
+expr argv.four()
+# CHECK: expr argv.four()

aprantl wrote:
> This would be better suited for a python test. (You can copy the example test 
> as a starting point).
Thinking about it some more, you are testing for a peculiarity in the DWARF 
emitted by lld. This would actually be best for an assembler or yaml2obj test 
that guarantees that that peculiarity is actually there. That said, yaml2obj 
tests make most sense in combination with lldb-test. When you need a live 
process to run an expression, like here, they make less sense, since they can 
only run on one particular platform. So I'm not sure what to recommend.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71487



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


[Lldb-commits] [PATCH] D71487: [LLDB] Fix address computation for member function linked with lld

2019-12-13 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added inline comments.



Comment at: lldb/test/Shell/Expr/TestFunctionAddress.lldb:6
+next
+expr argv.four()
+# CHECK: expr argv.four()

This would be better suited for a python test. (You can copy the example test 
as a starting point).


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71487



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


[Lldb-commits] [PATCH] D71405: [lldb] Centralize desugaring of decltype-like types in ClangASTContext

2019-12-13 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.

The change LGTM but the test could just be a unit test instead of doing the 
whole compile->start->attach->expr command cycle.

You can just add this to the `TestClangASTContext.cpp` to test the (nested) 
desugaring and the three types you covered (and one of the switch statements).

  static QualType makeConstInt(clang::ASTContext ) {
QualType result(ctxt.IntTy);
result.addConst();
return result;
  }
  
  TEST_F(TestClangASTContext, TestGetTypeClassDeclType) {
clang::ASTContext  = *m_ast->getASTContext();
auto *nullptr_expr = new (ctxt) CXXNullPtrLiteralExpr(ctxt.NullPtrTy, 
SourceLocation());
QualType t = ctxt.getDecltypeType(nullptr_expr, makeConstInt(ctxt));
EXPECT_EQ(lldb::eTypeClassBuiltin, m_ast->GetTypeClass(t.getAsOpaquePtr()));
  }
  
  TEST_F(TestClangASTContext, TestGetTypeClassTypeOf) {
clang::ASTContext  = *m_ast->getASTContext();
QualType t = ctxt.getTypeOfType(makeConstInt(ctxt));
EXPECT_EQ(lldb::eTypeClassBuiltin, m_ast->GetTypeClass(t.getAsOpaquePtr()));
  }
  
  TEST_F(TestClangASTContext, TestGetTypeClassTypeOfExpr) {
clang::ASTContext  = *m_ast->getASTContext();
auto *nullptr_expr = new (ctxt) CXXNullPtrLiteralExpr(ctxt.NullPtrTy, 
SourceLocation());
QualType t = ctxt.getTypeOfExprType(nullptr_expr);
EXPECT_EQ(lldb::eTypeClassBuiltin, m_ast->GetTypeClass(t.getAsOpaquePtr()));
  }
  
  TEST_F(TestClangASTContext, TestGetTypeClassNested) {
clang::ASTContext  = *m_ast->getASTContext();
QualType t_base = ctxt.getTypeOfType(makeConstInt(ctxt));
QualType t = ctxt.getTypeOfType(t_base);
EXPECT_EQ(lldb::eTypeClassBuiltin, m_ast->GetTypeClass(t.getAsOpaquePtr()));
  }


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71405



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


[Lldb-commits] [lldb] 3a6da11 - [lldb/SWIG] Modulerize lldb.swig so parts of it can be reused.

2019-12-13 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2019-12-13T14:49:44-08:00
New Revision: 3a6da1122b990386edeba0987d0d1fdc9c8dc53d

URL: 
https://github.com/llvm/llvm-project/commit/3a6da1122b990386edeba0987d0d1fdc9c8dc53d
DIFF: 
https://github.com/llvm/llvm-project/commit/3a6da1122b990386edeba0987d0d1fdc9c8dc53d.diff

LOG: [lldb/SWIG] Modulerize lldb.swig so parts of it can be reused.

This groups the headers and interfaces in separate files that can be
included by other swig files for different languages.

Added: 
lldb/scripts/headers.swig
lldb/scripts/interfaces.swig

Modified: 
lldb/scripts/lldb.swig

Removed: 




diff  --git a/lldb/scripts/headers.swig b/lldb/scripts/headers.swig
new file mode 100644
index ..69fd28e33c58
--- /dev/null
+++ b/lldb/scripts/headers.swig
@@ -0,0 +1,76 @@
+/* C++ headers to be included. */
+%{
+#include 
+#include 
+%}
+
+/* The liblldb header files to be included. */
+%{
+#include "lldb/lldb-public.h"
+#include "lldb/API/SBAddress.h"
+#include "lldb/API/SBAttachInfo.h"
+#include "lldb/API/SBBlock.h"
+#include "lldb/API/SBBreakpoint.h"
+#include "lldb/API/SBBreakpointLocation.h"
+#include "lldb/API/SBBreakpointName.h"
+#include "lldb/API/SBBroadcaster.h"
+#include "lldb/API/SBCommandInterpreter.h"
+#include "lldb/API/SBCommandReturnObject.h"
+#include "lldb/API/SBCommunication.h"
+#include "lldb/API/SBCompileUnit.h"
+#include "lldb/API/SBData.h"
+#include "lldb/API/SBDebugger.h"
+#include "lldb/API/SBDeclaration.h"
+#include "lldb/API/SBError.h"
+#include "lldb/API/SBEvent.h"
+#include "lldb/API/SBExecutionContext.h"
+#include "lldb/API/SBExpressionOptions.h"
+#include "lldb/API/SBFileSpec.h"
+#include "lldb/API/SBFile.h"
+#include "lldb/API/SBFileSpecList.h"
+#include "lldb/API/SBFrame.h"
+#include "lldb/API/SBFunction.h"
+#include "lldb/API/SBHostOS.h"
+#include "lldb/API/SBInstruction.h"
+#include "lldb/API/SBInstructionList.h"
+#include "lldb/API/SBLanguageRuntime.h"
+#include "lldb/API/SBLaunchInfo.h"
+#include "lldb/API/SBLineEntry.h"
+#include "lldb/API/SBListener.h"
+#include "lldb/API/SBMemoryRegionInfo.h"
+#include "lldb/API/SBMemoryRegionInfoList.h"
+#include "lldb/API/SBModule.h"
+#include "lldb/API/SBModuleSpec.h"
+#include "lldb/API/SBPlatform.h"
+#include "lldb/API/SBProcess.h"
+#include "lldb/API/SBProcessInfo.h"
+#include "lldb/API/SBQueue.h"
+#include "lldb/API/SBQueueItem.h"
+#include "lldb/API/SBSection.h"
+#include "lldb/API/SBSourceManager.h"
+#include "lldb/API/SBStream.h"
+#include "lldb/API/SBStringList.h"
+#include "lldb/API/SBStructuredData.h"
+#include "lldb/API/SBSymbol.h"
+#include "lldb/API/SBSymbolContext.h"
+#include "lldb/API/SBSymbolContextList.h"
+#include "lldb/API/SBTarget.h"
+#include "lldb/API/SBThread.h"
+#include "lldb/API/SBThreadCollection.h"
+#include "lldb/API/SBThreadPlan.h"
+#include "lldb/API/SBTrace.h"
+#include "lldb/API/SBTraceOptions.h"
+#include "lldb/API/SBType.h"
+#include "lldb/API/SBTypeCategory.h"
+#include "lldb/API/SBTypeEnumMember.h"
+#include "lldb/API/SBTypeFilter.h"
+#include "lldb/API/SBTypeFormat.h"
+#include "lldb/API/SBTypeNameSpecifier.h"
+#include "lldb/API/SBTypeSummary.h"
+#include "lldb/API/SBTypeSynthetic.h"
+#include "lldb/API/SBValue.h"
+#include "lldb/API/SBValueList.h"
+#include "lldb/API/SBVariablesOptions.h"
+#include "lldb/API/SBWatchpoint.h"
+#include "lldb/API/SBUnixSignals.h"
+%}

diff  --git a/lldb/scripts/interfaces.swig b/lldb/scripts/interfaces.swig
new file mode 100644
index ..cc6bb91febda
--- /dev/null
+++ b/lldb/scripts/interfaces.swig
@@ -0,0 +1,83 @@
+/* Various liblldb typedefs that SWIG needs to know about.  */
+#define __extension__ /* Undefine GCC keyword to make Swig happy when 
processing glibc's stdint.h. */
+/* The ISO C99 standard specifies that in C++ implementations limit macros such
+   as INT32_MAX should only be defined if __STDC_LIMIT_MACROS is. */
+#define __STDC_LIMIT_MACROS
+%include "stdint.i"
+
+%include "lldb/lldb-defines.h"
+%include "lldb/lldb-enumerations.h"
+%include "lldb/lldb-forward.h"
+%include "lldb/lldb-types.h"
+
+/* Forward declaration of SB classes. */
+%include "lldb/API/SBDefines.h"
+
+/* Python interface files with docstrings. */
+%include "./interface/SBAddress.i"
+%include "./interface/SBAttachInfo.i"
+%include "./interface/SBBlock.i"
+%include "./interface/SBBreakpoint.i"
+%include "./interface/SBBreakpointLocation.i"
+%include "./interface/SBBreakpointName.i"
+%include "./interface/SBBroadcaster.i"
+%include "./interface/SBCommandInterpreter.i"
+%include "./interface/SBCommandReturnObject.i"
+%include "./interface/SBCommunication.i"
+%include "./interface/SBCompileUnit.i"
+%include "./interface/SBData.i"
+%include "./interface/SBDebugger.i"
+%include "./interface/SBDeclaration.i"
+%include "./interface/SBError.i"
+%include "./interface/SBEvent.i"
+%include "./interface/SBExecutionContext.i"
+%include "./interface/SBExpressionOptions.i"

[Lldb-commits] [PATCH] D71310: RFC: Remove "Validators"

2019-12-13 Thread Adrian Prantl via Phabricator via lldb-commits
aprantl added a comment.

Whoops. Thanks for fixing it!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71310



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:43
+  else()
+set(default_enable_python ON)
+  endif()

mgorny wrote:
> JDevlieghere wrote:
> > mgorny wrote:
> > > JDevlieghere wrote:
> > > > mgorny wrote:
> > > > > I know that the same thing is done above but… what's the point of 
> > > > > setting it to `ON` again?
> > > > It's just setting the default to the old value. If the value was set, 
> > > > we should honor it, both if it was `OFF` or `ON`.
> > > But it's already set to `ON` a few lines above.
> > Do you mean the `DEFINED`? That just checks if the variable exists, not its 
> > value. 
> No, I mean you have:
> 
> ```
> set(default_enable_python ON)
> #...
> if (DEFINED LLDB_DISABLE_PYTHON)
>   #...
>   else()
> set(default_enable_python ON)
> ```
> 
> This is superfluous since the default is already `ON`.
Got it, thanks. Simplified the code. 



Comment at: lldb/source/Commands/CommandObjectType.cpp:1173
 
 // CommandObjectTypeSummaryAdd
 

teemperor wrote:
> lol?
Hahaha


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71234: [lldb/Lua] Implement a Simple Lua Script Interpreter Prototype

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 233877.
JDevlieghere added a comment.

- Rebase
- Hide C calls behind C++ abstraction
- Improve error handling
- Add unit test


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

https://reviews.llvm.org/D71234

Files:
  lldb/include/lldb/Core/IOHandler.h
  lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/unittests/ScriptInterpreter/CMakeLists.txt
  lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt
  lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp

Index: lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
===
--- /dev/null
+++ lldb/unittests/ScriptInterpreter/Lua/LuaTests.cpp
@@ -0,0 +1,62 @@
+//===-- LuaTests.cpp --===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "Plugins/Platform/Linux/PlatformLinux.h"
+#include "Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Host/FileSystem.h"
+#include "lldb/Host/HostInfo.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
+#include "lldb/Target/Platform.h"
+#include "lldb/Utility/Reproducer.h"
+#include "gtest/gtest.h"
+
+using namespace lldb_private;
+using namespace lldb_private::repro;
+using namespace lldb;
+
+namespace {
+class ScriptInterpreterTest : public ::testing::Test {
+public:
+  void SetUp() override {
+llvm::cantFail(Reproducer::Initialize(ReproducerMode::Off, llvm::None));
+FileSystem::Initialize();
+HostInfo::Initialize();
+
+// Pretend Linux is the host platform.
+platform_linux::PlatformLinux::Initialize();
+ArchSpec arch("powerpc64-pc-linux");
+Platform::SetHostPlatform(
+platform_linux::PlatformLinux::CreateInstance(true, ));
+  }
+  void TearDown() override {
+platform_linux::PlatformLinux::Terminate();
+HostInfo::Terminate();
+FileSystem::Terminate();
+Reproducer::Terminate();
+  }
+};
+} // namespace
+
+TEST_F(ScriptInterpreterTest, Plugin) {
+  EXPECT_EQ(ScriptInterpreterLua::GetPluginNameStatic(), "script-lua");
+  EXPECT_EQ(ScriptInterpreterLua::GetPluginDescriptionStatic(),
+"Lua script interpreter");
+}
+
+TEST_F(ScriptInterpreterTest, ExecuteOneLine) {
+  DebuggerSP debugger_sp = Debugger::CreateInstance();
+  ASSERT_TRUE(debugger_sp);
+
+  ScriptInterpreterLua script_interpreter(*debugger_sp);
+  CommandReturnObject result;
+  EXPECT_TRUE(script_interpreter.ExecuteOneLine("foo = 1", ));
+  EXPECT_FALSE(script_interpreter.ExecuteOneLine("nil = foo", ));
+  EXPECT_TRUE(result.GetErrorData().startswith(
+  "error: lua failed attempting to evaluate 'nil = foo'"));
+}
Index: lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt
===
--- /dev/null
+++ lldb/unittests/ScriptInterpreter/Lua/CMakeLists.txt
@@ -0,0 +1,11 @@
+add_lldb_unittest(ScriptInterpreterLuaTests
+  LuaTests.cpp
+
+  LINK_LIBS
+lldbHost
+lldbPluginScriptInterpreterLua
+lldbPluginPlatformLinux
+LLVMTestingSupport
+  LINK_COMPONENTS
+Support
+  )
\ No newline at end of file
Index: lldb/unittests/ScriptInterpreter/CMakeLists.txt
===
--- lldb/unittests/ScriptInterpreter/CMakeLists.txt
+++ lldb/unittests/ScriptInterpreter/CMakeLists.txt
@@ -1,3 +1,6 @@
 if (LLDB_ENABLE_PYTHON)
   add_subdirectory(Python)
 endif()
+if (LLDB_ENABLE_LUA)
+  add_subdirectory(Lua)
+endif()
Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
===
--- lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
@@ -10,32 +10,114 @@
 #include "lldb/Core/Debugger.h"
 #include "lldb/Core/PluginManager.h"
 #include "lldb/Core/StreamFile.h"
+#include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Utility/Stream.h"
 #include "lldb/Utility/StringList.h"
-
+#include "lldb/Utility/Timer.h"
 #include "llvm/Support/Threading.h"
 
+#ifndef LLDB_DISABLE_LIBEDIT
+#include "lldb/Host/Editline.h"
+#endif
+
+#include "lua.hpp"
+
+#define LUA_PROMPT ">>> "
+
 #include 
 
 using namespace lldb;
 using namespace lldb_private;
 
+class Lua {
+public:
+  Lua() : m_lua_state(luaL_newstate()) {
+assert(m_lua_state);
+luaL_openlibs(m_lua_state);
+  }
+  ~Lua() {
+assert(m_lua_state);
+luaL_openlibs(m_lua_state);
+  }
+
+  llvm::Error Run(llvm::StringRef buffer) {
+int error =
+luaL_loadbuffer(m_lua_state, buffer.data(), buffer.size(), "buffer") ||
+

[Lldb-commits] [PATCH] D71232: [lldb/Lua] Add Boilerplate for a Lua Script Interpreter

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere updated this revision to Diff 233876.
JDevlieghere added a comment.

Rebase


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

https://reviews.llvm.org/D71232

Files:
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/include/lldb/Host/Config.h.cmake
  lldb/include/lldb/lldb-enumerations.h
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Interpreter/OptionArgParser.cpp
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
  lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h

Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
===
--- /dev/null
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.h
@@ -0,0 +1,47 @@
+//===-- ScriptInterpreterLua.h --*- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#ifndef liblldb_ScriptInterpreterLua_h_
+#define liblldb_ScriptInterpreterLua_h_
+
+#include "lldb/Interpreter/ScriptInterpreter.h"
+
+namespace lldb_private {
+
+class ScriptInterpreterLua : public ScriptInterpreter {
+public:
+  ScriptInterpreterLua(Debugger );
+
+  ~ScriptInterpreterLua() override;
+
+  bool ExecuteOneLine(
+  llvm::StringRef command, CommandReturnObject *result,
+  const ExecuteScriptOptions  = ExecuteScriptOptions()) override;
+
+  void ExecuteInterpreterLoop() override;
+
+  // Static Functions
+  static void Initialize();
+
+  static void Terminate();
+
+  static lldb::ScriptInterpreterSP CreateInstance(Debugger );
+
+  static lldb_private::ConstString GetPluginNameStatic();
+
+  static const char *GetPluginDescriptionStatic();
+
+  // PluginInterface protocol
+  lldb_private::ConstString GetPluginName() override;
+
+  uint32_t GetPluginVersion() override;
+};
+
+} // namespace lldb_private
+
+#endif // liblldb_ScriptInterpreterLua_h_
Index: lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
===
--- /dev/null
+++ lldb/source/Plugins/ScriptInterpreter/Lua/ScriptInterpreterLua.cpp
@@ -0,0 +1,71 @@
+//===-- ScriptInterpreterLua.cpp *- C++ -*-===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===--===//
+
+#include "ScriptInterpreterLua.h"
+#include "lldb/Core/Debugger.h"
+#include "lldb/Core/PluginManager.h"
+#include "lldb/Core/StreamFile.h"
+#include "lldb/Utility/Stream.h"
+#include "lldb/Utility/StringList.h"
+
+#include "llvm/Support/Threading.h"
+
+#include 
+
+using namespace lldb;
+using namespace lldb_private;
+
+ScriptInterpreterLua::ScriptInterpreterLua(Debugger )
+: ScriptInterpreter(debugger, eScriptLanguageLua) {}
+
+ScriptInterpreterLua::~ScriptInterpreterLua() {}
+
+bool ScriptInterpreterLua::ExecuteOneLine(llvm::StringRef command,
+  CommandReturnObject *,
+  const ExecuteScriptOptions &) {
+  m_debugger.GetErrorStream().PutCString(
+  "error: the lua script interpreter is not yet implemented.\n");
+  return false;
+}
+
+void ScriptInterpreterLua::ExecuteInterpreterLoop() {
+  m_debugger.GetErrorStream().PutCString(
+  "error: the lua script interpreter is not yet implemented.\n");
+}
+
+void ScriptInterpreterLua::Initialize() {
+  static llvm::once_flag g_once_flag;
+
+  llvm::call_once(g_once_flag, []() {
+PluginManager::RegisterPlugin(GetPluginNameStatic(),
+  GetPluginDescriptionStatic(),
+  lldb::eScriptLanguageLua, CreateInstance);
+  });
+}
+
+void ScriptInterpreterLua::Terminate() {}
+
+lldb::ScriptInterpreterSP
+ScriptInterpreterLua::CreateInstance(Debugger ) {
+  return std::make_shared(debugger);
+}
+
+lldb_private::ConstString ScriptInterpreterLua::GetPluginNameStatic() {
+  static ConstString g_name("script-lua");
+  return g_name;
+}
+
+const char *ScriptInterpreterLua::GetPluginDescriptionStatic() {
+  return "Lua script interpreter";
+}
+
+lldb_private::ConstString ScriptInterpreterLua::GetPluginName() {
+  return GetPluginNameStatic();
+}
+
+uint32_t ScriptInterpreterLua::GetPluginVersion() { return 1; }
Index: lldb/source/Plugins/ScriptInterpreter/Lua/CMakeLists.txt
===
--- /dev/null
+++ 

[Lldb-commits] [lldb] e8af4fd - [lldb/CMake] Initialize LLDB_ENABLE_POSIX based on the UNIX variable.

2019-12-13 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2019-12-13T13:46:43-08:00
New Revision: e8af4fd42da3580f9bda5202f381bf92d07f4b9c

URL: 
https://github.com/llvm/llvm-project/commit/e8af4fd42da3580f9bda5202f381bf92d07f4b9c
DIFF: 
https://github.com/llvm/llvm-project/commit/e8af4fd42da3580f9bda5202f381bf92d07f4b9c.diff

LOG: [lldb/CMake] Initialize LLDB_ENABLE_POSIX based on the UNIX variable.

Added: 


Modified: 
lldb/cmake/modules/LLDBGenerateConfig.cmake

Removed: 




diff  --git a/lldb/cmake/modules/LLDBGenerateConfig.cmake 
b/lldb/cmake/modules/LLDBGenerateConfig.cmake
index bee17b509247..0d3a7fdb1816 100644
--- a/lldb/cmake/modules/LLDBGenerateConfig.cmake
+++ b/lldb/cmake/modules/LLDBGenerateConfig.cmake
@@ -24,7 +24,11 @@ check_library_exists(compression compression_encode_buffer 
"" HAVE_LIBCOMPRESSIO
 # so that the check isn't duplicated, but we translate them into the LLDB names
 # so that I don't have to change all the uses at the moment.
 set(LLDB_ENABLE_TERMIOS ${HAVE_TERMIOS_H})
-set(LLDB_ENABLE_POSIX NOT UNIX)
+if (UNIX)
+  set(LLDB_ENABLE_POSIX ON)
+else()
+  set(LLDB_ENABLE_POSIX OFF)
+endif()
 
 if(NOT LLDB_CONFIG_HEADER_INPUT)
  set(LLDB_CONFIG_HEADER_INPUT ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake)



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
JDevlieghere marked an inline comment as done.
Closed by commit rG4e26cf2cfb2b: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to 
LLDB_ENABLE_PYTHON (authored by JDevlieghere).

Changed prior to commit:
  https://reviews.llvm.org/D71482?vs=233834=233875#toc

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71482

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/docs/CMakeLists.txt
  lldb/docs/resources/build.rst
  lldb/include/lldb/Host/Config.h.cmake
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/source/API/CMakeLists.txt
  lldb/source/API/SBHostOS.cpp
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Core/ValueObject.cpp
  lldb/source/Interpreter/CommandObjectScript.cpp
  lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
  lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
  lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
  lldb/test/API/lit.site.cfg.py.in
  lldb/test/API/lldbtest.py
  lldb/test/CMakeLists.txt
  lldb/test/Shell/lit.cfg.py
  lldb/test/Shell/lit.site.cfg.py.in
  lldb/tools/intel-features/CMakeLists.txt
  lldb/unittests/ScriptInterpreter/CMakeLists.txt

Index: lldb/unittests/ScriptInterpreter/CMakeLists.txt
===
--- lldb/unittests/ScriptInterpreter/CMakeLists.txt
+++ lldb/unittests/ScriptInterpreter/CMakeLists.txt
@@ -1,3 +1,3 @@
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   add_subdirectory(Python)
 endif()
Index: lldb/tools/intel-features/CMakeLists.txt
===
--- lldb/tools/intel-features/CMakeLists.txt
+++ lldb/tools/intel-features/CMakeLists.txt
@@ -23,7 +23,7 @@
 endif()
 
 # Add python wrapper if python not disabled
-if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
   set(LLDB_INTEL_FEATURES_PYTHON_WRAP
  ${LLDB_BINARY_DIR}/tools/intel-features/scripts/IntelFeaturesPythonWrap.cpp)
   set_source_files_properties(${LLDB_INTEL_FEATURES_PYTHON_WRAP}
@@ -59,7 +59,7 @@
   )
 
 # Add link dependencies for python wrapper
-if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
   add_dependencies(lldbIntelFeatures intel-features-swig_wrapper)
 endif()
 
Index: lldb/test/Shell/lit.site.cfg.py.in
===
--- lldb/test/Shell/lit.site.cfg.py.in
+++ lldb/test/Shell/lit.site.cfg.py.in
@@ -18,7 +18,7 @@
 config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
 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.lldb_enable_python = @LLDB_ENABLE_PYTHON@
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 # The shell tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
Index: lldb/test/Shell/lit.cfg.py
===
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -100,7 +100,7 @@
 else:
 lit_config.warning("lit-cpuid failed: %s" % err)
 
-if not config.lldb_disable_python:
+if config.lldb_enable_python:
 config.available_features.add('python')
 
 if config.lldb_enable_lzma:
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -143,7 +143,7 @@
 
 # These values are not canonicalized within LLVM.
 llvm_canonicalize_cmake_booleans(
-  LLDB_DISABLE_PYTHON
+  LLDB_ENABLE_PYTHON
   LLVM_ENABLE_ZLIB
   LLVM_ENABLE_SHARED_LIBS
   LLDB_IS_64_BITS)
Index: lldb/test/API/lldbtest.py
===
--- lldb/test/API/lldbtest.py
+++ lldb/test/API/lldbtest.py
@@ -55,7 +55,7 @@
 if litConfig.noExecute:
 return lit.Test.PASS, ''
 
-if test.config.lldb_disable_python:
+if not test.config.lldb_enable_python:
 return (lit.Test.UNSUPPORTED, 'Python module disabled')
 
 if test.config.unsupported:
Index: lldb/test/API/lit.site.cfg.py.in
===
--- 

[Lldb-commits] [lldb] 4e26cf2 - [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2019-12-13T13:41:11-08:00
New Revision: 4e26cf2cfb2b140a33ec236153cb2f23b5c44127

URL: 
https://github.com/llvm/llvm-project/commit/4e26cf2cfb2b140a33ec236153cb2f23b5c44127
DIFF: 
https://github.com/llvm/llvm-project/commit/4e26cf2cfb2b140a33ec236153cb2f23b5c44127.diff

LOG: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

This matches the naming scheme used by LLVM and all the other optional
dependencies in LLDB.

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

Added: 


Modified: 
lldb/CMakeLists.txt
lldb/cmake/modules/LLDBConfig.cmake
lldb/docs/CMakeLists.txt
lldb/docs/resources/build.rst
lldb/include/lldb/Host/Config.h.cmake
lldb/packages/Python/lldbsuite/test/dotest.py
lldb/source/API/CMakeLists.txt
lldb/source/API/SBHostOS.cpp
lldb/source/API/SystemInitializerFull.cpp
lldb/source/Commands/CommandObjectFrame.cpp
lldb/source/Commands/CommandObjectType.cpp
lldb/source/Core/ValueObject.cpp
lldb/source/Interpreter/CommandObjectScript.cpp
lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
lldb/test/API/lit.site.cfg.py.in
lldb/test/API/lldbtest.py
lldb/test/CMakeLists.txt
lldb/test/Shell/lit.cfg.py
lldb/test/Shell/lit.site.cfg.py.in
lldb/tools/intel-features/CMakeLists.txt
lldb/unittests/ScriptInterpreter/CMakeLists.txt

Removed: 




diff  --git a/lldb/CMakeLists.txt b/lldb/CMakeLists.txt
index e66fa49a5114..3747c9896525 100644
--- a/lldb/CMakeLists.txt
+++ b/lldb/CMakeLists.txt
@@ -40,7 +40,7 @@ if (WIN32)
   add_definitions(-D_ENABLE_EXTENDED_ALIGNED_STORAGE)
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   execute_process(
 COMMAND ${PYTHON_EXECUTABLE}
 -c "import distutils.sysconfig; 
print(distutils.sysconfig.get_python_lib(True, False, ''))"
@@ -91,7 +91,7 @@ if(LLDB_INCLUDE_TESTS)
   add_subdirectory(utils/lldb-dotest)
 endif()
 
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   get_target_property(lldb_scripts_dir swig_wrapper BINARY_DIR)
 
   if(LLDB_BUILD_FRAMEWORK)

diff  --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index d2ae1ba20140..da006039b268 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -24,16 +24,19 @@ if (LLVM_COMPILER_IS_GCC_COMPATIBLE AND NOT 
"${CMAKE_SYSTEM_NAME}" MATCHES "Darw
   set(LLDB_LINKER_SUPPORTS_GROUPS ON)
 endif()
 
-set(default_disable_python OFF)
+set(default_enable_python ON)
 set(default_enable_libedit ON)
 set(default_enable_curses ON)
 
-# Temporary support the old LLDB_DISABLE_CURSES variable
+# Temporary support the old LLDB_DISABLE_* variables
 if (DEFINED LLDB_DISABLE_CURSES)
   if (LLDB_DISABLE_CURSES)
 set(default_enable_curses OFF)
-  else()
-set(default_enable_curses ON)
+  endif()
+endif()
+if (DEFINED LLDB_DISABLE_PYTHON)
+  if (LLDB_DISABLE_PYTHON)
+set(default_enable_python OFF)
   endif()
 endif()
 
@@ -45,14 +48,14 @@ if(CMAKE_SYSTEM_NAME MATCHES "Windows")
   set(default_enable_libedit OFF)
   set(default_enable_curses OFF)
 elseif(CMAKE_SYSTEM_NAME MATCHES "Android")
-  set(default_disable_python ON)
+  set(default_enable_python OFF)
   set(default_enable_libedit OFF)
   set(default_enable_curses OFF)
 elseif(IOS)
-  set(default_disable_python ON)
+  set(default_enable_python OFF)
 endif()
 
-option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." 
${default_disable_python})
+option(LLDB_ENABLE_PYTHON "Enable Python scripting integration." 
${default_enable_python})
 option(LLDB_ENABLE_LIBEDIT "Enable the use of editline." 
${default_enable_libedit})
 option(LLDB_ENABLE_CURSES "Enable Curses integration." 
${default_enable_curses})
 option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to 
locate Python." OFF)
@@ -172,7 +175,7 @@ function(find_python_libs_windows_helper LOOKUP_DEBUG 
OUT_EXE_PATH_VARNAME OUT_L
 
   if (NOT PYTHON_EXE OR NOT PYTHON_LIB OR NOT PYTHON_DLL)
 message(WARNING "Unable to find all Python components.  Python support 
will be disabled for this build.")
-set(LLDB_DISABLE_PYTHON 1 PARENT_SCOPE)
+set(LLDB_ENABLE_PYTHON 0 PARENT_SCOPE)
 return()
   endif()
 
@@ -197,7 +200,7 @@ endfunction()
 function(find_python_libs_windows)
   if ("${PYTHON_HOME}" STREQUAL 

[Lldb-commits] [PATCH] D71489: [lldb][NFC] Remove unnecessary includes in source/Commands

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added a reviewer: JDevlieghere.
Herald added subscribers: lldb-commits, krytarowski.
Herald added a project: LLDB.
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: lldb/source/Commands/CommandCompletions.cpp:12
-#include 
-#endif
-

I did this change by hand as both includes are not used at all and the #if can 
then also go.


This removes most of unnecessary includes in the `source/Commands` directory. 
This was generated by IWYU and a script that fixed all the bogus reports from 
IWYU. Patch is tested on Linux and macOS.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D71489

Files:
  lldb/source/Commands/CommandCompletions.cpp
  lldb/source/Commands/CommandObjectApropos.cpp
  lldb/source/Commands/CommandObjectBreakpoint.cpp
  lldb/source/Commands/CommandObjectBreakpoint.h
  lldb/source/Commands/CommandObjectBreakpointCommand.cpp
  lldb/source/Commands/CommandObjectBreakpointCommand.h
  lldb/source/Commands/CommandObjectCommands.cpp
  lldb/source/Commands/CommandObjectCommands.h
  lldb/source/Commands/CommandObjectDisassemble.cpp
  lldb/source/Commands/CommandObjectExpression.cpp
  lldb/source/Commands/CommandObjectExpression.h
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectFrame.h
  lldb/source/Commands/CommandObjectGUI.cpp
  lldb/source/Commands/CommandObjectHelp.cpp
  lldb/source/Commands/CommandObjectLanguage.cpp
  lldb/source/Commands/CommandObjectLanguage.h
  lldb/source/Commands/CommandObjectLog.cpp
  lldb/source/Commands/CommandObjectLog.h
  lldb/source/Commands/CommandObjectMemory.cpp
  lldb/source/Commands/CommandObjectMultiword.cpp
  lldb/source/Commands/CommandObjectPlatform.cpp
  lldb/source/Commands/CommandObjectPlatform.h
  lldb/source/Commands/CommandObjectPlugin.cpp
  lldb/source/Commands/CommandObjectPlugin.h
  lldb/source/Commands/CommandObjectProcess.cpp
  lldb/source/Commands/CommandObjectRegister.cpp
  lldb/source/Commands/CommandObjectReproducer.cpp
  lldb/source/Commands/CommandObjectReproducer.h
  lldb/source/Commands/CommandObjectSettings.h
  lldb/source/Commands/CommandObjectSource.cpp
  lldb/source/Commands/CommandObjectSource.h
  lldb/source/Commands/CommandObjectStats.cpp
  lldb/source/Commands/CommandObjectStats.h
  lldb/source/Commands/CommandObjectTarget.cpp
  lldb/source/Commands/CommandObjectTarget.h
  lldb/source/Commands/CommandObjectThread.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Commands/CommandObjectType.h
  lldb/source/Commands/CommandObjectVersion.cpp
  lldb/source/Commands/CommandObjectWatchpoint.cpp
  lldb/source/Commands/CommandObjectWatchpoint.h
  lldb/source/Commands/CommandObjectWatchpointCommand.cpp
  lldb/source/Commands/CommandObjectWatchpointCommand.h

Index: lldb/source/Commands/CommandObjectWatchpointCommand.h
===
--- lldb/source/Commands/CommandObjectWatchpointCommand.h
+++ lldb/source/Commands/CommandObjectWatchpointCommand.h
@@ -10,8 +10,6 @@
 #define liblldb_CommandObjectWatchpointCommand_h_
 
 #include "lldb/Interpreter/CommandObjectMultiword.h"
-#include "lldb/Interpreter/Options.h"
-#include "lldb/lldb-types.h"
 
 namespace lldb_private {
 
Index: lldb/source/Commands/CommandObjectWatchpointCommand.cpp
===
--- lldb/source/Commands/CommandObjectWatchpointCommand.cpp
+++ lldb/source/Commands/CommandObjectWatchpointCommand.cpp
@@ -18,8 +18,6 @@
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Interpreter/OptionArgParser.h"
 #include "lldb/Target/Target.h"
-#include "lldb/Target/Thread.h"
-#include "lldb/Utility/State.h"
 
 using namespace lldb;
 using namespace lldb_private;
Index: lldb/source/Commands/CommandObjectWatchpoint.h
===
--- lldb/source/Commands/CommandObjectWatchpoint.h
+++ lldb/source/Commands/CommandObjectWatchpoint.h
@@ -11,7 +11,6 @@
 
 #include "lldb/Interpreter/CommandObjectMultiword.h"
 #include "lldb/Interpreter/OptionGroupWatchpoint.h"
-#include "lldb/Interpreter/Options.h"
 
 namespace lldb_private {
 
Index: lldb/source/Commands/CommandObjectWatchpoint.cpp
===
--- lldb/source/Commands/CommandObjectWatchpoint.cpp
+++ lldb/source/Commands/CommandObjectWatchpoint.cpp
@@ -16,9 +16,7 @@
 #include "lldb/Breakpoint/Watchpoint.h"
 #include "lldb/Breakpoint/WatchpointList.h"
 #include "lldb/Core/ValueObject.h"
-#include "lldb/Core/ValueObjectVariable.h"
 #include "lldb/Host/OptionParser.h"
-#include "lldb/Interpreter/CommandCompletions.h"
 #include "lldb/Interpreter/CommandInterpreter.h"
 #include "lldb/Interpreter/CommandReturnObject.h"
 #include "lldb/Symbol/Variable.h"
Index: lldb/source/Commands/CommandObjectVersion.cpp

[Lldb-commits] [PATCH] D71489: [lldb][NFC] Remove unnecessary includes in source/Commands

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: lldb/source/Commands/CommandCompletions.cpp:12
-#include 
-#endif
-

I did this change by hand as both includes are not used at all and the #if can 
then also go.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71489



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Michał Górny via Phabricator via lldb-commits
mgorny added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:43
+  else()
+set(default_enable_python ON)
+  endif()

JDevlieghere wrote:
> mgorny wrote:
> > JDevlieghere wrote:
> > > mgorny wrote:
> > > > I know that the same thing is done above but… what's the point of 
> > > > setting it to `ON` again?
> > > It's just setting the default to the old value. If the value was set, we 
> > > should honor it, both if it was `OFF` or `ON`.
> > But it's already set to `ON` a few lines above.
> Do you mean the `DEFINED`? That just checks if the variable exists, not its 
> value. 
No, I mean you have:

```
set(default_enable_python ON)
#...
if (DEFINED LLDB_DISABLE_PYTHON)
  #...
  else()
set(default_enable_python ON)
```

This is superfluous since the default is already `ON`.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 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.

That seems like a simple mechanical change and the move from DISABLE to ENABLE 
was IIRC already consensus, so LGTM.




Comment at: lldb/source/Commands/CommandObjectType.cpp:1173
 
 // CommandObjectTypeSummaryAdd
 

lol?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:43
+  else()
+set(default_enable_python ON)
+  endif()

mgorny wrote:
> JDevlieghere wrote:
> > mgorny wrote:
> > > I know that the same thing is done above but… what's the point of setting 
> > > it to `ON` again?
> > It's just setting the default to the old value. If the value was set, we 
> > should honor it, both if it was `OFF` or `ON`.
> But it's already set to `ON` a few lines above.
Do you mean the `DEFINED`? That just checks if the variable exists, not its 
value. 


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71487: [LLDB] Fix address computation for member function linked with lld

2019-12-13 Thread Johannes Altmanninger via Phabricator via lldb-commits
johannes updated this revision to Diff 233856.
johannes edited the summary of this revision.
johannes added a comment.

typo


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71487

Files:
  lldb/source/Expression/IRExecutionUnit.cpp
  lldb/test/Shell/Expr/Inputs/function-address-lib.cpp
  lldb/test/Shell/Expr/Inputs/function-address-main.cpp
  lldb/test/Shell/Expr/Inputs/function-address-shared.h
  lldb/test/Shell/Expr/TestFunctionAddress.lldb


Index: lldb/test/Shell/Expr/TestFunctionAddress.lldb
===
--- /dev/null
+++ lldb/test/Shell/Expr/TestFunctionAddress.lldb
@@ -0,0 +1,9 @@
+# RUN: %clangxx_host %p/Inputs/function-address-main.cpp 
%p/Inputs/function-address-lib.cpp -g -fuse-ld=lld -o %t
+# RUN: %lldb %t -s %s 2>&1 | FileCheck %s
+b main
+run
+next
+expr argv.four()
+# CHECK: expr argv.four()
+# CHECK-NEXT: (int) $0 = 4
+# CHECK-NOT: SIGSEGV
Index: lldb/test/Shell/Expr/Inputs/function-address-shared.h
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-shared.h
@@ -0,0 +1,23 @@
+#ifndef function_address_shared_h
+#define function_address_shared_h
+namespace llvm_namespace {
+struct TinyVectorBase {
+  int SomeInlineInitializedMember = 0;
+};
+struct TinyVector : TinyVectorBase {
+  TinyVector *Self;
+
+  TinyVector() : Self(getFirstEl()) {}
+  TinyVector(bool) : TinyVector() { nop(four()); }
+  int four() const { return 4; }
+  TinyVector *getFirstEl() { return this; }
+  char *begin() { return nullptr; }
+  char *end() { return begin() + four(); }
+  void clear() { nop(begin()), nop(end()); }
+
+  void nop(void *) {}
+  void nop(int) {}
+};
+} // end namespace llvm_namespace
+using llvm_namespace::TinyVector;
+#endif // function_address_shared_h
Index: lldb/test/Shell/Expr/Inputs/function-address-main.cpp
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-main.cpp
@@ -0,0 +1,4 @@
+#include "function-address-shared.h"
+int main() {
+TinyVector argv(true);
+}
Index: lldb/test/Shell/Expr/Inputs/function-address-lib.cpp
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-lib.cpp
@@ -0,0 +1,4 @@
+#include "function-address-shared.h"
+void (*ErrorHandler)();
+void LLVMErrorHandler() { TinyVector().clear(); }
+void SetErrorHandler() { ErrorHandler = LLVMErrorHandler; }
Index: lldb/source/Expression/IRExecutionUnit.cpp
===
--- lldb/source/Expression/IRExecutionUnit.cpp
+++ lldb/source/Expression/IRExecutionUnit.cpp
@@ -830,6 +830,9 @@
 
 if (load_address != LLDB_INVALID_ADDRESS) {
   if (is_external) {
+// Keep looking for a function entry with a symbol.
+if (candidate_sc.function && !candidate_sc.symbol)
+continue;
 return true;
   } else if (best_internal_load_address == LLDB_INVALID_ADDRESS) {
 best_internal_load_address = load_address;
@@ -844,8 +847,8 @@
 load_address = 0;
 return true;
   }
-  
-  return false;
+
+  return load_address != LLDB_INVALID_ADDRESS;
 };
 
 if (sc.module_sp) {


Index: lldb/test/Shell/Expr/TestFunctionAddress.lldb
===
--- /dev/null
+++ lldb/test/Shell/Expr/TestFunctionAddress.lldb
@@ -0,0 +1,9 @@
+# RUN: %clangxx_host %p/Inputs/function-address-main.cpp %p/Inputs/function-address-lib.cpp -g -fuse-ld=lld -o %t
+# RUN: %lldb %t -s %s 2>&1 | FileCheck %s
+b main
+run
+next
+expr argv.four()
+# CHECK: expr argv.four()
+# CHECK-NEXT: (int) $0 = 4
+# CHECK-NOT: SIGSEGV
Index: lldb/test/Shell/Expr/Inputs/function-address-shared.h
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-shared.h
@@ -0,0 +1,23 @@
+#ifndef function_address_shared_h
+#define function_address_shared_h
+namespace llvm_namespace {
+struct TinyVectorBase {
+  int SomeInlineInitializedMember = 0;
+};
+struct TinyVector : TinyVectorBase {
+  TinyVector *Self;
+
+  TinyVector() : Self(getFirstEl()) {}
+  TinyVector(bool) : TinyVector() { nop(four()); }
+  int four() const { return 4; }
+  TinyVector *getFirstEl() { return this; }
+  char *begin() { return nullptr; }
+  char *end() { return begin() + four(); }
+  void clear() { nop(begin()), nop(end()); }
+
+  void nop(void *) {}
+  void nop(int) {}
+};
+} // end namespace llvm_namespace
+using llvm_namespace::TinyVector;
+#endif // function_address_shared_h
Index: lldb/test/Shell/Expr/Inputs/function-address-main.cpp
===
--- /dev/null
+++ 

[Lldb-commits] [PATCH] D71487: [LLDB] Fix address computation for member function linked with lld

2019-12-13 Thread Johannes Altmanninger via Phabricator via lldb-commits
johannes created this revision.
johannes added reviewers: spyffe, clayborg, jasonmolenda.
Herald added a subscriber: aprantl.
Herald added a project: LLDB.
johannes updated this revision to Diff 233856.
johannes edited the summary of this revision.
johannes added a comment.

typo


Fixes PR41237 - SIGSEGV on call expression evaluation when debugging clang

The address computation in lldb fails only on executables linked with
lld as opposed to ld, and only with very specific inputs. I haven't
found out why it does not trigger more often.

In the object file produced by the added test, the function four() is
defined in two different DW_TAG_subprogram entries of DWARF debug info:
once with a DW_AT_object_pointer, and once without.  For computing
function addresses, lldb would previously use the whatever is the first
of those entries.  Presumably because of the missing DW_AT_object_pointer
entry, the function has no associated symbol, so lldb failed to compute
the function address.  This patch modifies the address lookup to prefer
function entries with symbols to fix that.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D71487

Files:
  lldb/source/Expression/IRExecutionUnit.cpp
  lldb/test/Shell/Expr/Inputs/function-address-lib.cpp
  lldb/test/Shell/Expr/Inputs/function-address-main.cpp
  lldb/test/Shell/Expr/Inputs/function-address-shared.h
  lldb/test/Shell/Expr/TestFunctionAddress.lldb


Index: lldb/test/Shell/Expr/TestFunctionAddress.lldb
===
--- /dev/null
+++ lldb/test/Shell/Expr/TestFunctionAddress.lldb
@@ -0,0 +1,9 @@
+# RUN: %clangxx_host %p/Inputs/function-address-main.cpp 
%p/Inputs/function-address-lib.cpp -g -fuse-ld=lld -o %t
+# RUN: %lldb %t -s %s 2>&1 | FileCheck %s
+b main
+run
+next
+expr argv.four()
+# CHECK: expr argv.four()
+# CHECK-NEXT: (int) $0 = 4
+# CHECK-NOT: SIGSEGV
Index: lldb/test/Shell/Expr/Inputs/function-address-shared.h
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-shared.h
@@ -0,0 +1,23 @@
+#ifndef function_address_shared_h
+#define function_address_shared_h
+namespace llvm_namespace {
+struct TinyVectorBase {
+  int SomeInlineInitializedMember = 0;
+};
+struct TinyVector : TinyVectorBase {
+  TinyVector *Self;
+
+  TinyVector() : Self(getFirstEl()) {}
+  TinyVector(bool) : TinyVector() { nop(four()); }
+  int four() const { return 4; }
+  TinyVector *getFirstEl() { return this; }
+  char *begin() { return nullptr; }
+  char *end() { return begin() + four(); }
+  void clear() { nop(begin()), nop(end()); }
+
+  void nop(void *) {}
+  void nop(int) {}
+};
+} // end namespace llvm_namespace
+using llvm_namespace::TinyVector;
+#endif // function_address_shared_h
Index: lldb/test/Shell/Expr/Inputs/function-address-main.cpp
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-main.cpp
@@ -0,0 +1,4 @@
+#include "function-address-shared.h"
+int main() {
+TinyVector argv(true);
+}
Index: lldb/test/Shell/Expr/Inputs/function-address-lib.cpp
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-lib.cpp
@@ -0,0 +1,4 @@
+#include "function-address-shared.h"
+void (*ErrorHandler)();
+void LLVMErrorHandler() { TinyVector().clear(); }
+void SetErrorHandler() { ErrorHandler = LLVMErrorHandler; }
Index: lldb/source/Expression/IRExecutionUnit.cpp
===
--- lldb/source/Expression/IRExecutionUnit.cpp
+++ lldb/source/Expression/IRExecutionUnit.cpp
@@ -830,6 +830,9 @@
 
 if (load_address != LLDB_INVALID_ADDRESS) {
   if (is_external) {
+// Keep looking for a function entry with a symbol.
+if (candidate_sc.function && !candidate_sc.symbol)
+continue;
 return true;
   } else if (best_internal_load_address == LLDB_INVALID_ADDRESS) {
 best_internal_load_address = load_address;
@@ -844,8 +847,8 @@
 load_address = 0;
 return true;
   }
-  
-  return false;
+
+  return load_address != LLDB_INVALID_ADDRESS;
 };
 
 if (sc.module_sp) {


Index: lldb/test/Shell/Expr/TestFunctionAddress.lldb
===
--- /dev/null
+++ lldb/test/Shell/Expr/TestFunctionAddress.lldb
@@ -0,0 +1,9 @@
+# RUN: %clangxx_host %p/Inputs/function-address-main.cpp %p/Inputs/function-address-lib.cpp -g -fuse-ld=lld -o %t
+# RUN: %lldb %t -s %s 2>&1 | FileCheck %s
+b main
+run
+next
+expr argv.four()
+# CHECK: expr argv.four()
+# CHECK-NEXT: (int) $0 = 4
+# CHECK-NOT: SIGSEGV
Index: lldb/test/Shell/Expr/Inputs/function-address-shared.h
===
--- /dev/null
+++ lldb/test/Shell/Expr/Inputs/function-address-shared.h
@@ 

[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Michał Górny via Phabricator via lldb-commits
mgorny added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:43
+  else()
+set(default_enable_python ON)
+  endif()

JDevlieghere wrote:
> mgorny wrote:
> > I know that the same thing is done above but… what's the point of setting 
> > it to `ON` again?
> It's just setting the default to the old value. If the value was set, we 
> should honor it, both if it was `OFF` or `ON`.
But it's already set to `ON` a few lines above.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere marked an inline comment as done.
JDevlieghere added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:43
+  else()
+set(default_enable_python ON)
+  endif()

mgorny wrote:
> I know that the same thing is done above but… what's the point of setting it 
> to `ON` again?
It's just setting the default to the old value. If the value was set, we should 
honor it, both if it was `OFF` or `ON`.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71311: LanguageRuntime: Simplify NSException::GetSummary() output

2019-12-13 Thread Med Ismail Bennani via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG2c91d5ba8315: LanguageRuntime: Simplify 
NSException::GetSummary() output (authored by mib).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71311

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjNSException.py
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
  lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
  lldb/source/Plugins/Language/ObjC/NSException.cpp

Index: lldb/source/Plugins/Language/ObjC/NSException.cpp
===
--- lldb/source/Plugins/Language/ObjC/NSException.cpp
+++ lldb/source/Plugins/Language/ObjC/NSException.cpp
@@ -98,21 +98,19 @@
 
 bool lldb_private::formatters::NSException_SummaryProvider(
 ValueObject , Stream , const TypeSummaryOptions ) {
-  lldb::ValueObjectSP name_sp;
   lldb::ValueObjectSP reason_sp;
-  if (!ExtractFields(valobj, _sp, _sp, nullptr, nullptr))
+  if (!ExtractFields(valobj, nullptr, _sp, nullptr, nullptr))
 return false;
 
-  if (!name_sp || !reason_sp)
+  if (!reason_sp) {
+stream.Printf("No reason");
 return false;
+  }
 
-  StreamString name_str_summary;
   StreamString reason_str_summary;
-  if (NSStringSummaryProvider(*name_sp, name_str_summary, options) &&
-  NSStringSummaryProvider(*reason_sp, reason_str_summary, options) &&
-  !name_str_summary.Empty() && !reason_str_summary.Empty()) {
-stream.Printf("name: %s - reason: %s", name_str_summary.GetData(),
-  reason_str_summary.GetData());
+  if (NSStringSummaryProvider(*reason_sp, reason_str_summary, options) &&
+  !reason_str_summary.Empty()) {
+stream.Printf("%s", reason_str_summary.GetData());
 return true;
   } else
 return false;
Index: lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
===
--- lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
+++ lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
@@ -30,7 +30,7 @@
 
 self.expect('thread exception', substrs=[
 '(NSException *) exception = ',
-'name: "ThrownException" - reason: "SomeReason"',
+'"SomeReason"',
 ])
 
 target = self.dbg.GetSelectedTarget()
@@ -62,7 +62,7 @@
 'frame variable e1',
 substrs=[
 '(NSException *) e1 = ',
-'name: "ExceptionName" - reason: "SomeReason"'
+'"SomeReason"'
 ])
 
 self.expect(
@@ -78,7 +78,7 @@
 e1 = frame.FindVariable("e1")
 self.assertTrue(e1)
 self.assertEqual(e1.type.name, "NSException *")
-self.assertEqual(e1.GetSummary(), 'name: "ExceptionName" - reason: "SomeReason"')
+self.assertEqual(e1.GetSummary(), '"SomeReason"')
 self.assertEqual(e1.GetChildMemberWithName("name").description, "ExceptionName")
 self.assertEqual(e1.GetChildMemberWithName("reason").description, "SomeReason")
 userInfo = e1.GetChildMemberWithName("userInfo").dynamic
@@ -91,7 +91,7 @@
 'frame variable e2',
 substrs=[
 '(NSException *) e2 = ',
-'name: "ThrownException" - reason: "SomeReason"'
+'"SomeReason"'
 ])
 
 self.expect(
@@ -107,7 +107,7 @@
 e2 = frame.FindVariable("e2")
 self.assertTrue(e2)
 self.assertEqual(e2.type.name, "NSException *")
-self.assertEqual(e2.GetSummary(), 'name: "ThrownException" - reason: "SomeReason"')
+self.assertEqual(e2.GetSummary(), '"SomeReason"')
 self.assertEqual(e2.GetChildMemberWithName("name").description, "ThrownException")
 self.assertEqual(e2.GetChildMemberWithName("reason").description, "SomeReason")
 userInfo = e2.GetChildMemberWithName("userInfo").dynamic
@@ -140,7 +140,7 @@
 
 self.expect('thread exception', substrs=[
 '(NSException *) exception = ',
-'name: "ThrownException" - reason: "SomeReason"',
+'"SomeReason"',
 'libobjc.A.dylib`objc_exception_throw',
 'a.out`foo', 'at main.mm:24',
 'a.out`rethrow', 'at main.mm:35',
Index: lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
===
--- lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -492,10 +492,10 @@
 	nsurl0 = [bundle 

[Lldb-commits] [lldb] 2c91d5b - LanguageRuntime: Simplify NSException::GetSummary() output

2019-12-13 Thread Med Ismail Bennani via lldb-commits

Author: Med Ismail Bennani
Date: 2019-12-13T12:33:31-08:00
New Revision: 2c91d5ba83156900944c82bb8feb1e340adb8ae4

URL: 
https://github.com/llvm/llvm-project/commit/2c91d5ba83156900944c82bb8feb1e340adb8ae4
DIFF: 
https://github.com/llvm/llvm-project/commit/2c91d5ba83156900944c82bb8feb1e340adb8ae4.diff

LOG: LanguageRuntime: Simplify NSException::GetSummary() output

Summary:
Right now, NSException::GetSummary() has the following output:
"name: $exception_name - reason: $exception_reason"

It would be better to simplify the output by removing the name and only
showing the exception's reason. This way, annotations would look nicer in
the editor, and would be a shorter summary in the Variables Inspector.

Accessing the exception's name can still be done by expanding the
NSException object in the Variables Inspector.

rdar://54770115

Signed-off-by: Med Ismail Bennani 

Subscribers: lldb-commits

Tags: #lldb

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

Signed-off-by: Med Ismail Bennani 

Added: 


Modified: 

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjNSException.py

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m

lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
lldb/source/Plugins/Language/ObjC/NSException.cpp

Removed: 




diff  --git 
a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjNSException.py
 
b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjNSException.py
index d304dcc289ca..6265c05c5b70 100644
--- 
a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjNSException.py
+++ 
b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/TestDataFormatterObjNSException.py
@@ -24,11 +24,11 @@ def nsexception_data_formatter_commands(self):
 'frame variable except0 except1 except2 except3',
 substrs=[
 '(NSException *) except0 = ',
-'name: @"TheGuyWhoHasNoName" - reason: @"cuz it\'s funny"',
+'@"First"',
 '(NSException *) except1 = ',
-'name: @"TheGuyWhoHasNoName~1" - reason: @"cuz it\'s funny"',
+'@"Second"',
 '(NSException *) except2 = ',
-'name: @"TheGuyWhoHasNoName`2" - reason: @"cuz it\'s funny"',
+' @"Third"',
 '(NSException *) except3 = ',
-'name: @"TheGuyWhoHasNoName/3" - reason: @"cuz it\'s funny"'
+' @"Fourth"'
 ])

diff  --git 
a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
 
b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
index a370a48739c8..f0dc2055976a 100644
--- 
a/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
+++ 
b/lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-objc/main.m
@@ -492,10 +492,10 @@ int main (int argc, const char * argv[])
nsurl0 = [bundle bundleURL];
}
 
-   NSException* except0 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName" reason:@"cuz it's funny" userInfo:nil];
-   NSException* except1 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName~1" reason:@"cuz it's funny" userInfo:nil];
-   NSException* except2 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName`2" reason:@"cuz it's funny" userInfo:nil];
-   NSException* except3 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName/3" reason:@"cuz it's funny" userInfo:nil];
+   NSException* except0 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName" reason:@"First" userInfo:nil];
+   NSException* except1 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName~1" reason:@"Second" userInfo:nil];
+   NSException* except2 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName`2" reason:@"Third" userInfo:nil];
+   NSException* except3 = [[NSException alloc] 
initWithName:@"TheGuyWhoHasNoName/3" reason:@"Fourth" userInfo:nil];
 
NSURL *nsurl = [[NSURL alloc] initWithString:@"http://www.foo.bar;];
NSURL *nsurl2 = [NSURL URLWithString:@"page.html" 
relativeToURL:nsurl];

diff  --git 
a/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
 
b/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
index dbf6287bb20a..ce9ee8e027ff 100644
--- 
a/lldb/packages/Python/lldbsuite/test/lang/objc/exceptions/TestObjCExceptions.py
+++ 

[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Michał Górny via Phabricator via lldb-commits
mgorny added inline comments.



Comment at: lldb/cmake/modules/LLDBConfig.cmake:43
+  else()
+set(default_enable_python ON)
+  endif()

I know that the same thing is done above but… what's the point of setting it to 
`ON` again?


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71482



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


[Lldb-commits] [PATCH] D71311: LanguageRuntime: Simplify NSException::GetSummary() output

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

LGTM!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71311



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


[Lldb-commits] [PATCH] D71311: LanguageRuntime: Simplify NSException::GetSummary() output

2019-12-13 Thread Med Ismail Bennani via Phabricator via lldb-commits
mib added a comment.

@davide I ran the Swift test suite both with and without my patch and got the 
same results :)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71311



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


[Lldb-commits] [PATCH] D71482: [lldb/CMake] Rename LLDB_DISABLE_PYTHON to LLDB_ENABLE_PYTHON

2019-12-13 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: labath, teemperor.
Herald added subscribers: abidh, mgorny.
Herald added a project: LLDB.

This matches the naming scheme used by LLVM and all the other optional 
dependencies in LLDB.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D71482

Files:
  lldb/CMakeLists.txt
  lldb/cmake/modules/LLDBConfig.cmake
  lldb/docs/CMakeLists.txt
  lldb/docs/resources/build.rst
  lldb/include/lldb/Host/Config.h.cmake
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/source/API/CMakeLists.txt
  lldb/source/API/SBHostOS.cpp
  lldb/source/API/SystemInitializerFull.cpp
  lldb/source/Commands/CommandObjectFrame.cpp
  lldb/source/Commands/CommandObjectType.cpp
  lldb/source/Core/ValueObject.cpp
  lldb/source/Interpreter/CommandObjectScript.cpp
  lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.cpp
  lldb/source/Plugins/OperatingSystem/Python/OperatingSystemPython.h
  lldb/source/Plugins/ScriptInterpreter/CMakeLists.txt
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.cpp
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPython.h
  lldb/source/Plugins/ScriptInterpreter/Python/ScriptInterpreterPythonImpl.h
  lldb/source/Plugins/ScriptInterpreter/Python/lldb-python.h
  lldb/test/API/lit.site.cfg.py.in
  lldb/test/API/lldbtest.py
  lldb/test/CMakeLists.txt
  lldb/test/Shell/lit.cfg.py
  lldb/test/Shell/lit.site.cfg.py.in
  lldb/tools/intel-features/CMakeLists.txt
  lldb/unittests/ScriptInterpreter/CMakeLists.txt

Index: lldb/unittests/ScriptInterpreter/CMakeLists.txt
===
--- lldb/unittests/ScriptInterpreter/CMakeLists.txt
+++ lldb/unittests/ScriptInterpreter/CMakeLists.txt
@@ -1,3 +1,3 @@
-if (NOT LLDB_DISABLE_PYTHON)
+if (LLDB_ENABLE_PYTHON)
   add_subdirectory(Python)
 endif()
Index: lldb/tools/intel-features/CMakeLists.txt
===
--- lldb/tools/intel-features/CMakeLists.txt
+++ lldb/tools/intel-features/CMakeLists.txt
@@ -23,7 +23,7 @@
 endif()
 
 # Add python wrapper if python not disabled
-if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
   set(LLDB_INTEL_FEATURES_PYTHON_WRAP
  ${LLDB_BINARY_DIR}/tools/intel-features/scripts/IntelFeaturesPythonWrap.cpp)
   set_source_files_properties(${LLDB_INTEL_FEATURES_PYTHON_WRAP}
@@ -59,7 +59,7 @@
   )
 
 # Add link dependencies for python wrapper
-if (NOT LLDB_DISABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
+if (LLDB_ENABLE_PYTHON AND LLDB_BUILD_INTEL_PT)
   add_dependencies(lldbIntelFeatures intel-features-swig_wrapper)
 endif()
 
Index: lldb/test/Shell/lit.site.cfg.py.in
===
--- lldb/test/Shell/lit.site.cfg.py.in
+++ lldb/test/Shell/lit.site.cfg.py.in
@@ -18,7 +18,7 @@
 config.lldb_enable_lzma = @LLDB_ENABLE_LZMA@
 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.lldb_enable_python = @LLDB_ENABLE_PYTHON@
 config.lldb_build_directory = "@LLDB_TEST_BUILD_DIRECTORY@"
 # The shell tests use their own module caches.
 config.lldb_module_cache = os.path.join("@LLDB_TEST_MODULE_CACHE_LLDB@", "lldb-shell")
Index: lldb/test/Shell/lit.cfg.py
===
--- lldb/test/Shell/lit.cfg.py
+++ lldb/test/Shell/lit.cfg.py
@@ -100,7 +100,7 @@
 else:
 lit_config.warning("lit-cpuid failed: %s" % err)
 
-if not config.lldb_disable_python:
+if config.lldb_enable_python:
 config.available_features.add('python')
 
 if config.lldb_enable_lzma:
Index: lldb/test/CMakeLists.txt
===
--- lldb/test/CMakeLists.txt
+++ lldb/test/CMakeLists.txt
@@ -143,7 +143,7 @@
 
 # These values are not canonicalized within LLVM.
 llvm_canonicalize_cmake_booleans(
-  LLDB_DISABLE_PYTHON
+  LLDB_ENABLE_PYTHON
   LLVM_ENABLE_ZLIB
   LLVM_ENABLE_SHARED_LIBS
   LLDB_IS_64_BITS)
Index: lldb/test/API/lldbtest.py
===
--- lldb/test/API/lldbtest.py
+++ lldb/test/API/lldbtest.py
@@ -55,7 +55,7 @@
 if litConfig.noExecute:
 return lit.Test.PASS, ''
 
-if test.config.lldb_disable_python:
+if not test.config.lldb_enable_python:
 return (lit.Test.UNSUPPORTED, 'Python module disabled')
 
 if test.config.unsupported:
Index: lldb/test/API/lit.site.cfg.py.in
===
--- lldb/test/API/lit.site.cfg.py.in
+++ lldb/test/API/lit.site.cfg.py.in
@@ -20,7 +20,7 @@
 config.python_executable = "@PYTHON_EXECUTABLE@"
 config.dotest_path = 

[Lldb-commits] [lldb] 3011d55 - [lldb/Host] Use cmakedefine01 for LLDB_ENABLE_POSIX

2019-12-13 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2019-12-13T10:00:59-08:00
New Revision: 3011d55f725e280fe29a49bd70a2e0157587b17a

URL: 
https://github.com/llvm/llvm-project/commit/3011d55f725e280fe29a49bd70a2e0157587b17a
DIFF: 
https://github.com/llvm/llvm-project/commit/3011d55f725e280fe29a49bd70a2e0157587b17a.diff

LOG: [lldb/Host] Use cmakedefine01 for LLDB_ENABLE_POSIX

Rename LLDB_DISABLE_POSIX to LLDB_ENABLE_POSIX and use cmakedefine01 for
consistency.

Added: 


Modified: 
lldb/cmake/modules/LLDBGenerateConfig.cmake
lldb/include/lldb/Host/Config.h.cmake
lldb/source/Host/common/PseudoTerminal.cpp
lldb/source/Host/common/Socket.cpp
lldb/source/Host/common/TCPSocket.cpp
lldb/source/Host/common/Terminal.cpp
lldb/source/Host/common/UDPSocket.cpp
lldb/source/Host/posix/ConnectionFileDescriptorPosix.cpp
lldb/source/Plugins/Platform/FreeBSD/PlatformFreeBSD.cpp
lldb/source/Plugins/Platform/Linux/PlatformLinux.cpp
lldb/source/Plugins/Platform/NetBSD/PlatformNetBSD.cpp
lldb/source/Plugins/Platform/OpenBSD/PlatformOpenBSD.cpp
lldb/source/Plugins/Process/Utility/InferiorCallPOSIX.cpp

lldb/source/Plugins/Process/gdb-remote/GDBRemoteCommunicationServerCommon.cpp
lldb/source/Plugins/Process/gdb-remote/ProcessGDBRemote.cpp
lldb/tools/lldb-server/lldb-gdbserver.cpp
lldb/unittests/Host/SocketTest.cpp
lldb/unittests/Host/SocketTestUtilities.cpp
lldb/unittests/Host/SocketTestUtilities.h

Removed: 




diff  --git a/lldb/cmake/modules/LLDBGenerateConfig.cmake 
b/lldb/cmake/modules/LLDBGenerateConfig.cmake
index b44f4afdfa69..bee17b509247 100644
--- a/lldb/cmake/modules/LLDBGenerateConfig.cmake
+++ b/lldb/cmake/modules/LLDBGenerateConfig.cmake
@@ -24,9 +24,7 @@ check_library_exists(compression compression_encode_buffer "" 
HAVE_LIBCOMPRESSIO
 # so that the check isn't duplicated, but we translate them into the LLDB names
 # so that I don't have to change all the uses at the moment.
 set(LLDB_ENABLE_TERMIOS ${HAVE_TERMIOS_H})
-if(NOT UNIX)
-  set(LLDB_DISABLE_POSIX 1)
-endif()
+set(LLDB_ENABLE_POSIX NOT UNIX)
 
 if(NOT LLDB_CONFIG_HEADER_INPUT)
  set(LLDB_CONFIG_HEADER_INPUT ${LLDB_INCLUDE_ROOT}/lldb/Host/Config.h.cmake)

diff  --git a/lldb/include/lldb/Host/Config.h.cmake 
b/lldb/include/lldb/Host/Config.h.cmake
index 057bc085b41e..fa95631d1979 100644
--- a/lldb/include/lldb/Host/Config.h.cmake
+++ b/lldb/include/lldb/Host/Config.h.cmake
@@ -13,7 +13,6 @@
 
 #cmakedefine01 LLDB_HAVE_EL_RFUNC_T
 
-#cmakedefine LLDB_DISABLE_POSIX
 
 #cmakedefine01 HAVE_SYS_TYPES_H
 
@@ -31,6 +30,8 @@
 #cmakedefine HAVE_LIBCOMPRESSION
 #endif
 
+#cmakedefine01 LLDB_ENABLE_POSIX
+
 #cmakedefine01 LLDB_ENABLE_TERMIOS
 
 #cmakedefine01 LLDB_ENABLE_LZMA

diff  --git a/lldb/source/Host/common/PseudoTerminal.cpp 
b/lldb/source/Host/common/PseudoTerminal.cpp
index 85e54f4d3d6a..85828283e210 100644
--- a/lldb/source/Host/common/PseudoTerminal.cpp
+++ b/lldb/source/Host/common/PseudoTerminal.cpp
@@ -79,7 +79,7 @@ bool PseudoTerminal::OpenFirstAvailableMaster(int oflag, char 
*error_str,
   if (error_str)
 error_str[0] = '\0';
 
-#if !defined(LLDB_DISABLE_POSIX)
+#if LLDB_ENABLE_POSIX
   // Open the master side of a pseudo terminal
   m_master_fd = ::posix_openpt(oflag);
   if (m_master_fd < 0) {
@@ -193,7 +193,7 @@ lldb::pid_t PseudoTerminal::Fork(char *error_str, size_t 
error_len) {
   if (error_str)
 error_str[0] = '\0';
   pid_t pid = LLDB_INVALID_PROCESS_ID;
-#if !defined(LLDB_DISABLE_POSIX)
+#if LLDB_ENABLE_POSIX
   int flags = O_RDWR;
   flags |= O_CLOEXEC;
   if (OpenFirstAvailableMaster(flags, error_str, error_len)) {

diff  --git a/lldb/source/Host/common/Socket.cpp 
b/lldb/source/Host/common/Socket.cpp
index 6358ab8a8e77..7fba1daff75f 100644
--- a/lldb/source/Host/common/Socket.cpp
+++ b/lldb/source/Host/common/Socket.cpp
@@ -22,7 +22,7 @@
 #include "llvm/Support/Error.h"
 #include "llvm/Support/WindowsError.h"
 
-#ifndef LLDB_DISABLE_POSIX
+#if LLDB_ENABLE_POSIX
 #include "lldb/Host/posix/DomainSocket.h"
 
 #include 
@@ -122,7 +122,7 @@ std::unique_ptr Socket::Create(const SocketProtocol 
protocol,
 std::make_unique(true, child_processes_inherit);
 break;
   case ProtocolUnixDomain:
-#ifndef LLDB_DISABLE_POSIX
+#if LLDB_ENABLE_POSIX
 socket_up =
 std::make_unique(true, child_processes_inherit);
 #else

diff  --git a/lldb/source/Host/common/TCPSocket.cpp 
b/lldb/source/Host/common/TCPSocket.cpp
index 8be0b2e2fc02..b716935db6e6 100644
--- a/lldb/source/Host/common/TCPSocket.cpp
+++ b/lldb/source/Host/common/TCPSocket.cpp
@@ -20,7 +20,7 @@
 #include "llvm/Support/Errno.h"
 #include "llvm/Support/raw_ostream.h"
 
-#ifndef LLDB_DISABLE_POSIX
+#if LLDB_ENABLE_POSIX
 #include 
 #include 
 #include 
@@ -273,7 +273,7 @@ Status TCPSocket::Accept(Socket *_socket) {
   // Loop until we are happy with our connection
   while (!accept_connection) {
 accept_loop.Run();

[Lldb-commits] [lldb] 1ef7c42 - [lldb/Test] C++ test should use CXXFLAGS_EXTRAS

2019-12-13 Thread Jonas Devlieghere via lldb-commits

Author: Jonas Devlieghere
Date: 2019-12-13T10:00:59-08:00
New Revision: 1ef7c4269b453a98cada3ee3d29644e994fbc421

URL: 
https://github.com/llvm/llvm-project/commit/1ef7c4269b453a98cada3ee3d29644e994fbc421
DIFF: 
https://github.com/llvm/llvm-project/commit/1ef7c4269b453a98cada3ee3d29644e994fbc421.diff

LOG: [lldb/Test] C++ test should use CXXFLAGS_EXTRAS

Thanks Ted Woodward for noticing this.

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile 
b/lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
index c69bf503a34a..e7c9938b5a85 100644
--- a/lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
+++ b/lldb/packages/Python/lldbsuite/test/lang/cpp/char8_t/Makefile
@@ -1,4 +1,4 @@
 CXX_SOURCES := main.cpp
-CFLAGS_EXTRAS := -std=c++2a -fchar8_t
+CXXFLAGS_EXTRAS := -std=c++2a -fchar8_t
 
 include Makefile.rules



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


[Lldb-commits] [PATCH] D71372: [lldb] Add additional validation on return address in 'thread step-out'

2019-12-13 Thread Mark Mossberg via Phabricator via lldb-commits
mossberg marked an inline comment as done.
mossberg added inline comments.



Comment at: lldb/source/Target/ThreadPlanStepOut.cpp:136-137
+  m_return_addr);
+  LLDB_LOGF(log, "ThreadPlanStepOut(%p): %s", static_cast(this),
+m_constructor_errors.GetData());
+  return;

labath wrote:
> I'd probably remove the log statements now that we have the real error output.
I included both based on @jingham's feedback here: 
https://reviews.llvm.org/D71372#1782270


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71372



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


[Lldb-commits] [PATCH] D70840: [LLDB] [DWARF] Strip out the thumb bit from addresses on ARM

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

I am strongly opposed to ArchSpec owing an Architecture object. The latter is 
far more complicated -- it reads bytes from target memory and disassembles them 
-- whereas ArchSpec just returns a bunch of constants. If anything, it should 
be the other way around. That way the code which just fiddles with triples does 
not need to depend on the whole world.

Having an Architecture instance in the Module object (to ensure it's 
independent of the target) seems /ok/, though I am not really convinced that it 
is needed, as the &~1 logic seems like a good candidate for ArchSpec (which 
already knows a lot about arm vs. thumb etc.


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

https://reviews.llvm.org/D70840



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


[Lldb-commits] [PATCH] D71454: [lldb][NFC] Remove all `setUp` overrides that only call the parent implementation

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG9bace26a690a: [lldb][NFC] Remove all `setUp` overrides that 
only call the parent… (authored by teemperor).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71454

Files:
  lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py
  lldb/packages/Python/lldbsuite/test/commands/apropos/basic/TestApropos.py
  
lldb/packages/Python/lldbsuite/test/commands/command/script/import/TestImport.py
  
lldb/packages/Python/lldbsuite/test/commands/command/script/import/rdar-12586188/TestRdar12586188.py
  
lldb/packages/Python/lldbsuite/test/commands/disassemble/basic/TestFrameDisassemble.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/calculator_mode/TestCalculatorMode.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/entry-bp/TestExprEntryBP.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/persistent_ptr_update/TestPersistentPtrUpdate.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/weak_symbols/TestWeakSymbols.py
  lldb/packages/Python/lldbsuite/test/commands/frame/diagnose/array/TestArray.py
  
lldb/packages/Python/lldbsuite/test/commands/frame/language/TestGuessLanguage.py
  lldb/packages/Python/lldbsuite/test/commands/frame/var/TestFrameVar.py
  
lldb/packages/Python/lldbsuite/test/commands/register/register/intel_xtended_registers/TestMPXRegisters.py
  
lldb/packages/Python/lldbsuite/test/commands/register/register/intel_xtended_registers/mpx_offset_intersection/TestMPXOffsetIntersection.py
  
lldb/packages/Python/lldbsuite/test/commands/target/stop-hooks/TestStopHooks.py
  lldb/packages/Python/lldbsuite/test/commands/version/TestVersion.py
  
lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/TestDataFormatterCaching.py
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
  
lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py
  lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
  
lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
  
lldb/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
  
lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
  lldb/packages/Python/lldbsuite/test/functionalities/var_path/TestVarPath.py
  
lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
  lldb/packages/Python/lldbsuite/test/lang/c/local_types/TestUseClosestType.py
  
lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py
  lldb/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-app-update/TestClangModulesAppUpdate.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-hash-mismatch/TestClangModulesHashMismatch.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-update/TestClangModulesUpdate.py
  
lldb/packages/Python/lldbsuite/test/lang/objcxx/cxx-bridged-po/TestObjCXXBridgedPO.py
  
lldb/packages/Python/lldbsuite/test/lang/objcxx/hide-runtime-values/TestObjCXXHideRuntimeValues.py
  

[Lldb-commits] [lldb] 9bace26 - [lldb][NFC] Remove all `setUp` overrides that only call the parent implementation

2019-12-13 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2019-12-13T12:34:49+01:00
New Revision: 9bace26a690a778ec0f09a9aae9537dfbdb6f42f

URL: 
https://github.com/llvm/llvm-project/commit/9bace26a690a778ec0f09a9aae9537dfbdb6f42f
DIFF: 
https://github.com/llvm/llvm-project/commit/9bace26a690a778ec0f09a9aae9537dfbdb6f42f.diff

LOG: [lldb][NFC] Remove all `setUp` overrides that only call the parent 
implementation

Summary:
A lot of our tests copied the setUp code from our TestSampleTest.py:

```
def setUp(self):
# Call super's setUp().
TestBase.setUp(self)
```

This code does nothing unless we actually do any setUp work in there, so let's 
remove all these method definitions.

Reviewers: labath, JDevlieghere

Reviewed By: labath

Subscribers: lldb-commits

Tags: #lldb

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

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py
lldb/packages/Python/lldbsuite/test/commands/apropos/basic/TestApropos.py

lldb/packages/Python/lldbsuite/test/commands/command/script/import/TestImport.py

lldb/packages/Python/lldbsuite/test/commands/command/script/import/rdar-12586188/TestRdar12586188.py

lldb/packages/Python/lldbsuite/test/commands/disassemble/basic/TestFrameDisassemble.py

lldb/packages/Python/lldbsuite/test/commands/expression/calculator_mode/TestCalculatorMode.py

lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py

lldb/packages/Python/lldbsuite/test/commands/expression/entry-bp/TestExprEntryBP.py

lldb/packages/Python/lldbsuite/test/commands/expression/persistent_ptr_update/TestPersistentPtrUpdate.py

lldb/packages/Python/lldbsuite/test/commands/expression/weak_symbols/TestWeakSymbols.py

lldb/packages/Python/lldbsuite/test/commands/frame/diagnose/array/TestArray.py

lldb/packages/Python/lldbsuite/test/commands/frame/language/TestGuessLanguage.py
lldb/packages/Python/lldbsuite/test/commands/frame/var/TestFrameVar.py

lldb/packages/Python/lldbsuite/test/commands/register/register/intel_xtended_registers/TestMPXRegisters.py

lldb/packages/Python/lldbsuite/test/commands/register/register/intel_xtended_registers/mpx_offset_intersection/TestMPXOffsetIntersection.py

lldb/packages/Python/lldbsuite/test/commands/target/stop-hooks/TestStopHooks.py
lldb/packages/Python/lldbsuite/test/commands/version/TestVersion.py

lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py

lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py

lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py

lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py

lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py

lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/TestDataFormatterCaching.py

lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py

lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py
lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py

lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py

lldb/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py

lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py

lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py

lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py

lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py

lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py

lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py

lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
lldb/packages/Python/lldbsuite/test/functionalities/var_path/TestVarPath.py

lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
lldb/packages/Python/lldbsuite/test/lang/c/local_types/TestUseClosestType.py

lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py
lldb/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py

lldb/packages/Python/lldbsuite/test/lang/objc/modules-app-update/TestClangModulesAppUpdate.py


[Lldb-commits] [lldb] 3ca771b - [lldb][NFC] Remove unused includes in Utility's source files

2019-12-13 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2019-12-13T12:33:47+01:00
New Revision: 3ca771ba594fbd40da7ef842c04b5842e7b2a83c

URL: 
https://github.com/llvm/llvm-project/commit/3ca771ba594fbd40da7ef842c04b5842e7b2a83c
DIFF: 
https://github.com/llvm/llvm-project/commit/3ca771ba594fbd40da7ef842c04b5842e7b2a83c.diff

LOG: [lldb][NFC] Remove unused includes in Utility's source files

Added: 


Modified: 
lldb/source/Utility/ArchSpec.cpp
lldb/source/Utility/Broadcaster.cpp
lldb/source/Utility/ConstString.cpp
lldb/source/Utility/DataBufferLLVM.cpp
lldb/source/Utility/DataEncoder.cpp
lldb/source/Utility/StructuredData.cpp

Removed: 




diff  --git a/lldb/source/Utility/ArchSpec.cpp 
b/lldb/source/Utility/ArchSpec.cpp
index bbfa5cf61d01..b638a6138cfe 100644
--- a/lldb/source/Utility/ArchSpec.cpp
+++ b/lldb/source/Utility/ArchSpec.cpp
@@ -9,17 +9,13 @@
 #include "lldb/Utility/ArchSpec.h"
 
 #include "lldb/Utility/Log.h"
-#include "lldb/Utility/NameMatches.h"
-#include "lldb/Utility/Stream.h"
 #include "lldb/Utility/StringList.h"
 #include "lldb/lldb-defines.h"
 #include "llvm/ADT/STLExtras.h"
-#include "llvm/ADT/Twine.h"
 #include "llvm/BinaryFormat/COFF.h"
 #include "llvm/BinaryFormat/ELF.h"
 #include "llvm/BinaryFormat/MachO.h"
 #include "llvm/Support/Compiler.h"
-#include "llvm/Support/Host.h"
 
 using namespace lldb;
 using namespace lldb_private;

diff  --git a/lldb/source/Utility/Broadcaster.cpp 
b/lldb/source/Utility/Broadcaster.cpp
index aeb72ce2685d..ee0c39f8fd42 100644
--- a/lldb/source/Utility/Broadcaster.cpp
+++ b/lldb/source/Utility/Broadcaster.cpp
@@ -17,7 +17,6 @@
 
 #include 
 #include 
-#include 
 #include 
 
 #include 

diff  --git a/lldb/source/Utility/ConstString.cpp 
b/lldb/source/Utility/ConstString.cpp
index 2516ecf6a989..e90bb929bb81 100644
--- a/lldb/source/Utility/ConstString.cpp
+++ b/lldb/source/Utility/ConstString.cpp
@@ -18,7 +18,6 @@
 #include "llvm/Support/RWMutex.h"
 #include "llvm/Support/Threading.h"
 
-#include 
 #include 
 #include 
 

diff  --git a/lldb/source/Utility/DataBufferLLVM.cpp 
b/lldb/source/Utility/DataBufferLLVM.cpp
index 4227e9b39960..c20e1b06f52e 100644
--- a/lldb/source/Utility/DataBufferLLVM.cpp
+++ b/lldb/source/Utility/DataBufferLLVM.cpp
@@ -8,12 +8,9 @@
 
 #include "lldb/Utility/DataBufferLLVM.h"
 
-#include "llvm/ADT/Twine.h"
-#include "llvm/Support/FileSystem.h"
 #include "llvm/Support/MemoryBuffer.h"
 
 #include 
-#include 
 
 using namespace lldb_private;
 

diff  --git a/lldb/source/Utility/DataEncoder.cpp 
b/lldb/source/Utility/DataEncoder.cpp
index 0b6456deec35..8a1036e26dce 100644
--- a/lldb/source/Utility/DataEncoder.cpp
+++ b/lldb/source/Utility/DataEncoder.cpp
@@ -13,9 +13,7 @@
 
 #include "llvm/Support/Endian.h"
 #include "llvm/Support/ErrorHandling.h"
-#include "llvm/Support/MathExtras.h"
 
-#include 
 #include 
 
 #include 

diff  --git a/lldb/source/Utility/StructuredData.cpp 
b/lldb/source/Utility/StructuredData.cpp
index 783a08082174..22477bdbe6c8 100644
--- a/lldb/source/Utility/StructuredData.cpp
+++ b/lldb/source/Utility/StructuredData.cpp
@@ -7,16 +7,12 @@
 
//===--===//
 
 #include "lldb/Utility/StructuredData.h"
-#include "lldb/Utility/DataBuffer.h"
 #include "lldb/Utility/FileSpec.h"
 #include "lldb/Utility/Status.h"
-#include "lldb/Utility/StreamString.h"
-#include "llvm/ADT/STLExtras.h"
 #include "llvm/Support/MemoryBuffer.h"
 #include 
 #include 
 #include 
-#include 
 
 using namespace lldb_private;
 using namespace llvm;



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


[Lldb-commits] [lldb] 4286aca - [lldb][NFC] Add reminder to TestSampleTest that setUp should be deleted if it not needed.

2019-12-13 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2019-12-13T12:10:05+01:00
New Revision: 4286aca5d5adb2fd07fb07d0dbbc94e2ff16270d

URL: 
https://github.com/llvm/llvm-project/commit/4286aca5d5adb2fd07fb07d0dbbc94e2ff16270d
DIFF: 
https://github.com/llvm/llvm-project/commit/4286aca5d5adb2fd07fb07d0dbbc94e2ff16270d.diff

LOG: [lldb][NFC] Add reminder to TestSampleTest that setUp should be deleted if 
it not needed.

Added: 


Modified: 
lldb/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py

Removed: 




diff  --git a/lldb/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py 
b/lldb/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py
index a22670a72a1a..3577723084a8 100644
--- a/lldb/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py
+++ b/lldb/packages/Python/lldbsuite/test/sample_test/TestSampleTest.py
@@ -28,6 +28,8 @@ def test_sample_rename_this(self):
 def setUp(self):
 # Call super's setUp().
 TestBase.setUp(self)
+# Set up your test case here. If your test doesn't need any set up then
+# remove this method from your TestCase class.
 
 def sample_test(self):
 """You might use the test implementation in several ways, say so 
here."""



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


[Lldb-commits] [PATCH] D71409: [lldb][NFC] Make metadata tracking type safe

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rG5ab9fa44cd60: [lldb][NFC] Make metadata tracking type safe 
(authored by teemperor).

Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71409

Files:
  lldb/include/lldb/Symbol/ClangASTContext.h
  lldb/include/lldb/Symbol/ClangExternalASTSourceCommon.h
  lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
  lldb/source/Symbol/ClangASTContext.cpp
  lldb/source/Symbol/ClangExternalASTSourceCommon.cpp

Index: lldb/source/Symbol/ClangExternalASTSourceCommon.cpp
===
--- lldb/source/Symbol/ClangExternalASTSourceCommon.cpp
+++ lldb/source/Symbol/ClangExternalASTSourceCommon.cpp
@@ -52,17 +52,19 @@
 }
 
 ClangASTMetadata *
-ClangExternalASTSourceCommon::GetMetadata(const void *object) {
-  auto It = m_metadata.find(object);
-  if (It != m_metadata.end())
+ClangExternalASTSourceCommon::GetMetadata(const clang::Decl *object) {
+  auto It = m_decl_metadata.find(object);
+  if (It != m_decl_metadata.end())
 return >second;
-  else
-return nullptr;
+  return nullptr;
 }
 
-void ClangExternalASTSourceCommon::SetMetadata(const void *object,
-   ClangASTMetadata ) {
-  m_metadata[object] = metadata;
+ClangASTMetadata *
+ClangExternalASTSourceCommon::GetMetadata(const clang::Type *object) {
+  auto It = m_type_metadata.find(object);
+  if (It != m_type_metadata.end())
+return >second;
+  return nullptr;
 }
 
 void ClangASTMetadata::Dump(Stream *s) {
Index: lldb/source/Symbol/ClangASTContext.cpp
===
--- lldb/source/Symbol/ClangASTContext.cpp
+++ lldb/source/Symbol/ClangASTContext.cpp
@@ -2398,14 +2398,31 @@
   }
 }
 
-void ClangASTContext::SetMetadataAsUserID(const void *object,
+void ClangASTContext::SetMetadataAsUserID(const clang::Decl *decl,
   user_id_t user_id) {
   ClangASTMetadata meta_data;
   meta_data.SetUserID(user_id);
-  SetMetadata(object, meta_data);
+  SetMetadata(decl, meta_data);
 }
 
-void ClangASTContext::SetMetadata(const void *object,
+void ClangASTContext::SetMetadataAsUserID(const clang::Type *type,
+  user_id_t user_id) {
+  ClangASTMetadata meta_data;
+  meta_data.SetUserID(user_id);
+  SetMetadata(type, meta_data);
+}
+
+void ClangASTContext::SetMetadata(const clang::Decl *object,
+  ClangASTMetadata ) {
+  ClangExternalASTSourceCommon *external_source =
+  ClangExternalASTSourceCommon::Lookup(
+  getASTContext()->getExternalSource());
+
+  if (external_source)
+external_source->SetMetadata(object, metadata);
+}
+
+void ClangASTContext::SetMetadata(const clang::Type *object,
   ClangASTMetadata ) {
   ClangExternalASTSourceCommon *external_source =
   ClangExternalASTSourceCommon::Lookup(
@@ -2416,14 +2433,23 @@
 }
 
 ClangASTMetadata *ClangASTContext::GetMetadata(clang::ASTContext *ast,
-   const void *object) {
+   const clang::Decl *object) {
   ClangExternalASTSourceCommon *external_source =
   ClangExternalASTSourceCommon::Lookup(ast->getExternalSource());
 
   if (external_source)
 return external_source->GetMetadata(object);
-  else
-return nullptr;
+  return nullptr;
+}
+
+ClangASTMetadata *ClangASTContext::GetMetadata(clang::ASTContext *ast,
+   const clang::Type *object) {
+  ClangExternalASTSourceCommon *external_source =
+  ClangExternalASTSourceCommon::Lookup(ast->getExternalSource());
+
+  if (external_source)
+return external_source->GetMetadata(object);
+  return nullptr;
 }
 
 bool ClangASTContext::SetTagTypeKind(clang::QualType tag_qual_type,
@@ -5096,7 +5122,7 @@
 clang::QualType qual_type,
 const ExecutionContext *exe_ctx) {
   if (qual_type->isIncompleteArrayType())
-if (auto *metadata = ast.GetMetadata(qual_type.getAsOpaquePtr()))
+if (auto *metadata = ast.GetMetadata(qual_type.getTypePtr()))
   return sym_file->GetDynamicArrayInfoForUID(metadata->GetUserID(),
  exe_ctx);
   return llvm::None;
@@ -8856,8 +8882,11 @@
 void ClangASTContext::DumpTypeDescription(lldb::opaque_compiler_type_t type) {
   StreamFile s(stdout, false);
   DumpTypeDescription(type, );
+
+  CompilerType ct(this, type);
+  const clang::Type *clang_type = ClangUtil::GetQualType(ct).getTypePtr();
   ClangASTMetadata *metadata =
-  ClangASTContext::GetMetadata(getASTContext(), type);
+  ClangASTContext::GetMetadata(getASTContext(), clang_type);
   if (metadata) {
 metadata->Dump();
   }
@@ -9485,7 +9514,7 @@
 
 

[Lldb-commits] [lldb] 5ab9fa4 - [lldb][NFC] Make metadata tracking type safe

2019-12-13 Thread Raphael Isemann via lldb-commits

Author: Raphael Isemann
Date: 2019-12-13T12:04:42+01:00
New Revision: 5ab9fa44cd60d5bca7b6d809a86bf10be416eb5d

URL: 
https://github.com/llvm/llvm-project/commit/5ab9fa44cd60d5bca7b6d809a86bf10be416eb5d
DIFF: 
https://github.com/llvm/llvm-project/commit/5ab9fa44cd60d5bca7b6d809a86bf10be416eb5d.diff

LOG: [lldb][NFC] Make metadata tracking type safe

Summary:
LLDB associates additional information with Types and Declarations which it 
calls ClangASTMetadata.
ClangASTMetadata is stored by the ClangASTSourceCommon which is implemented by 
having a large map of
`void *` keys to associated `ClangASTMetadata` values. To make this whole 
mechanism even unsafer
we also decided to use `clang::Decl *` as one of pointers we throw in there 
(beside `clang::Type *`).

The Decl class hierarchy uses multiple inheritance which means that not all 
pointers have the
same address when they are implicitly converted to pointers of their parent 
classes. For example
`clang::Decl *` and `clang::DeclContext *` won't end up being the same address 
when they
are implicitly converted from one of the many Decl-subclasses that inherit from 
both.

As we use the addresses as the keys in our Metadata map, this means that any 
implicit type
conversions to parent classes (or anything else that changes the addresses) 
will break our metadata tracking
in obscure ways.

Just to illustrate how broken this whole mechanism currently is:
```lang=cpp
  // m_ast is our ClangASTContext. Let's double check that from 
GetTranslationUnitDecl
  // in ClangASTContext and ASTContext return the same thing (one method just 
calls the other).
  assert(m_ast->GetTranslationUnitDecl() == 
m_ast->getASTContext()->getTranslationUnitDecl());
  // Ok, both methods have the same TU*. Let's store metadata with the result 
of one method call.
  m_ast->SetMetadataAsUserID(m_ast->GetTranslationUnitDecl(), 1234U);
  // Retrieve the same Metadata for the TU by using the TU* from the other 
method... which fails?
  
EXPECT_EQ(m_ast->GetMetadata(m_ast->getASTContext()->getTranslationUnitDecl())->GetUserID(),
 1234U);
  // Turns out that getTranslationUnitDecl one time returns a 
TranslationUnitDecl* but the other time
  // we return one of the parent classes of TranslationUnitDecl (DeclContext).
```

This patch splits up the `void *` API into two where one does the `clang::Type 
*` tracking and one the `clang::Decl *` mapping.
Type and Decl are disjoint class hierarchies so there is no implicit conversion 
possible that could influence
the address values.

I had to change the storing of `clang::QualType` opaque pointers to their 
`clang::Type *` equivalents as
opaque pointers are already `void *` pointers to begin with. We don't seem to 
ever set any qualifier in any of these
QualTypes to this conversion should be NFC.

Reviewers: labath, shafik, aprantl

Reviewed By: labath

Subscribers: JDevlieghere, lldb-commits

Tags: #lldb

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

Added: 


Modified: 
lldb/include/lldb/Symbol/ClangASTContext.h
lldb/include/lldb/Symbol/ClangExternalASTSourceCommon.h
lldb/source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp
lldb/source/Symbol/ClangASTContext.cpp
lldb/source/Symbol/ClangExternalASTSourceCommon.cpp

Removed: 




diff  --git a/lldb/include/lldb/Symbol/ClangASTContext.h 
b/lldb/include/lldb/Symbol/ClangASTContext.h
index 43d42105c936..9537f33b3386 100644
--- a/lldb/include/lldb/Symbol/ClangASTContext.h
+++ b/lldb/include/lldb/Symbol/ClangASTContext.h
@@ -145,16 +145,24 @@ class ClangASTContext : public TypeSystem {
 
   static bool GetCompleteDecl(clang::ASTContext *ast, clang::Decl *decl);
 
-  void SetMetadataAsUserID(const void *object, lldb::user_id_t user_id);
+  void SetMetadataAsUserID(const clang::Decl *decl, lldb::user_id_t user_id);
+  void SetMetadataAsUserID(const clang::Type *type, lldb::user_id_t user_id);
 
-  void SetMetadata(const void *object, ClangASTMetadata _data);
+  void SetMetadata(const clang::Decl *object, ClangASTMetadata _data);
+  void SetMetadata(const clang::Type *object, ClangASTMetadata _data);
+  ClangASTMetadata *GetMetadata(const clang::Decl *object) {
+return GetMetadata(getASTContext(), object);
+  }
+
+  static ClangASTMetadata *GetMetadata(clang::ASTContext *ast,
+   const clang::Decl *object);
 
-  ClangASTMetadata *GetMetadata(const void *object) {
+  ClangASTMetadata *GetMetadata(const clang::Type *object) {
 return GetMetadata(getASTContext(), object);
   }
 
   static ClangASTMetadata *GetMetadata(clang::ASTContext *ast,
-   const void *object);
+   const clang::Type *object);
 
   // Basic Types
   CompilerType GetBuiltinTypeForEncodingAndBitSize(lldb::Encoding encoding,
@@ -487,7 +495,7 @@ class ClangASTContext : public TypeSystem {
   

[Lldb-commits] [PATCH] D71454: [lldb][NFC] Remove all `setUp` overrides that only call the parent implementation

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

Yes, these are really annoying. Maybe it would be also good to add some 
language to TestSampleTest to say that you should only define this method if 
you actually want to do some work there..


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71454



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


[Lldb-commits] [PATCH] D71372: [lldb] Add additional validation on return address in 'thread step-out'

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

The test looks good. I think it should run fine on linux, and there's a decent 
chance it might work on windows too. It's fine to let check it in this way, and 
we can add some skips later if bots start complaining.

As for the location, /maybe/ ExecControl would be a better place for it but 
it's a bit hard to say because it has only two tests inside. I'd probably but 
it there, but leaving it in Unwind isn't the end of the world either. We can do 
the move later once the test structure crystallizes better. I wouldn't worry 
about duplicating call-asm.c though, as it's super-simple...




Comment at: lldb/source/Target/ThreadPlanStepOut.cpp:136-137
+  m_return_addr);
+  LLDB_LOGF(log, "ThreadPlanStepOut(%p): %s", static_cast(this),
+m_constructor_errors.GetData());
+  return;

I'd probably remove the log statements now that we have the real error output.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71372



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


[Lldb-commits] [PATCH] D71409: [lldb][NFC] Make metadata tracking type safe

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor marked an inline comment as done.
teemperor added inline comments.



Comment at: lldb/source/Symbol/ClangExternalASTSourceCommon.cpp:64
+ClangExternalASTSourceCommon::GetMetadata(const clang::Type *object) {
+  auto It = m_type_metadata.find(object);
+  if (It != m_type_metadata.end())

aprantl wrote:
> .lookup(), assuming this is a DenseMap?
We can't use it here as we return a pointer to the internally stored value in 
the map and not a value :(


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71409



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


[Lldb-commits] [PATCH] D71440: Extending step-over range past calls was causing deadlocks, fix that.

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

This looks like a tricky bug. Thanks for tracking it down.

I have two questions though: :D

- could you use c++11 locking primitives in the test? pthreads do not work on 
windows
- what exactly will be the effect of this? Will we start all threads 
immediately, or will we do the usual dance of trying to run one thread for a 
short period of time, and then resume all of them if that times out? If it's 
the latter, I'm wondering if we really need this call detection logic -- we 
could theoretically just use the "run all" method all the time (except if 
explicitly disabled), with the knowledge that all reasonable call-less 
sequences will finish before the "run single thread" timeout expires. And it 
would automatically also handle weird call-less sequences with spinlocks or 
what not...


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D71440



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


[Lldb-commits] [lldb] ec109fb - [lldb/cmake] Temporarily revive LLDB_DISABLE_CURSES

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

Author: Pavel Labath
Date: 2019-12-13T10:23:35+01:00
New Revision: ec109fb7edc627d777ead14fd289ea2f2278a4ad

URL: 
https://github.com/llvm/llvm-project/commit/ec109fb7edc627d777ead14fd289ea2f2278a4ad
DIFF: 
https://github.com/llvm/llvm-project/commit/ec109fb7edc627d777ead14fd289ea2f2278a4ad.diff

LOG: [lldb/cmake] Temporarily revive LLDB_DISABLE_CURSES

At least one lldb bot still uses this cmake variable instead of
LLDB_ENABLE_CURSES. Add code to set the default value of the "enable"
variable based on the old value of the "disable" setting.

This should bring those bots back up, until we can update the master to
use the new setting.

Added: 


Modified: 
lldb/cmake/modules/LLDBConfig.cmake

Removed: 




diff  --git a/lldb/cmake/modules/LLDBConfig.cmake 
b/lldb/cmake/modules/LLDBConfig.cmake
index 16d4d8c9c460..d2ae1ba20140 100644
--- a/lldb/cmake/modules/LLDBConfig.cmake
+++ b/lldb/cmake/modules/LLDBConfig.cmake
@@ -28,6 +28,15 @@ set(default_disable_python OFF)
 set(default_enable_libedit ON)
 set(default_enable_curses ON)
 
+# Temporary support the old LLDB_DISABLE_CURSES variable
+if (DEFINED LLDB_DISABLE_CURSES)
+  if (LLDB_DISABLE_CURSES)
+set(default_enable_curses OFF)
+  else()
+set(default_enable_curses ON)
+  endif()
+endif()
+
 if(DEFINED LLVM_ENABLE_LIBEDIT AND NOT LLVM_ENABLE_LIBEDIT)
   set(default_disable_libedit ON)
 endif()
@@ -44,8 +53,8 @@ elseif(IOS)
 endif()
 
 option(LLDB_DISABLE_PYTHON "Disable Python scripting integration." 
${default_disable_python})
-option(LLDB_ENABLE_LIBEDIT "Disable the use of editline." 
${default_enable_libedit})
-option(LLDB_ENABLE_CURSES "Disable Curses integration." 
${default_enable_curses})
+option(LLDB_ENABLE_LIBEDIT "Enable the use of editline." 
${default_enable_libedit})
+option(LLDB_ENABLE_CURSES "Enable Curses integration." 
${default_enable_curses})
 option(LLDB_RELOCATABLE_PYTHON "Use the PYTHONHOME environment variable to 
locate Python." OFF)
 option(LLDB_USE_SYSTEM_SIX "Use six.py shipped with system and do not install 
a copy of it" OFF)
 option(LLDB_USE_ENTITLEMENTS "When codesigning, use entitlements if available" 
ON)



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


[Lldb-commits] [PATCH] D71454: [lldb][NFC] Remove all `setUp` overrides that only call the parent implementation

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor created this revision.
teemperor added reviewers: labath, JDevlieghere.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

A lot of our tests copied the setUp code from our TestSampleTest.py:

  def setUp(self):
  # Call super's setUp().
  TestBase.setUp(self)

This code does nothing unless we actually do any setUp work in there, so let's 
remove all these method definitions.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D71454

Files:
  lldb/packages/Python/lldbsuite/test/api/listeners/TestListener.py
  lldb/packages/Python/lldbsuite/test/commands/apropos/basic/TestApropos.py
  
lldb/packages/Python/lldbsuite/test/commands/command/script/import/TestImport.py
  
lldb/packages/Python/lldbsuite/test/commands/command/script/import/rdar-12586188/TestRdar12586188.py
  
lldb/packages/Python/lldbsuite/test/commands/disassemble/basic/TestFrameDisassemble.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/calculator_mode/TestCalculatorMode.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/dont_allow_jit/TestAllowJIT.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/entry-bp/TestExprEntryBP.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/persistent_ptr_update/TestPersistentPtrUpdate.py
  
lldb/packages/Python/lldbsuite/test/commands/expression/weak_symbols/TestWeakSymbols.py
  lldb/packages/Python/lldbsuite/test/commands/frame/diagnose/array/TestArray.py
  
lldb/packages/Python/lldbsuite/test/commands/frame/language/TestGuessLanguage.py
  lldb/packages/Python/lldbsuite/test/commands/frame/var/TestFrameVar.py
  
lldb/packages/Python/lldbsuite/test/commands/register/register/intel_xtended_registers/TestMPXRegisters.py
  
lldb/packages/Python/lldbsuite/test/commands/register/register/intel_xtended_registers/mpx_offset_intersection/TestMPXOffsetIntersection.py
  
lldb/packages/Python/lldbsuite/test/commands/target/stop-hooks/TestStopHooks.py
  lldb/packages/Python/lldbsuite/test/commands/version/TestVersion.py
  
lldb/packages/Python/lldbsuite/test/commands/watchpoints/watchpoint_disable/TestWatchpointDisable.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestAddressBreakpoints.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/address_breakpoints/TestBadAddressBreakpoints.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/auto_continue/TestBreakpointAutoContinue.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/breakpoint_language/TestBreakpointLanguage.py
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/scripted_bkpt/TestScriptedResolver.py
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/data-formatter-caching/TestDataFormatterCaching.py
  
lldb/packages/Python/lldbsuite/test/functionalities/data-formatter/type_summary_list_arg/TestTypeSummaryListArg.py
  
lldb/packages/Python/lldbsuite/test/functionalities/history/TestHistoryRecall.py
  lldb/packages/Python/lldbsuite/test/functionalities/longjmp/TestLongjmp.py
  
lldb/packages/Python/lldbsuite/test/functionalities/pre_run_dylibs/TestPreRunDylibs.py
  
lldb/packages/Python/lldbsuite/test/functionalities/stats_api/TestStatisticsAPI.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/sbapi_support/TestTailCallFrameSBAPI.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tail_call_frames/thread_step_out_or_return/TestSteppingOutWithArtificialFrames.py
  
lldb/packages/Python/lldbsuite/test/functionalities/thread/backtrace_limit/TestBacktraceLimit.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/cpp_global_location/TestTsanCPPGlobalLocation.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/global_location/TestTsanGlobalLocation.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/multiple/TestTsanMultiple.py
  
lldb/packages/Python/lldbsuite/test/functionalities/tsan/thread_numbers/TestTsanThreadNumbers.py
  lldb/packages/Python/lldbsuite/test/functionalities/var_path/TestVarPath.py
  
lldb/packages/Python/lldbsuite/test/lang/c/find_struct_type/TestFindStructTypes.py
  lldb/packages/Python/lldbsuite/test/lang/c/local_types/TestUseClosestType.py
  
lldb/packages/Python/lldbsuite/test/lang/cpp/dynamic-value-same-basename/TestDynamicValueSameBase.py
  lldb/packages/Python/lldbsuite/test/lang/cpp/trivial_abi/TestTrivialABI.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-app-update/TestClangModulesAppUpdate.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-cache/TestClangModulesCache.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-hash-mismatch/TestClangModulesHashMismatch.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-inline-functions/TestModulesInlineFunctions.py
  
lldb/packages/Python/lldbsuite/test/lang/objc/modules-update/TestClangModulesUpdate.py
  

[Lldb-commits] [PATCH] D71452: [lldb][NFC] Remove 'from __future__ import print_function' from all tests that don't actually call 'print()'

2019-12-13 Thread Raphael Isemann via Phabricator via lldb-commits
teemperor added a comment.
Herald added subscribers: wuzish, dexonsmith.

I tested this on python2 (macOS) and python3 (Arch Linux) so this shouldn't 
break any test.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D71452



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


[Lldb-commits] [PATCH] D70644: [DebugInfo] Support for DW_OP_implicit_pointer (llvm.dbg_derefval)

2019-12-13 Thread Jeremy Morse via Phabricator via lldb-commits
jmorse added a comment.

Thanks for the patch, comments inline. A couple of things in general:

As mentioned on the mailing list thread, it bothers me a little that 
DbgVariableIntrinsic::getVariableLocation is going to try and return something 
that isn't a "Real" location. In fact, wouldn't the assertion at the end of 
getVariableLocation fire if the operand was a non-null non-ValueAsMetadata 
piece of metadata? It might make sense to add another level to the class 
hierarchy, to distinguish variable intrinsics that definitely always have a 
location, and the "more complicated" situation dbg.derefval has.

(I tried to think up what I'd like a class hierarchy to look like for all the 
debugging intrinsics, but they all have substantially different use cases).

I haven't reviewed the changes to SelectionDAG, I think those are probably 
better placed in D69886  with the other 
CodeGen changes, would you be able to move the changes into that review? (Both 
modify SelectionDAGBuilder.cpp). That way all the SelectionDAG modifications 
are in one place, and have the tests with them.




Comment at: llvm/docs/SourceLevelDebugging.rst:261
+This intrinsic is identical to `llvm.dbg.value`, except that it is used to
+describe dereferenced value of pointer variable. The first argument is 
metadata.
+The second argument is a `local variable `_

I'd add some motivation to the first sentence, such as: "it it used to describe 
the dereferenced value of a pointer variable, when the pointer itself is no 
longer available in the program".



Comment at: llvm/docs/SourceLevelDebugging.rst:266-267
+interpreted based on the third argument. If the third argument represents
+DW_OP_LLVM_implicit_pointer, the first argument is
+ `local variable `_ , otherwise it is the value
+(wrapped as metadata).

IMO "is" should read "must", i.e. "the first argument must be a local 
variable", to indicate this is required for correctness.



Comment at: llvm/include/llvm/CodeGen/GlobalISel/MachineIRBuilder.h:369
 
+  /// Build and insert a DBG_VALUE instructions specifying that dereferenced
+  /// value of \p Variable is given by \p V (suitably modified by \p Expr).

"that the dereferenced"?



Comment at: llvm/include/llvm/CodeGen/MachineInstrBuilder.h:227-238
+  const MachineInstrBuilder (const MDNode *MD,
+ bool IsImplicitPointer = false) const 
{
 MI->addOperand(*MF, MachineOperand::CreateMetadata(MD));
-assert((MI->isDebugValue() ? static_cast(MI->getDebugVariable())
-   : true) &&
+assert(((MI->isDebugValue() && !IsImplicitPointer)
+? static_cast(MI->getDebugVariable())
+: true) &&
"first MDNode argument of a DBG_VALUE not a variable");

Perhaps it's worth adding a new "add" method, i.e. "addImplicitPtrMetadata"? 
That avoids the extra argument, and in the call sites below it will be a little 
clearer what's happening, as a "true" argument isn't especially helpful.

Plus, then you can assert that only DILocalVariables (or whatever) are added as 
the implicit pointer metadata.



Comment at: llvm/lib/CodeGen/LiveDebugValues.cpp:717-718
   if (isDbgValueDescribedByReg(MI) || MI.getOperand(0).isImm() ||
-  MI.getOperand(0).isFPImm() || MI.getOperand(0).isCImm()) {
+  MI.getOperand(0).isFPImm() || MI.getOperand(0).isCImm() ||
+  MI.getOperand(0).isMetadata()) {
 // Use normal VarLoc constructor for registers and immediates.

The main VarLoc constructor called on line 720 is going to not recognise the 
metadata operand and leave some fields uninitialized (it should probably 
actually assert in this case). I reckon you'll need to add a new location 
"Kind", and have it emitted in the BuildDbgValue method.

The LiveDebugValues algorithm should (TM) handle and propagate this kind of 
location fine.



Comment at: llvm/lib/CodeGen/SelectionDAG/FastISel.cpp:1447
   }
+  case Intrinsic::dbg_derefval: {
+// This form of DBG_VALUE is target-independent.

Perhaps easier here instead to have dbg_derefval and dbg_value share code, with 
an additional assertion that MetadataAsValue operands can only come from 
dbg_value's?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70644



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