[Lldb-commits] [PATCH] D64719: [zorg] [LLDB] getLLDBCMakeBuildFactory: New parameter testTimeout

2019-07-15 Thread Jan Kratochvil via Phabricator via lldb-commits
jankratochvil created this revision.
jankratochvil added reviewers: gkistanova, stella.stamenova, labath.
jankratochvil added a project: LLDB.
jankratochvil added a subscriber: kwk.

Just for some difficult-to-catch buildbot failures. I think the patch is 
obvious, OK for check-in? Thanks.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64719

Files:
  buildbot/osuosl/master/config/builders.py
  zorg/buildbot/builders/LLDBBuilder.py


Index: zorg/buildbot/builders/LLDBBuilder.py
===
--- zorg/buildbot/builders/LLDBBuilder.py
+++ zorg/buildbot/builders/LLDBBuilder.py
@@ -62,6 +62,7 @@
 
 extra_cmake_args=None,
 test=False,
+testTimeout=2400,
 install=False):
 
 # PREPARING
@@ -142,7 +143,7 @@
 f.addStep(ShellCommand(name='test',
   command=test_cmd,
   flunkOnFailure=ignoreTestFail,
-  timeout=2400,
+  timeout=testTimeout,
   description='ninja test',
   workdir=build_dir,
   doStepIf=bool(test),
Index: buildbot/osuosl/master/config/builders.py
===
--- buildbot/osuosl/master/config/builders.py
+++ buildbot/osuosl/master/config/builders.py
@@ -855,8 +855,10 @@
  'builddir': "lldb-x86_64-fedora",
  'category' : 'lldb',
  'factory': LLDBBuilder.getLLDBCMakeBuildFactory(
+config='RelWithDebInfo',
 clean=True,
 test=True,
+testTimeout=30*24*3600,
 extra_cmake_args=['-DLLVM_ENABLE_ASSERTIONS=True',
   '-DLLVM_USE_LINKER=gold',
   '-DLLVM_LIT_ARGS="-v"'])},


Index: zorg/buildbot/builders/LLDBBuilder.py
===
--- zorg/buildbot/builders/LLDBBuilder.py
+++ zorg/buildbot/builders/LLDBBuilder.py
@@ -62,6 +62,7 @@
 
 extra_cmake_args=None,
 test=False,
+testTimeout=2400,
 install=False):
 
 # PREPARING
@@ -142,7 +143,7 @@
 f.addStep(ShellCommand(name='test',
   command=test_cmd,
   flunkOnFailure=ignoreTestFail,
-  timeout=2400,
+  timeout=testTimeout,
   description='ninja test',
   workdir=build_dir,
   doStepIf=bool(test),
Index: buildbot/osuosl/master/config/builders.py
===
--- buildbot/osuosl/master/config/builders.py
+++ buildbot/osuosl/master/config/builders.py
@@ -855,8 +855,10 @@
  'builddir': "lldb-x86_64-fedora",
  'category' : 'lldb',
  'factory': LLDBBuilder.getLLDBCMakeBuildFactory(
+config='RelWithDebInfo',
 clean=True,
 test=True,
+testTimeout=30*24*3600,
 extra_cmake_args=['-DLLVM_ENABLE_ASSERTIONS=True',
   '-DLLVM_USE_LINKER=gold',
   '-DLLVM_LIT_ARGS="-v"'])},
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D61333: [ASTImporter] Fix LLDB lookup in transparent ctx and with ext src

2019-07-15 Thread Gabor Marton via Phabricator via lldb-commits
martong updated this revision to Diff 209832.
martong added a comment.

- Rebase to master


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61333

Files:
  clang/lib/AST/ASTImporter.cpp
  clang/unittests/AST/ASTImporterTest.cpp
  lldb/packages/Python/lldbsuite/test/lang/c/ast/Makefile
  lldb/packages/Python/lldbsuite/test/lang/c/ast/TestAST.py
  lldb/packages/Python/lldbsuite/test/lang/c/ast/main.c
  lldb/packages/Python/lldbsuite/test/lang/c/modules/main.c
  lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp

Index: lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
===
--- lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
+++ lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
@@ -611,6 +611,8 @@
   if (!original_decl_context)
 return;
 
+  // Indicates whether we skipped any Decls of the original DeclContext.
+  bool SkippedDecls = false;
   for (TagDecl::decl_iterator iter = original_decl_context->decls_begin();
iter != original_decl_context->decls_end(); ++iter) {
 Decl *decl = *iter;
@@ -639,21 +641,22 @@
 
 m_ast_importer_sp->RequireCompleteType(copied_field_type);
   }
-
-  DeclContext *decl_context_non_const =
-  const_cast(decl_context);
-
-  if (copied_decl->getDeclContext() != decl_context) {
-if (copied_decl->getDeclContext()->containsDecl(copied_decl))
-  copied_decl->getDeclContext()->removeDecl(copied_decl);
-copied_decl->setDeclContext(decl_context_non_const);
-  }
-
-  if (!decl_context_non_const->containsDecl(copied_decl))
-decl_context_non_const->addDeclInternal(copied_decl);
+} else {
+  SkippedDecls = true;
 }
   }
 
+  // CopyDecl may build a lookup table which may set up ExternalLexicalStorage
+  // to false.  However, since we skipped some of the external Decls we must
+  // set it back!
+  if (SkippedDecls) {
+decl_context->setHasExternalLexicalStorage(true);
+// This sets HasLazyExternalLexicalLookups to true.  By setting this bit we
+// ensure that the lookup table is rebuilt, which means the external source
+// is consulted again when a clang::DeclContext::lookup is called.
+const_cast(decl_context)->setMustBuildLookupTable();
+  }
+
   return;
 }
 
Index: lldb/packages/Python/lldbsuite/test/lang/c/modules/main.c
===
--- lldb/packages/Python/lldbsuite/test/lang/c/modules/main.c
+++ lldb/packages/Python/lldbsuite/test/lang/c/modules/main.c
@@ -5,11 +5,11 @@
 typedef struct {
 int a;
 int b;
-} FILE;
+} MYFILE;
 
 int main()
 {
-FILE *myFile = malloc(sizeof(FILE));
+MYFILE *myFile = malloc(sizeof(MYFILE));
 
 myFile->a = 5;
 myFile->b = 9;
Index: lldb/packages/Python/lldbsuite/test/lang/c/ast/main.c
===
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/c/ast/main.c
@@ -0,0 +1,5 @@
+int main()
+{
+int a = 0; // Set breakpoint 0 here.
+return 0;
+}
Index: lldb/packages/Python/lldbsuite/test/lang/c/ast/TestAST.py
===
--- /dev/null
+++ lldb/packages/Python/lldbsuite/test/lang/c/ast/TestAST.py
@@ -0,0 +1,77 @@
+"""Test that importing modules in C works as expected."""
+
+from __future__ import print_function
+
+
+from distutils.version import StrictVersion
+import os
+import time
+import platform
+
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+
+class CModulesTestCase(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+@skipIfFreeBSD
+@skipIfLinux
+@skipIfWindows
+@skipIfNetBSD
+@skipIf(macos_version=["<", "10.12"])
+def test_expr(self):
+self.build()
+exe = self.getBuildArtifact("a.out")
+self.runCmd("file " + exe, CURRENT_EXECUTABLE_SET)
+
+lldbutil.run_break_set_by_file_and_line(
+self, "main.c", self.line, num_expected_locations=1, loc_exact=True)
+
+self.runCmd("run", RUN_SUCCEEDED)
+
+# The stop reason of the thread should be breakpoint.
+self.expect("thread list", STOPPED_DUE_TO_BREAKPOINT,
+substrs=['stopped',
+ 'stop reason = breakpoint'])
+
+# The breakpoint should have a hit count of 1.
+self.expect("breakpoint list -f", BREAKPOINT_HIT_ONCE,
+substrs=[' resolved, hit count = 1'])
+
+# Enable logging of the imported AST.
+log_file = os.path.join(self.getBuildDir(), "lldb-ast-log.txt")
+self.runCmd("log enable lldb ast -f '%s'" % log_file)
+
+self.expect(
+"expr -l objc++ -- @import Darwin; 3",
+VARIABLES_DISPLAYED_CORRECT

[Lldb-commits] [PATCH] D61333: [ASTImporter] Fix LLDB lookup in transparent ctx and with ext src

2019-07-15 Thread Gabor Marton via Phabricator via lldb-commits
martong added a comment.

In D61333#1583173 , @teemperor wrote:

> @martong Sorry for the delay, feel free to ping me in the future about these 
> patches. I'll review them ASAP now that I'm back in office, so these delay's 
> hopefully won't happen again.
>
> I tried applying this patch and it seems it needs to be rebased. I would do 
> it myself, but I'm not entirely sure how to rebase the changes to 
> `ASTNodeImporter::ImportDefinition`. It seems we got rid of 
> `To->completeDefinition();`, so not sure if the code that this patch adds is 
> still in the right place.


Raphael,

Thank you for looking into this. I've rebased to master and updated the patch.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61333



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


[Lldb-commits] [PATCH] D64698: Handle EOF from `lldb-vscode`

2019-07-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

Looks solid to me, but I'll defer to Greg to accept.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64698



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


[Lldb-commits] [PATCH] D64719: [zorg] [LLDB] getLLDBCMakeBuildFactory: New parameter testTimeout

2019-07-15 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366078: [LLDB] getLLDBCMakeBuildFactory: New parameter 
testTimeout (authored by jankratochvil, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64719?vs=209811&id=209886#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64719

Files:
  zorg/trunk/buildbot/osuosl/master/config/builders.py
  zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py


Index: zorg/trunk/buildbot/osuosl/master/config/builders.py
===
--- zorg/trunk/buildbot/osuosl/master/config/builders.py
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py
@@ -855,8 +855,10 @@
  'builddir': "lldb-x86_64-fedora",
  'category' : 'lldb',
  'factory': LLDBBuilder.getLLDBCMakeBuildFactory(
+config='RelWithDebInfo',
 clean=True,
 test=True,
+testTimeout=30*24*3600,
 extra_cmake_args=['-DLLVM_ENABLE_ASSERTIONS=True',
   '-DLLVM_USE_LINKER=gold',
   '-DLLVM_LIT_ARGS="-v"'])},
Index: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
===
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
@@ -62,6 +62,7 @@
 
 extra_cmake_args=None,
 test=False,
+testTimeout=2400,
 install=False):
 
 # PREPARING
@@ -142,7 +143,7 @@
 f.addStep(ShellCommand(name='test',
   command=test_cmd,
   flunkOnFailure=ignoreTestFail,
-  timeout=2400,
+  timeout=testTimeout,
   description='ninja test',
   workdir=build_dir,
   doStepIf=bool(test),


Index: zorg/trunk/buildbot/osuosl/master/config/builders.py
===
--- zorg/trunk/buildbot/osuosl/master/config/builders.py
+++ zorg/trunk/buildbot/osuosl/master/config/builders.py
@@ -855,8 +855,10 @@
  'builddir': "lldb-x86_64-fedora",
  'category' : 'lldb',
  'factory': LLDBBuilder.getLLDBCMakeBuildFactory(
+config='RelWithDebInfo',
 clean=True,
 test=True,
+testTimeout=30*24*3600,
 extra_cmake_args=['-DLLVM_ENABLE_ASSERTIONS=True',
   '-DLLVM_USE_LINKER=gold',
   '-DLLVM_LIT_ARGS="-v"'])},
Index: zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
===
--- zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
+++ zorg/trunk/zorg/buildbot/builders/LLDBBuilder.py
@@ -62,6 +62,7 @@
 
 extra_cmake_args=None,
 test=False,
+testTimeout=2400,
 install=False):
 
 # PREPARING
@@ -142,7 +143,7 @@
 f.addStep(ShellCommand(name='test',
   command=test_cmd,
   flunkOnFailure=ignoreTestFail,
-  timeout=2400,
+  timeout=testTimeout,
   description='ninja test',
   workdir=build_dir,
   doStepIf=bool(test),
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [lldb] r366083 - [lldb][doc] Document how our LLDB table gen initialized options

2019-07-15 Thread Raphael Isemann via lldb-commits
Author: teemperor
Date: Mon Jul 15 10:10:44 2019
New Revision: 366083

URL: http://llvm.org/viewvc/llvm-project?rev=366083&view=rev
Log:
[lldb][doc] Document how our LLDB table gen initialized options

Summary: This patch adds documentation that should make it easier to migrate 
from using the old initializers to the table gen format.

Reviewers: jingham

Reviewed By: jingham

Subscribers: abidh, lldb-commits, JDevlieghere

Tags: #lldb

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

Modified:
lldb/trunk/source/Commands/OptionsBase.td

Modified: lldb/trunk/source/Commands/OptionsBase.td
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/OptionsBase.td?rev=366083&r1=366082&r2=366083&view=diff
==
--- lldb/trunk/source/Commands/OptionsBase.td (original)
+++ lldb/trunk/source/Commands/OptionsBase.td Mon Jul 15 10:10:44 2019
@@ -1,3 +1,101 @@
+
+// The fields below describe how the fields of `OptionDefinition` struct are
+// initialized by different definitions in the Options.td and this file.
+
+// Field: usage_mask
+// Default value: LLDB_OPT_SET_ALL (Option allowed in all groups)
+// Set by:
+//  - `Group`: Sets a single group to this option.
+// Example: def foo : Option<"foo", "f">, Group<1>;
+//  - `Groups`: Sets a given list of group numbers.
+//  Example: def foo : Option<"foo", "f">, Groups<[1,4,6]>;
+//  - `GroupRange`: Sets an interval of groups. Start and end are inclusive.
+//  Example: def foo : Option<"foo", "f">, GroupRange<1, 4>;
+//   Sets group 1, 2, 3, 4 for the option.
+
+// Field: required
+// Default value: false (Not required)
+// Set by:
+//   - `Required`: Marks the option as required.
+//  Example: def foo : Option<"foo", "f">, Required;
+
+// Field: long_option
+// Default value: not available (has to be defined in Option)
+// Set by:
+//   - `Option` constructor: Already set by constructor.
+//   Example: def foo : Option<"long-option", "l">
+//   ^
+//long option value
+
+// Field: short_option
+// Default value: not available (has to be defined in Option)
+// Set by:
+//   - `Option` constructor: Already set by constructor.
+//   Example: def foo : Option<"long-option", "l">
+// ^
+//short option
+
+// Field: option_has_arg
+// Default value: OptionParser::eNoArgument (No argument allowed)
+// Set by:
+//  - `OptionalArg`: Sets the argument type and marks it as optional.
+//  - `Arg`: Sets the argument type and marks it as required.
+//  - `EnumArg`: Sets the argument type to an enum and marks it as required.
+// See argument_type field for more info.
+
+// Field: validator
+// Default value: 0 (No validator for option)
+// Set by: Nothing. This is currently only set after initialization in LLDB.
+
+// Field: enum_values
+// Default value: {} (No enum associated with this option)
+// Set by:
+//  - `EnumArg`: Sets the argument type and assigns it a enum holding the valid
+//   values. The enum needs to be a variable in the including code.
+//   Marks the option as required (see option_has_arg).
+//   Example: def foo : Option<"foo", "f">,
+//  EnumArg<"SortOrder",
+//  "OptionEnumValues(g_sort_option_enumeration)">;
+
+// Field: completion_type
+// Default value: CommandCompletions::eNoCompletion (no tab completion)
+// Set by:
+//  - `Completion`: Gives the option a single completion kind.
+//  Example: def foo : Option<"foo", "f">,
+// Completion<"DiskFile">;
+//   Sets the completion to eDiskFileCompletion
+//
+//  - `Completions`: Sets a given kinds of completions.
+//   Example: def foo : Option<"foo", "f">,
+//  Completions<["DiskFile", "DiskDirectory"]>;
+//Sets the completion to
+//`eDiskFileCompletion | eDiskDirectoryCompletion`.
+/

[Lldb-commits] [PATCH] D64670: [lldb][doc] Document how our LLDB table gen initialized options

2019-07-15 Thread Raphael Isemann via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366083: [lldb][doc] Document how our LLDB table gen 
initialized options (authored by teemperor, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64670?vs=209610&id=209898#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64670

Files:
  lldb/trunk/source/Commands/OptionsBase.td

Index: lldb/trunk/source/Commands/OptionsBase.td
===
--- lldb/trunk/source/Commands/OptionsBase.td
+++ lldb/trunk/source/Commands/OptionsBase.td
@@ -1,3 +1,101 @@
+
+// The fields below describe how the fields of `OptionDefinition` struct are
+// initialized by different definitions in the Options.td and this file.
+
+// Field: usage_mask
+// Default value: LLDB_OPT_SET_ALL (Option allowed in all groups)
+// Set by:
+//  - `Group`: Sets a single group to this option.
+// Example: def foo : Option<"foo", "f">, Group<1>;
+//  - `Groups`: Sets a given list of group numbers.
+//  Example: def foo : Option<"foo", "f">, Groups<[1,4,6]>;
+//  - `GroupRange`: Sets an interval of groups. Start and end are inclusive.
+//  Example: def foo : Option<"foo", "f">, GroupRange<1, 4>;
+//   Sets group 1, 2, 3, 4 for the option.
+
+// Field: required
+// Default value: false (Not required)
+// Set by:
+//   - `Required`: Marks the option as required.
+//  Example: def foo : Option<"foo", "f">, Required;
+
+// Field: long_option
+// Default value: not available (has to be defined in Option)
+// Set by:
+//   - `Option` constructor: Already set by constructor.
+//   Example: def foo : Option<"long-option", "l">
+//   ^
+//long option value
+
+// Field: short_option
+// Default value: not available (has to be defined in Option)
+// Set by:
+//   - `Option` constructor: Already set by constructor.
+//   Example: def foo : Option<"long-option", "l">
+// ^
+//short option
+
+// Field: option_has_arg
+// Default value: OptionParser::eNoArgument (No argument allowed)
+// Set by:
+//  - `OptionalArg`: Sets the argument type and marks it as optional.
+//  - `Arg`: Sets the argument type and marks it as required.
+//  - `EnumArg`: Sets the argument type to an enum and marks it as required.
+// See argument_type field for more info.
+
+// Field: validator
+// Default value: 0 (No validator for option)
+// Set by: Nothing. This is currently only set after initialization in LLDB.
+
+// Field: enum_values
+// Default value: {} (No enum associated with this option)
+// Set by:
+//  - `EnumArg`: Sets the argument type and assigns it a enum holding the valid
+//   values. The enum needs to be a variable in the including code.
+//   Marks the option as required (see option_has_arg).
+//   Example: def foo : Option<"foo", "f">,
+//  EnumArg<"SortOrder",
+//  "OptionEnumValues(g_sort_option_enumeration)">;
+
+// Field: completion_type
+// Default value: CommandCompletions::eNoCompletion (no tab completion)
+// Set by:
+//  - `Completion`: Gives the option a single completion kind.
+//  Example: def foo : Option<"foo", "f">,
+// Completion<"DiskFile">;
+//   Sets the completion to eDiskFileCompletion
+//
+//  - `Completions`: Sets a given kinds of completions.
+//   Example: def foo : Option<"foo", "f">,
+//  Completions<["DiskFile", "DiskDirectory"]>;
+//Sets the completion to
+//`eDiskFileCompletion | eDiskDirectoryCompletion`.
+
+// Field: argument_type
+// Default value: eArgTypeNone
+// Set by:
+//  - `OptionalArg`: Sets the argument type and

[Lldb-commits] [PATCH] D64763: [LanguageRuntime] Move ObjCLanguageRuntime into a plugin

2019-07-15 Thread Alex Langford via Phabricator via lldb-commits
xiaobai created this revision.
xiaobai added reviewers: JDevlieghere, compnerd, jingham, clayborg.
Herald added subscribers: arphaman, mgorny.

Following up to my CPPLanguageRuntime change, I'm moving
ObjCLanguageRuntime into a plugin as well.


https://reviews.llvm.org/D64763

Files:
  include/lldb/Target/ObjCLanguageRuntime.h
  source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
  source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
  source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
  source/Plugins/Language/ObjC/CF.cpp
  source/Plugins/Language/ObjC/Cocoa.cpp
  source/Plugins/Language/ObjC/Cocoa.h
  source/Plugins/Language/ObjC/NSArray.cpp
  source/Plugins/Language/ObjC/NSDictionary.cpp
  source/Plugins/Language/ObjC/NSError.cpp
  source/Plugins/Language/ObjC/NSException.cpp
  source/Plugins/Language/ObjC/NSIndexPath.cpp
  source/Plugins/Language/ObjC/NSSet.cpp
  source/Plugins/Language/ObjC/NSString.h
  source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
  
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
  
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h
  
source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
  source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
  source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
  source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
  source/Symbol/CMakeLists.txt
  source/Symbol/ClangASTContext.cpp
  source/Target/CMakeLists.txt
  source/Target/ObjCLanguageRuntime.cpp

Index: source/Target/CMakeLists.txt
===
--- source/Target/CMakeLists.txt
+++ source/Target/CMakeLists.txt
@@ -10,7 +10,6 @@
   Memory.cpp
   MemoryHistory.cpp
   ModuleCache.cpp
-  ObjCLanguageRuntime.cpp
   OperatingSystem.cpp
   PathMappingList.cpp
   Platform.cpp
Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -86,7 +86,6 @@
 #include "lldb/Symbol/VerifyDecl.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Language.h"
-#include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/DataExtractor.h"
@@ -95,6 +94,7 @@
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/Utility/Scalar.h"
 
+#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
 #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
 #include "Plugins/SymbolFile/PDB/PDBASTParser.h"
 
Index: source/Symbol/CMakeLists.txt
===
--- source/Symbol/CMakeLists.txt
+++ source/Symbol/CMakeLists.txt
@@ -59,6 +59,7 @@
 lldbPluginSymbolFileDWARF
 lldbPluginSymbolFilePDB
 lldbPluginObjCLanguage
+lldbPluginObjCRuntime
 
   LINK_COMPONENTS
 Support
Index: include/lldb/Target/ObjCLanguageRuntime.h
===
--- /dev/null
+++ include/lldb/Target/ObjCLanguageRuntime.h
@@ -1,429 +0,0 @@
-//===-- ObjCLanguageRuntime.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_ObjCLanguageRuntime_h_
-#define liblldb_ObjCLanguageRuntime_h_
-
-#include 
-#include 
-#include 
-#include 
-
-#include "llvm/Support/Casting.h"
-
-#include "lldb/Breakpoint/BreakpointPrecondition.h"
-#include "lldb/Core/PluginInterface.h"
-#include "lldb/Core/ThreadSafeDenseMap.h"
-#include "lldb/Symbol/CompilerType.h"
-#include "lldb/Symbol/Type.h"
-#include "lldb/Target/LanguageRuntime.h"
-#include "lldb/lldb-private.h"
-
-class CommandObjectObjC_ClassTable_Dump;
-
-namespace lldb_private {
-
-class UtilityFunction;
-
-class ObjCLanguageRuntime : public LanguageRuntime {
-public:
-  enum class ObjCRuntimeVersions {
-eObjC_VersionUnknown = 0,
-eAp

[Lldb-commits] [PATCH] D61333: [ASTImporter] Fix LLDB lookup in transparent ctx and with ext src

2019-07-15 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik added a comment.

This LGTM now but I will wait for @teemperor to take a look at it.




Comment at: lldb/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp:620
 
 if (predicate(decl->getKind())) {
   if (log) {

I think a comment on the `predicate` would be helpful as well.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D61333



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


[Lldb-commits] [PATCH] D64767: [lldb][test_suite] Update tests with unexpected pass on Android aarch64

2019-07-15 Thread Wanyi Ye via Phabricator via lldb-commits
kusmour created this revision.
kusmour added reviewers: xiaobai, labath.
Herald added subscribers: lldb-commits, kristof.beyls, javed.absar, srhines.
Herald added a project: LLDB.

update some test decorates that can actually pass on andriod aarch64


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64767

Files:
  
lldb/packages/Python/lldbsuite/test/functionalities/breakpoint/hardware_breakpoints/hardware_breakpoint_on_multiple_threads/TestHWBreakMultiThread.py
  
lldb/packages/Python/lldbsuite/test/functionalities/deleted-executable/TestDeletedExecutable.py
  
lldb/packages/Python/lldbsuite/test/functionalities/inferior-assert/TestInferiorAssert.py
  
lldb/packages/Python/lldbsuite/test/functionalities/load_unload/TestLoadUnload.py
  
lldb/packages/Python/lldbsuite/test/functionalities/target_command/TestTargetCommand.py
  
lldb/packages/Python/lldbsuite/test/functionalities/target_create_deps/TestTargetCreateDeps.py
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandLLDB.py
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/command/TestWatchpointCommandPython.py
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_commands/condition/TestWatchpointConditionCmd.py
  
lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
  
lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
  
lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
  
lldb/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
  lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py

Index: lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
===
--- lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
+++ lldb/packages/Python/lldbsuite/test/tools/lldb-server/TestLldbGdbServer.py
@@ -1279,7 +1279,6 @@
 
 @llgs_test
 @skipUnlessPlatform(oslist=['linux'])
-@expectedFailureAndroid
 @skipIf(archs=no_match(['arm', 'aarch64']))
 def test_hardware_breakpoint_set_and_remove_work_llgs(self):
 self.init_llgs_test()
Index: lldb/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
===
--- lldb/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
+++ lldb/packages/Python/lldbsuite/test/python_api/watchpoint/condition/TestWatchpointConditionAPI.py
@@ -36,6 +36,7 @@
 @expectedFailureAll(
 oslist=["linux"],
 archs=["aarch64"],
+triple=no_match(".*-android"),
 bugnumber="llvm.org/pr27710")
 @skipIfWindows  # Watchpoints not supported on Windows, and this test hangs
 def test_watchpoint_cond_api(self):
Index: lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
===
--- lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
+++ lldb/packages/Python/lldbsuite/test/lang/c/global_variables/TestGlobalVariables.py
@@ -22,7 +22,10 @@
 self.shlib_names = ["a"]
 
 @expectedFailureAll(oslist=["windows"], bugnumber="llvm.org/pr24764")
-@expectedFailureAll(oslist=["linux"], archs=["aarch64"], bugnumber="llvm.org/pr37301")
+@expectedFailureAll(oslist=["linux"],
+archs=["aarch64"],
+triple=no_match(".*-android"),
+bugnumber="llvm.org/pr37301")
 def test_without_process(self):
 """Test that static initialized variables can be inspected without
 process."""
Index: lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
===
--- lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
+++ lldb/packages/Python/lldbsuite/test/lang/c/const_variables/TestConstVariables.py
@@ -31,6 +31,7 @@
 archs=[
 'arm',
 'aarch64'],
+triple=no_match(".*-android"),
 bugnumber="llvm.org/pr27883")
 @expectedFailureAll(
 oslist=["windows"],
Index: lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
===
--- lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
+++ lldb/packages/Python/lldbsuite/test/functionalities/watchpoint/watchpoint_events/TestWatchpointEvents.py
@@ -25,6 +25,7 @@
 @expectedFailureAll(
 oslist=["linux"],
 archs=["aarch64"],
+triple=no_match(".*-android"),
 bugnumber="llvm.

[Lldb-commits] [PATCH] D64769: [lldb][test_suite] change the test main.cpp to avoid expression reschedule

2019-07-15 Thread Wanyi Ye via Phabricator via lldb-commits
kusmour created this revision.
kusmour added reviewers: xiaobai, labath.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

Added a local variable to hold the return value to avoid delayed calculation on 
variables
This issue occurred when using NDK 20 clang with `-O0` flag set


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64769

Files:
  lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c


Index: lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
===
--- lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
+++ lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
@@ -20,5 +20,6 @@
 g_common_1 = g_file_global_int / g_file_static_int;
 static const char *g_func_static_cstr = "g_func_static_cstr";
 printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
-return g_file_global_int + g_a + g_common_1 + *g_ptr; // Set break point 
at this line.   break $source:$line; continue; var -global g_a -global 
g_global_int
+int return_val = g_file_global_int + g_a + g_common_1 + *g_ptr;
+return return_val; // Set break point at this line.   break 
$source:$line; continue; var -global g_a -global g_global_int
 }


Index: lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
===
--- lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
+++ lldb/packages/Python/lldbsuite/test/lang/c/global_variables/main.c
@@ -20,5 +20,6 @@
 g_common_1 = g_file_global_int / g_file_static_int;
 static const char *g_func_static_cstr = "g_func_static_cstr";
 printf ("%s %s\n", g_file_global_cstr, g_file_static_cstr);
-return g_file_global_int + g_a + g_common_1 + *g_ptr; // Set break point at this line.   break $source:$line; continue; var -global g_a -global g_global_int
+int return_val = g_file_global_int + g_a + g_common_1 + *g_ptr;
+return return_val; // Set break point at this line.   break $source:$line; continue; var -global g_a -global g_global_int
 }
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D64771: [lldb][test_suite] skip tests of `libstdcpp` on Android and clean up

2019-07-15 Thread Wanyi Ye via Phabricator via lldb-commits
kusmour created this revision.
kusmour added reviewers: xiaobai, labath.
Herald added subscribers: lldb-commits, srhines.
Herald added a project: LLDB.

Delete the android target from `libstdcpp` test category, since android no 
longer support libstdcxx


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64771

Files:
  lldb/packages/Python/lldbsuite/test/dotest.py
  lldb/packages/Python/lldbsuite/test/make/Android.rules


Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -72,24 +72,18 @@
 
 ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
-isystem $(NDK_ROOT)/sysroot/usr/include/$(TOOL_PREFIX) \
-   -D__ANDROID_API__=$(API_LEVEL)
-ARCH_LDFLAGS += 
--sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
+   -D__ANDROID_API__=$(API_LEVEL) \
+   -isystem 
$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH)/usr/include
 
-ifeq (1,$(USE_LIBSTDCPP))
-   ARCH_CFLAGS += \
-   -isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \
-   -isystem 
$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/include \
-   -isystem 
$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
+ARCH_LDFLAGS += 
--sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
 
-   ARCH_LDFLAGS += 
$(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a
-else
-   ARCH_CXXFLAGS += \
-   -isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
-   -isystem $(NDK_ROOT)/sources/android/support/include \
-   -isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
+ARCH_CXXFLAGS += \
+   -isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
+   -isystem $(NDK_ROOT)/sources/android/support/include \
+   -isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
 
-   ARCH_LDFLAGS += \
-   -L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
-   
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
-   -lc++abi
-endif
+ARCH_LDFLAGS += \
+   -L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
+   
$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
+   -lc++abi \
+   -nostdlib++
Index: lldb/packages/Python/lldbsuite/test/dotest.py
===
--- lldb/packages/Python/lldbsuite/test/dotest.py
+++ lldb/packages/Python/lldbsuite/test/dotest.py
@@ -1171,8 +1171,10 @@
 from lldbsuite.test import lldbplatformutil
 
 platform = lldbplatformutil.getPlatform()
+if lldbplatformutil.target_is_android():
+platform = "android"
 if platform == "linux":
-  return True, "libstdcxx always present"
+return True, "libstdcxx always present"
 return False, "Don't know how to build with libstdcxx on %s" % platform
 
 def checkLibstdcxxSupport():


Index: lldb/packages/Python/lldbsuite/test/make/Android.rules
===
--- lldb/packages/Python/lldbsuite/test/make/Android.rules
+++ lldb/packages/Python/lldbsuite/test/make/Android.rules
@@ -72,24 +72,18 @@
 
 ARCH_CFLAGS += --sysroot=$(NDK_ROOT)/sysroot \
 	-isystem $(NDK_ROOT)/sysroot/usr/include/$(TOOL_PREFIX) \
-	-D__ANDROID_API__=$(API_LEVEL)
-ARCH_LDFLAGS += --sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
+	-D__ANDROID_API__=$(API_LEVEL) \
+	-isystem $(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH)/usr/include
 
-ifeq (1,$(USE_LIBSTDCPP))
-	ARCH_CFLAGS += \
-		-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include \
-		-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/include \
-		-isystem $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/include/backward
+ARCH_LDFLAGS += --sysroot=$(NDK_ROOT)/platforms/android-$(API_LEVEL)/arch-$(SYSROOT_ARCH) -lm
 
-	ARCH_LDFLAGS += $(NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.9/libs/$(STL_ARCH)/libgnustl_static.a
-else
-	ARCH_CXXFLAGS += \
-		-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
-		-isystem $(NDK_ROOT)/sources/android/support/include \
-		-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
+ARCH_CXXFLAGS += \
+	-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++/include \
+	-isystem $(NDK_ROOT)/sources/android/support/include \
+	-isystem $(NDK_ROOT)/sources/cxx-stl/llvm-libc++abi/include
 
-	ARCH_LDFLAGS += \
-		-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
-		$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH)/libc++_static.a \
-		-lc++abi
-endif
+ARCH_LDFLAGS += \
+	-L$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/libs/$(STL_ARCH) \
+	$(NDK_ROOT)/sources/cxx-stl/llvm-libc++/lib

[Lldb-commits] [PATCH] D63667: Support __kernel_rt_sigreturn in frame initialization

2019-07-15 Thread Joseph Tremoulet via Phabricator via lldb-commits
JosephTremoulet added a comment.
Herald added subscribers: wuzish, MaskRay.

> That LLDB frame #5 is a bit bogus

Thanks for taking a look at this.  I'm trying to reproduce what you're seeing 
and failing.  This is what I see, in a fedora:latest docker container on an 
Ubuntu host on an x86_64 machine, with my patch applied to lldb:

  $ gcc -g -O0 -o sigtest main.c
  $ lldb ./sigtest
  (lldb) target create "./sigtest"
  Current executable set to './sigtest' (x86_64).
  (lldb) breakpoint set -f main.c -l 6
  Breakpoint 1: where = sigtest`handler + 11 at main.c:7:5, address = 
0x00401171
  (lldb) run
  Process 149148 launched: '/home/josepht/scratch/sigtest' (x86_64)
  Process 149148 stopped
  * thread #1, name = 'sigtest', stop reason = signal SIGABRT
  frame #0: 0x77e38e75 libc.so.6`__GI_raise + 325
  libc.so.6`__GI_raise:
  ->  0x77e38e75 <+325>: movq   0x108(%rsp), %rax
  0x77e38e7d <+333>: xorq   %fs:0x28, %rax
  0x77e38e86 <+342>: jne0x77e38eac; <+380>
  0x77e38e88 <+344>: movl   %r8d, %eax
  (lldb) continue
  Process 149148 resuming
  Process 149148 stopped
  * thread #1, name = 'sigtest', stop reason = breakpoint 1.1
  frame #0: 0x00401171 sigtest`handler(sig=6) at main.c:7:5
 4   
 5void handler(int sig)
 6{
  -> 7printf("Set a breakpoint here.\n");
 8exit(0);
 9}
 10  
  (lldb) bt
  * thread #1, name = 'sigtest', stop reason = breakpoint 1.1
* frame #0: 0x00401171 sigtest`handler(sig=6) at main.c:7:5
  frame #1: 0x77e38f00 libc.so.6`.annobin_sigaction.c + 16
  frame #2: 0x77e38e75 libc.so.6`__GI_raise + 325
  frame #3: 0x77e23895 libc.so.6`__GI_abort + 295
  frame #4: 0x0040118e sigtest`abort_caller at main.c:12:5
  frame #5: 0x004011c2 sigtest`main at main.c:23:5
  frame #6: 0x77e24f33 libc.so.6`__libc_start_main + 243
  frame #7: 0x004010ae sigtest`_start + 46
  (lldb) frame select 2
  frame #2: 0x77e38e75 libc.so.6`__GI_raise + 325
  libc.so.6`__GI_raise:
  ->  0x77e38e75 <+325>: movq   0x108(%rsp), %rax
  0x77e38e7d <+333>: xorq   %fs:0x28, %rax
  0x77e38e86 <+342>: jne0x77e38eac; <+380>
  0x77e38e88 <+344>: movl   %r8d, %eax
  (lldb) frame select 3
  frame #3: 0x77e23895 libc.so.6`__GI_abort + 295
  libc.so.6`__GI_abort:
  ->  0x77e23895 <+295>: movq   %fs:0x10, %rdx
  0x77e2389e <+304>: cmpq   %rdx, 0x19f493(%rip)  ; lock + 8
  0x77e238a5 <+311>: je 0x77e238ed; <+383>
  0x77e238a7 <+313>: movl   $0x1, %esi

My frame 2 seems to correspond to your frame 4, and then my frame 3 seems to 
correspond to your frame 6, without the bogus frame in between.  Do I have the 
wrong repro steps or something?

Thanks,
-Joseph


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63667



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


[Lldb-commits] [PATCH] D63667: Support __kernel_rt_sigreturn in frame initialization

2019-07-15 Thread Joseph Tremoulet via Phabricator via lldb-commits
JosephTremoulet added a subscriber: clayborg.
JosephTremoulet added a comment.

ping @jasonmolenda -- do the updates look like what you had in mind when you 
said " It'd be a good change to capture that information from the eh_frame 
though, even if we don't see a clear way to use it right now"?

Also /cc @clayborg (thanks for the reply on the Dev alias!).  I think your 
suggestion to communicate the info to a new behaves_like_zero flag on 
lldb_private::StackFrame (presumably communicated via GetFrameInfoAtIndex) 
would help for then fixing StackFrame::GetSymbolContext to find the right 
symbol for these frames.  I'm inclined to think that would make the most sense 
as a follow-up change, but lmk if you have thoughts.

I'm also curious what else needs to happen to be ready to merge this.  I've 
tested on Ubuntu and Darwin and now Fedora, but not sure what other platforms 
might have similar holes that this test would then immediately fail on.  If I 
add the changes to connect the 'S' in the augmentation all the way to 
StackFrame::GetSymbolContext, then at least I could make sure the test log in 
the error case would include the name of the function missing from the trap 
handler symbol list, but I don't know if that's sufficiently motivating to roll 
that into this PR or if it's preferable to keep it small...  happy for feedback.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63667



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


[Lldb-commits] [PATCH] D64774: [DebugInfo] Move function from line table to the prologue (NFC)

2019-07-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added reviewers: dblaikie, probinson, wolfgangp.
JDevlieghere added a project: debug-info.
Herald added subscribers: lldb-commits, hiraditya.
Herald added projects: LLDB, LLVM.

In LLDB, when parsing type units, we don't need to parse the whole line table. 
Instead, we only need to parse the //support files// from the line table 
prologue. To make that possible, this patch moves the respective functions from 
the `LineTable` into the `Prologue`. Because I don't think users of the 
`LineTable` should have to know that these files come from the `Prologue`, I've 
left the original methods in place, and made them redirect to the `LineTable`.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64774

Files:
  llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
  llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp

Index: llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
===
--- llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ llvm/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -66,6 +66,26 @@
 
 DWARFDebugLine::Prologue::Prologue() { clear(); }
 
+bool DWARFDebugLine::Prologue::hasFileAtIndex(uint64_t FileIndex) const {
+  uint16_t DwarfVersion = getVersion();
+  assert(DwarfVersion != 0 &&
+ "line table prologue has no dwarf version information");
+  if (DwarfVersion >= 5)
+return FileIndex < FileNames.size();
+  return FileIndex != 0 && FileIndex <= FileNames.size();
+}
+
+const llvm::DWARFDebugLine::FileNameEntry &
+DWARFDebugLine::Prologue::getFileNameEntry(uint64_t Index) const {
+  uint16_t DwarfVersion = getVersion();
+  assert(DwarfVersion != 0 &&
+ "line table prologue has no dwarf version information");
+  // In DWARF v5 the file names are 0-indexed.
+  if (DwarfVersion >= 5)
+return FileNames[Index];
+  return FileNames[Index - 1];
+}
+
 void DWARFDebugLine::Prologue::clear() {
   TotalLength = PrologueLength = 0;
   SegSelectorSize = 0;
@@ -968,30 +988,11 @@
   return true;
 }
 
-bool DWARFDebugLine::LineTable::hasFileAtIndex(uint64_t FileIndex) const {
-  uint16_t DwarfVersion = Prologue.getVersion();
-  assert(DwarfVersion != 0 && "LineTable has no dwarf version information");
-  if (DwarfVersion >= 5)
-return FileIndex < Prologue.FileNames.size();
-  return FileIndex != 0 && FileIndex <= Prologue.FileNames.size();
-}
-
-const llvm::DWARFDebugLine::FileNameEntry &
-DWARFDebugLine::LineTable::getFileNameEntry(uint64_t Index) const {
-  uint16_t DwarfVersion = Prologue.getVersion();
-  assert(DwarfVersion != 0 && "LineTable has no dwarf version information");
-  // In DWARF v5 the file names are 0-indexed.
-  if (DwarfVersion >= 5)
-return Prologue.FileNames[Index];
-  else
-return Prologue.FileNames[Index - 1];
-}
-
 Optional DWARFDebugLine::LineTable::getSourceByIndex(uint64_t FileIndex,
 FileLineInfoKind Kind) const {
-  if (Kind == FileLineInfoKind::None || !hasFileAtIndex(FileIndex))
+  if (Kind == FileLineInfoKind::None || !Prologue.hasFileAtIndex(FileIndex))
 return None;
-  const FileNameEntry &Entry = getFileNameEntry(FileIndex);
+  const FileNameEntry &Entry = Prologue.getFileNameEntry(FileIndex);
   if (Optional source = Entry.Source.getAsCString())
 return StringRef(*source);
   return None;
@@ -1005,10 +1006,10 @@
  sys::path::is_absolute(Path, sys::path::Style::windows);
 }
 
-bool DWARFDebugLine::LineTable::getFileNameByIndex(uint64_t FileIndex,
-   const char *CompDir,
-   FileLineInfoKind Kind,
-   std::string &Result) const {
+bool DWARFDebugLine::Prologue::getFileNameByIndex(uint64_t FileIndex,
+  StringRef CompDir,
+  FileLineInfoKind Kind,
+  std::string &Result) const {
   if (Kind == FileLineInfoKind::None || !hasFileAtIndex(FileIndex))
 return false;
   const FileNameEntry &Entry = getFileNameEntry(FileIndex);
@@ -1022,20 +1023,18 @@
   SmallString<16> FilePath;
   StringRef IncludeDir;
   // Be defensive about the contents of Entry.
-  if (Prologue.getVersion() >= 5) {
-if (Entry.DirIdx < Prologue.IncludeDirectories.size())
-  IncludeDir =
-  Prologue.IncludeDirectories[Entry.DirIdx].getAsCString().getValue();
+  if (getVersion() >= 5) {
+if (Entry.DirIdx < IncludeDirectories.size())
+  IncludeDir = IncludeDirectories[Entry.DirIdx].getAsCString().getValue();
   } else {
-if (0 < Entry.DirIdx && Entry.DirIdx <= Prologue.IncludeDirectories.size())
-  IncludeDir = Prologue.IncludeDirectories[Entry.DirIdx - 1]
-   .getAsCString()
-   .getValue();
+if (0 < Entry.DirIdx && Entry.DirIdx <= IncludeDirectories.size()

[Lldb-commits] [PATCH] D63667: Support __kernel_rt_sigreturn in frame initialization

2019-07-15 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

In D63667#1558027 , @JosephTremoulet 
wrote:

> I've updated this with code to recognize the 'S' in the eh_frame augmentation 
> and record it in a new bool member of UnwindPlan, 
> `m_plan_is_for_signal_trap`.  I haven't hooked up any consumers of the new 
> bit; as you say, with the current code flow we don't parse the eh_frame info 
> until after we've decided whether the current frame is a trap handler frame 
> or not.
>
> I took a look at `behaves_like_zeroth_frame`.  In my case, we're not getting 
> to the point of consulting it, because before checking it, if we are 
> processing a trap handler frame or if AlwaysRelyOnEHInfo returns true (both 
> of which are true in my case), we use the EH Frame unwind plan if it is valid 
> at the current address, and that valid at current address check is already 
> passing.  I'm somewhat reluctant to fiddle with the behaves_like_zeroth_frame 
> bit speculatively.  Note that with this change, it will get set for the next 
> frame above __kernel_rt_sigreturn (because the current test checks if the 
> next-lower frame is an eTrapHandler frame), which I think is where we want 
> the async processing.


Just just to check, we've got a backtrace like

#0  trap_handler_function_in_my_program
#1 __kernel_rt_sigreturn
#2 function_that_was_interrupted_asynchonrously
#3 main

The eh_frame for #1 has the S bit, and we've hard-coded the name of the 
function as a known asynchronous signal handler.  When we're choosing an unwind 
plan for frame #2, or symbolicating the address, we need to treat this as a 
"behaves like zeroth frame" function - it could be on the first instruction, so 
backing the pc up by one would put us in the wrong function scope.

> I see that we also do this "subtract 1 from the pc" thing in 
> StackFrame::GetSymbolContext, and I believe this is why even with my change 
> here I'm seeing the wrong function name in backtraces (e.g., in the new test, 
> it shows "abort_caller -> [function that happened to precede 
> __kernel_rt_sigreturn] -> handler" rather than "abort_caller -> 
> kernel_rt_sigreturn -> handler").  I'm not sure how best to address that, 
> since the base StackFrame and RegisterContext classes don't have this notion 
> of "frame type" / "trap handler frame" that the "-LLDB" subclasses have -- 
> seems like we'd need to have GetFrameInfoAtIndex have another out parameter 
> to specify frame type, and UnwindLLDB's implementation could then pull it 
> from the RegisterContextLLDB -- would that be a good change?  I don't 
> actually need that for my current use case, the "wrong" name in the backtrace 
> is fine...

I think Unwind::GetFrameInfoAtIndex can take a new output argument, bool 
behaves_like_zeroth_frame.  It would be set to true if idx == 0 or if 
m_frames[idx - 1].IsTrapHandlerFrame() is true.

StackFrame.h would pick up a new ivar m_behaves_like_zeroth_frame and accessor 
method BehavesLikeZerothFrame().

StackFrameList::GetFramesUpTo will fetch the value via 
unwinder->GetFrameInfoAtIndex() and pass it as an argument to the 
StackFrame::StackFrame ctor.

Then in StackFrame::GetSymbolContext we can use the m_behaves_like_zeroth_frame 
to fix the symbol lookup logic.

I'm not wedded to the behaves_like_zeroth_frame nomenclature.  But I think this 
approach makes sense.

> Thanks for the notes on the asynchronous cases.  I'd certainly be interested 
> in getting those to work, though I haven't sorted out from where the unwinder 
> can find the above-trap frame's register values (happy for pointers here!).  
> I think I'm running into what this comment from GetFullUnwindPlanForFrame 
> describes:
> 
>   // If we're in _sigtramp(), unwinding past this frame requires special
>   // knowledge.  On Mac OS X this knowledge is properly encoded in the 
> eh_frame
>   // section, so prefer that if available. On other platforms we may need to
>   // provide a platform-specific UnwindPlan which encodes the details of how 
> to
>   // unwind out of sigtramp.
>
> 
> I'd like to get the synchronous case support working as a first step 
> regardless.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63667



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


[Lldb-commits] [PATCH] D63667: Support __kernel_rt_sigreturn in frame initialization

2019-07-15 Thread Jason Molenda via Phabricator via lldb-commits
jasonmolenda added a comment.

Ah, regarding the S bit, looks good to me.  I think I misunderstood the 
original problem you were working on.  On Darwin systems, we have our friend 
__sigtramp.  When an async interrupt is received, the kernel saves the register 
context to stack and then calls __sigtramp which does some instructions and 
then calls the trap handler function.  Backing up the pc by 1 for __sigtramp is 
fine, because it did a normal CALL instruction to the trap handler.

I'm guessing on this Linux system, you've got a trap receiver function on the 
stack that is on its first instruction or something?  So backing up the pc 
value for *that* frame is the problem you're solving.

Then there's the issue of backing up the pc by 1 for the frame that was 
asynchronously interrupted - a separate issue altogether.

Anyway this looks fine to me.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63667



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


[Lldb-commits] [PATCH] D64777: Fix CreateFunctionTemplateSpecialization to prevent dangling poiner to stack memory

2019-07-15 Thread Shafik Yaghmour via Phabricator via lldb-commits
shafik created this revision.
shafik added a reviewer: teemperor.

In `ClangASTContext::CreateFunctionTemplateSpecializationInfo` a 
`TemplateArgumentList` is allocated on the stack but is treated as if it is 
persistent in subsequent calls. When we exit the function `func_decl` will 
still point to the stack allocated memory. We will use 
`TemplateArgumentList::CreateCopy` instead which will allocate memory out of 
the DeclContext.


https://reviews.llvm.org/D64777

Files:
  
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/Makefile
  
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/TestFunctionTemplateSpecializationTempArgs.py
  
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/main.cpp
  source/Symbol/ClangASTContext.cpp


Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -1615,10 +1615,11 @@
 void ClangASTContext::CreateFunctionTemplateSpecializationInfo(
 FunctionDecl *func_decl, clang::FunctionTemplateDecl *func_tmpl_decl,
 const TemplateParameterInfos &infos) {
-  TemplateArgumentList template_args(TemplateArgumentList::OnStack, 
infos.args);
+  TemplateArgumentList *template_args_ptr =
+  TemplateArgumentList::CreateCopy(func_decl->getASTContext(), infos.args);
 
-  func_decl->setFunctionTemplateSpecialization(func_tmpl_decl, &template_args,
-   nullptr);
+  func_decl->setFunctionTemplateSpecialization(func_tmpl_decl,
+   template_args_ptr, nullptr);
 }
 
 ClassTemplateDecl *ClangASTContext::CreateClassTemplateDecl(
Index: 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/main.cpp
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/main.cpp
@@ -0,0 +1,20 @@
+template 
+struct M {};
+
+template 
+void f(T &t);
+
+template <>
+void f( int &t ) {
+  typedef M VType;
+
+  VType p0;  // break here
+}
+
+int main() {
+  int x;
+
+  f(x);
+
+  return 0;
+}
Index: 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/TestFunctionTemplateSpecializationTempArgs.py
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/TestFunctionTemplateSpecializationTempArgs.py
@@ -0,0 +1,17 @@
+import lldb
+from lldbsuite.test.decorators import *
+from lldbsuite.test.lldbtest import *
+from lldbsuite.test import lldbutil
+
+class TestFunctionTemplateSpecializationTempArgs(TestBase):
+
+mydir = TestBase.compute_mydir(__file__)
+
+def test_function_template_specialization_temp_args(self):
+self.build()
+
+(self.target, self.process, _, bkpt) = 
lldbutil.run_to_source_breakpoint(self, '// break here',
+lldb.SBFileSpec("main.cpp", False))
+
+self.expect("expr p0",
+substrs=['(VType) $0 = {}'])
Index: 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/Makefile
===
--- /dev/null
+++ 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/Makefile
@@ -0,0 +1,5 @@
+LEVEL = ../../make
+
+CXX_SOURCES := main.cpp
+
+include $(LEVEL)/Makefile.rules


Index: source/Symbol/ClangASTContext.cpp
===
--- source/Symbol/ClangASTContext.cpp
+++ source/Symbol/ClangASTContext.cpp
@@ -1615,10 +1615,11 @@
 void ClangASTContext::CreateFunctionTemplateSpecializationInfo(
 FunctionDecl *func_decl, clang::FunctionTemplateDecl *func_tmpl_decl,
 const TemplateParameterInfos &infos) {
-  TemplateArgumentList template_args(TemplateArgumentList::OnStack, infos.args);
+  TemplateArgumentList *template_args_ptr =
+  TemplateArgumentList::CreateCopy(func_decl->getASTContext(), infos.args);
 
-  func_decl->setFunctionTemplateSpecialization(func_tmpl_decl, &template_args,
-   nullptr);
+  func_decl->setFunctionTemplateSpecialization(func_tmpl_decl,
+   template_args_ptr, nullptr);
 }
 
 ClassTemplateDecl *ClangASTContext::CreateClassTemplateDecl(
Index: packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/main.cpp
===
--- /dev/null
+++ packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/main.cpp
@@ -0,0 +1,20 @@
+template 
+struct M {};
+
+template 
+void f(

[Lldb-commits] [lldb] r366148 - [LanguageRuntime] Move ObjCLanguageRuntime into a plugin

2019-07-15 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Mon Jul 15 15:56:12 2019
New Revision: 366148

URL: http://llvm.org/viewvc/llvm-project?rev=366148&view=rev
Log:
[LanguageRuntime] Move ObjCLanguageRuntime into a plugin

Summary:
Following up to my CPPLanguageRuntime change, I'm moving
ObjCLanguageRuntime into a plugin as well.

Reviewers: JDevlieghere, compnerd, jingham, clayborg

Subscribers: mgorny, arphaman, lldb-commits

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

Added:
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
  - copied, changed from r365991, 
lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
  - copied, changed from r365991, 
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
Removed:
lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
lldb/trunk/source/Target/ObjCLanguageRuntime.cpp
Modified:
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp

lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
lldb/trunk/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h
lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
lldb/trunk/source/Plugins/Language/ObjC/NSString.h
lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h

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

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h

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

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

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

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h

lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
lldb/trunk/source/Symbol/CMakeLists.txt
lldb/trunk/source/Symbol/ClangASTContext.cpp
lldb/trunk/source/Target/CMakeLists.txt

Removed: lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h?rev=366147&view=auto
==
--- lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (original)
+++ lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h (removed)
@@ -1,429 +0,0 @@
-//===-- ObjCLanguageRuntime.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_ObjCLanguageRuntime_h_
-#define liblldb_ObjCLanguageRuntime_h_
-
-#include 
-#include 
-#include 
-#include 
-
-#include "llvm/Support/Casting.h"
-
-#include "lldb/Breakpoint/BreakpointPrecondition.h"
-#include "lldb/Core/PluginInterface.h"
-#include "lldb/Core/ThreadSafeDenseMap.h"
-#include "lldb/Symbol/CompilerType.h"
-#include "lldb/Symbol/Type.h"
-#include "lldb/Target/LanguageRuntime.h"
-#include "lldb/lldb-private.h"
-
-class CommandObjectObjC_ClassTable_Dump;
-
-namespace lldb_private {
-
-class UtilityFunction;
-
-class ObjCLanguageRuntime : public LanguageRuntime {
-public:
-  enum class ObjCRuntimeVersions {
-eObjC_VersionUnknown = 0,
-eAppleObjC_V1 = 1,
-eAppleObjC_V2 = 2
-  };
-
-  typedef lldb::addr_t ObjCISA;
-
-  class ClassDescriptor;
-  typedef std::shared_ptr ClassDescriptorSP;
-
-  // the information that we want to support retrieving from an ObjC class this
-  // needs to be pure virtual since there are at least 2 different
-  // implementations of the runtime, and more migh

[Lldb-commits] [PATCH] D64763: [LanguageRuntime] Move ObjCLanguageRuntime into a plugin

2019-07-15 Thread Alex Langford via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366148: [LanguageRuntime] Move ObjCLanguageRuntime into a 
plugin (authored by xiaobai, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64763?vs=209921&id=209983#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64763

Files:
  lldb/trunk/include/lldb/Target/ObjCLanguageRuntime.h
  lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderDarwin.cpp
  
lldb/trunk/source/Plugins/DynamicLoader/MacOSX-DYLD/DynamicLoaderMacOSXDYLD.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangASTSource.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionParser.cpp
  lldb/trunk/source/Plugins/ExpressionParser/Clang/IRDynamicChecks.cpp
  lldb/trunk/source/Plugins/Language/ObjC/CF.cpp
  lldb/trunk/source/Plugins/Language/ObjC/Cocoa.cpp
  lldb/trunk/source/Plugins/Language/ObjC/Cocoa.h
  lldb/trunk/source/Plugins/Language/ObjC/NSArray.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSDictionary.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSError.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSException.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSIndexPath.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSSet.cpp
  lldb/trunk/source/Plugins/Language/ObjC/NSString.h
  lldb/trunk/source/Plugins/Language/ObjC/ObjCLanguage.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCClassDescriptorV2.h
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCDeclVendor.h
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntime.h
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV1.h
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCRuntimeV2.h
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTrampolineHandler.cpp
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleObjCTypeEncodingParser.h
  
lldb/trunk/source/Plugins/LanguageRuntime/ObjC/AppleObjCRuntime/AppleThreadPlanStepThroughObjCTrampoline.cpp
  lldb/trunk/source/Plugins/LanguageRuntime/ObjC/CMakeLists.txt
  lldb/trunk/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.cpp
  lldb/trunk/source/Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h
  lldb/trunk/source/Symbol/CMakeLists.txt
  lldb/trunk/source/Symbol/ClangASTContext.cpp
  lldb/trunk/source/Target/CMakeLists.txt
  lldb/trunk/source/Target/ObjCLanguageRuntime.cpp

Index: lldb/trunk/source/Target/CMakeLists.txt
===
--- lldb/trunk/source/Target/CMakeLists.txt
+++ lldb/trunk/source/Target/CMakeLists.txt
@@ -10,7 +10,6 @@
   Memory.cpp
   MemoryHistory.cpp
   ModuleCache.cpp
-  ObjCLanguageRuntime.cpp
   OperatingSystem.cpp
   PathMappingList.cpp
   Platform.cpp
Index: lldb/trunk/source/Symbol/ClangASTContext.cpp
===
--- lldb/trunk/source/Symbol/ClangASTContext.cpp
+++ lldb/trunk/source/Symbol/ClangASTContext.cpp
@@ -86,7 +86,6 @@
 #include "lldb/Symbol/VerifyDecl.h"
 #include "lldb/Target/ExecutionContext.h"
 #include "lldb/Target/Language.h"
-#include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/Target.h"
 #include "lldb/Utility/DataExtractor.h"
@@ -95,6 +94,7 @@
 #include "lldb/Utility/RegularExpression.h"
 #include "lldb/Utility/Scalar.h"
 
+#include "Plugins/LanguageRuntime/ObjC/ObjCLanguageRuntime.h"
 #include "Plugins/SymbolFile/DWARF/DWARFASTParserClang.h"
 #include "Plugins/SymbolFile/PDB/PDBASTParser.h"
 
Index: lldb/trunk/source/Symbol/CMakeLists.txt
===
--- lldb/trunk/source/Symbol/CMakeLists.txt
+++ lldb/trunk/source/Symbol/CMakeLists.txt
@@ -59,6 +59,7 @@
 lldbPluginSymbolFileDWARF
 lldbPluginSymbolFilePDB
 lldbPluginObjCLanguage
+lldbPluginObjCRuntime
 
   LINK_COMPONENTS
 Support
Index: lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
===
--- lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
+++ lldb/trunk/source/Plugins/ExpressionParser/Clang/ClangExpressionDeclMap.cpp
@@ -33,7 +33,6 @@
 #include "lldb/Symbol/Variable.h"
 #include "lldb/Symbol/VariableList.h"
 #include "lldb/Target/ExecutionContext.h"
-#include "lldb/Target/ObjCLanguageRuntime.h"
 #include "lldb/Target/Process.h"
 #include "lldb/Target/RegisterContext.h"
 

[Lldb-commits] [PATCH] D64777: Fix CreateFunctionTemplateSpecialization to prevent dangling poiner to stack memory

2019-07-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added inline comments.



Comment at: 
packages/Python/lldbsuite/test/expression_command/function_template_specialization_temp_args/main.cpp:1
+template 
+struct M {};

Clang format?



Comment at: source/Symbol/ClangASTContext.cpp:1619
+  TemplateArgumentList *template_args_ptr =
+  TemplateArgumentList::CreateCopy(func_decl->getASTContext(), infos.args);
 

Out of curiosity, who does the cleanup of this pointer? 


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

https://reviews.llvm.org/D64777



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


[Lldb-commits] [lldb] r366156 - Update some file changes, but there's a dependency loop so

2019-07-15 Thread Jason Molenda via lldb-commits
Author: jmolenda
Date: Mon Jul 15 16:55:22 2019
New Revision: 366156

URL: http://llvm.org/viewvc/llvm-project?rev=366156&view=rev
Log:
Update some file changes, but there's a dependency loop so
it doesn't quite work rigtht now.

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

Modified: lldb/trunk/lldb.xcodeproj/project.pbxproj
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/lldb.xcodeproj/project.pbxproj?rev=366156&r1=366155&r2=366156&view=diff
==
--- lldb/trunk/lldb.xcodeproj/project.pbxproj (original)
+++ lldb/trunk/lldb.xcodeproj/project.pbxproj Mon Jul 15 16:55:22 2019
@@ -162,7 +162,7 @@
2689007913353E1A00698AC0 /* CFCMutableDictionary.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 26BC7EF310F1B8AD00F91463 /* 
CFCMutableDictionary.cpp */; };
2689007A13353E1A00698AC0 /* CFCMutableSet.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 26BC7EF510F1B8AD00F91463 /* CFCMutableSet.cpp 
*/; };
2689007B13353E1A00698AC0 /* CFCString.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 26BC7EF810F1B8AD00F91463 /* CFCString.cpp */; };
-   268900E913353E6F00698AC0 /* CPPLanguageRuntime.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 4CB443BC1249920C00C13DC2 /* 
CPPLanguageRuntime.cpp */; };
+   AF9E360C22DD3BFC000B7776 /* CPPLanguageRuntime.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = AF9E360B22DD3BFB000B7776 /* 
CPPLanguageRuntime.cpp */; };
94B6385D1B8FB178004FE1E4 /* CPlusPlusLanguage.cpp in Sources */ 
= {isa = PBXBuildFile; fileRef = 94B6385B1B8FB174004FE1E4 /* 
CPlusPlusLanguage.cpp */; };
23CB15341D66DA9300EDDDE1 /* CPlusPlusLanguageTest.cpp in 
Sources */ = {isa = PBXBuildFile; fileRef = 23CB14FA1D66CCF100EDDDE1 /* 
CPlusPlusLanguageTest.cpp */; };
49F811F31E931B2100F4E163 /* CPlusPlusNameParser.cpp in Sources 
*/ = {isa = PBXBuildFile; fileRef = 49F811EF1E931B1500F4E163 /* 
CPlusPlusNameParser.cpp */; };
@@ -379,7 +379,6 @@
260A63191861009E00FECF8E /* IOHandler.cpp in Sources */ = {isa 
= PBXBuildFile; fileRef = 260A63181861009E00FECF8E /* IOHandler.cpp */; };
260A63171861008E00FECF8E /* IOHandler.h in Headers */ = {isa = 
PBXBuildFile; fileRef = 260A63161861008E00FECF8E /* IOHandler.h */; };
236124A41986B4E2004EFC37 /* IOObject.cpp in Sources */ = {isa = 
PBXBuildFile; fileRef = 236124A21986B4E2004EFC37 /* IOObject.cpp */; };
-   2689006A13353E0E00698AC0 /* IRDynamicChecks.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49CF9829122C70BD007A0B96 /* IRDynamicChecks.cpp 
*/; };
2689006D13353E0E00698AC0 /* IRExecutionUnit.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 4C98D3DB118FB96F00E575D0 /* IRExecutionUnit.cpp 
*/; };
2689006B13353E0E00698AC0 /* IRForTarget.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 49307AAD11DEA4D90081F992 /* IRForTarget.cpp */; 
};
49A71FE7141FFA5C00D59478 /* IRInterpreter.cpp in Sources */ = 
{isa = PBXBuildFile; fileRef = 496B01581406DE8900F830D5 /* IRInterpreter.cpp 
*/; };
@@ -1563,8 +1562,7 @@
26792617211CA3E100EE1D10 /* CMakeLists.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = 
CMakeLists.txt; path = "tools/lldb-vscode/CMakeLists.txt"; sourceTree = 
""; };
9A1890311F47D5D400394BCA /* CMakeLists.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = 
CMakeLists.txt; path = TestingSupport/CMakeLists.txt; sourceTree = ""; };
AF352EDD22C17BD700D058B6 /* CMakeLists.txt */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = 
CMakeLists.txt; sourceTree = ""; };
-   4CB443BC1249920C00C13DC2 /* CPPLanguageRuntime.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
name = CPPLanguageRuntime.cpp; path = source/Target/CPPLanguageRuntime.cpp; 
sourceTree = ""; };
-   4CB443BB1249920C00C13DC2 /* CPPLanguageRuntime.h */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = 
CPPLanguageRuntime.h; path = include/lldb/Target/CPPLanguageRuntime.h; 
sourceTree = ""; };
+   AF9E360B22DD3BFB000B7776 /* CPPLanguageRuntime.cpp */ = {isa = 
PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; 
path = CPPLanguageRuntime.cpp; sourceTree = ""; };
94B6385B1B8FB174004FE1E4 /* CPlusPlusLanguage.cpp */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.cpp.cpp; name = 
CPlusPlusLanguage.cpp; path = Language/CPlusPlus/CPlusPlusLanguage.cpp; 
sourceTree = ""; };
94B6385C1B8FB174004FE1E4 /* CPlusPlusLanguage.h */ = {isa = 
PBXFileReference; lastKnownFileType = sourcecode.c.h; name = 
CPlusPlusLanguage.h; path = Language/CPlusPlus/CPlusPlusLanguage.h; s

[Lldb-commits] [PATCH] D64774: [DebugInfo] Move function from line table to the prologue (NFC)

2019-07-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366158: [DebugInfo] Move function from line table to the 
prologue (NFC) (authored by JDevlieghere, committed by ).

Changed prior to commit:
  https://reviews.llvm.org/D64774?vs=209961&id=210001#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64774

Files:
  llvm/trunk/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h
  llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLine.cpp

Index: llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
===
--- llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
+++ llvm/trunk/lib/DebugInfo/DWARF/DWARFDebugLine.cpp
@@ -66,6 +66,26 @@
 
 DWARFDebugLine::Prologue::Prologue() { clear(); }
 
+bool DWARFDebugLine::Prologue::hasFileAtIndex(uint64_t FileIndex) const {
+  uint16_t DwarfVersion = getVersion();
+  assert(DwarfVersion != 0 &&
+ "line table prologue has no dwarf version information");
+  if (DwarfVersion >= 5)
+return FileIndex < FileNames.size();
+  return FileIndex != 0 && FileIndex <= FileNames.size();
+}
+
+const llvm::DWARFDebugLine::FileNameEntry &
+DWARFDebugLine::Prologue::getFileNameEntry(uint64_t Index) const {
+  uint16_t DwarfVersion = getVersion();
+  assert(DwarfVersion != 0 &&
+ "line table prologue has no dwarf version information");
+  // In DWARF v5 the file names are 0-indexed.
+  if (DwarfVersion >= 5)
+return FileNames[Index];
+  return FileNames[Index - 1];
+}
+
 void DWARFDebugLine::Prologue::clear() {
   TotalLength = PrologueLength = 0;
   SegSelectorSize = 0;
@@ -968,30 +988,11 @@
   return true;
 }
 
-bool DWARFDebugLine::LineTable::hasFileAtIndex(uint64_t FileIndex) const {
-  uint16_t DwarfVersion = Prologue.getVersion();
-  assert(DwarfVersion != 0 && "LineTable has no dwarf version information");
-  if (DwarfVersion >= 5)
-return FileIndex < Prologue.FileNames.size();
-  return FileIndex != 0 && FileIndex <= Prologue.FileNames.size();
-}
-
-const llvm::DWARFDebugLine::FileNameEntry &
-DWARFDebugLine::LineTable::getFileNameEntry(uint64_t Index) const {
-  uint16_t DwarfVersion = Prologue.getVersion();
-  assert(DwarfVersion != 0 && "LineTable has no dwarf version information");
-  // In DWARF v5 the file names are 0-indexed.
-  if (DwarfVersion >= 5)
-return Prologue.FileNames[Index];
-  else
-return Prologue.FileNames[Index - 1];
-}
-
 Optional DWARFDebugLine::LineTable::getSourceByIndex(uint64_t FileIndex,
 FileLineInfoKind Kind) const {
-  if (Kind == FileLineInfoKind::None || !hasFileAtIndex(FileIndex))
+  if (Kind == FileLineInfoKind::None || !Prologue.hasFileAtIndex(FileIndex))
 return None;
-  const FileNameEntry &Entry = getFileNameEntry(FileIndex);
+  const FileNameEntry &Entry = Prologue.getFileNameEntry(FileIndex);
   if (Optional source = Entry.Source.getAsCString())
 return StringRef(*source);
   return None;
@@ -1005,10 +1006,10 @@
  sys::path::is_absolute(Path, sys::path::Style::windows);
 }
 
-bool DWARFDebugLine::LineTable::getFileNameByIndex(uint64_t FileIndex,
-   const char *CompDir,
-   FileLineInfoKind Kind,
-   std::string &Result) const {
+bool DWARFDebugLine::Prologue::getFileNameByIndex(uint64_t FileIndex,
+  StringRef CompDir,
+  FileLineInfoKind Kind,
+  std::string &Result) const {
   if (Kind == FileLineInfoKind::None || !hasFileAtIndex(FileIndex))
 return false;
   const FileNameEntry &Entry = getFileNameEntry(FileIndex);
@@ -1022,20 +1023,18 @@
   SmallString<16> FilePath;
   StringRef IncludeDir;
   // Be defensive about the contents of Entry.
-  if (Prologue.getVersion() >= 5) {
-if (Entry.DirIdx < Prologue.IncludeDirectories.size())
-  IncludeDir =
-  Prologue.IncludeDirectories[Entry.DirIdx].getAsCString().getValue();
+  if (getVersion() >= 5) {
+if (Entry.DirIdx < IncludeDirectories.size())
+  IncludeDir = IncludeDirectories[Entry.DirIdx].getAsCString().getValue();
   } else {
-if (0 < Entry.DirIdx && Entry.DirIdx <= Prologue.IncludeDirectories.size())
-  IncludeDir = Prologue.IncludeDirectories[Entry.DirIdx - 1]
-   .getAsCString()
-   .getValue();
+if (0 < Entry.DirIdx && Entry.DirIdx <= IncludeDirectories.size())
+  IncludeDir =
+  IncludeDirectories[Entry.DirIdx - 1].getAsCString().getValue();
 
 // We may still need to append compilation directory of compile unit.
 // We know that FileName is not absolute, the only way to have an
 // absolute path at this point would be if IncludeDir is abs

[Lldb-commits] [PATCH] D64782: [SWIG] Deprecate SWIG 1.x

2019-07-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere created this revision.
JDevlieghere added a reviewer: LLDB.
Herald added a subscriber: mgorny.
Herald added a project: LLDB.

The last swig 1.x release dates from 2009, now 10 years ago. Recently I fixed 
an issue that prevented us from using swig 4 (rL364974 
), which apparently was not backward 
compatible with swig 1.x (rL365718 ). Rather 
that introducing the workaround for all the properties, I propose to deprecate 
this (really old) version.


Repository:
  rLLDB LLDB

https://reviews.llvm.org/D64782

Files:
  lldb/scripts/CMakeLists.txt


Index: lldb/scripts/CMakeLists.txt
===
--- lldb/scripts/CMakeLists.txt
+++ lldb/scripts/CMakeLists.txt
@@ -14,6 +14,11 @@
 endif()
 
 find_package(SWIG REQUIRED)
+set(SWIG_MIN_VERSION "2.0.0")
+if (${SWIG_VERSION} VERSION_LESS ${SWIG_MIN_VERSION})
+  message(FATAL_ERROR "LLDB requires swig ${SWIG_MIN_VERSION}, your version is 
${SWIG_VERSION}.")
+endif()
+
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py


Index: lldb/scripts/CMakeLists.txt
===
--- lldb/scripts/CMakeLists.txt
+++ lldb/scripts/CMakeLists.txt
@@ -14,6 +14,11 @@
 endif()
 
 find_package(SWIG REQUIRED)
+set(SWIG_MIN_VERSION "2.0.0")
+if (${SWIG_VERSION} VERSION_LESS ${SWIG_MIN_VERSION})
+  message(FATAL_ERROR "LLDB requires swig ${SWIG_MIN_VERSION}, your version is ${SWIG_VERSION}.")
+endif()
+
 add_custom_command(
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/LLDBWrapPython.cpp
   OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/lldb.py
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits


[Lldb-commits] [PATCH] D64774: [DebugInfo] Move function from line table to the prologue (NFC)

2019-07-15 Thread Petr Hosek via Phabricator via lldb-commits
phosek added a comment.

This change broke lld:

  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion 
function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
it->second.file, nullptr,
 ^~~
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1637:21: note: in 
instantiation of member function 
'lld::elf::ObjFile 
>::getVariableLoc' requested here
  template class elf::ObjFile;
  ^
  /b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 
'StringRef' has been explicitly marked deleted here
  StringRef(std::nullptr_t) = delete;
  ^
  
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59:
 note: passing argument to parameter 'CompDir' here
  bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
^
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion 
function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
it->second.file, nullptr,
 ^~~
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1638:21: note: in 
instantiation of member function 
'lld::elf::ObjFile 
>::getVariableLoc' requested here
  template class elf::ObjFile;
  ^
  /b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 
'StringRef' has been explicitly marked deleted here
  StringRef(std::nullptr_t) = delete;
  ^
  
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59:
 note: passing argument to parameter 'CompDir' here
  bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
^
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion 
function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
it->second.file, nullptr,
 ^~~
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1639:21: note: in 
instantiation of member function 
'lld::elf::ObjFile 
>::getVariableLoc' requested here
  template class elf::ObjFile;
  ^
  /b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 
'StringRef' has been explicitly marked deleted here
  StringRef(std::nullptr_t) = delete;
  ^
  
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59:
 note: passing argument to parameter 'CompDir' here
  bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
^
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:323:28: error: conversion 
function from 'nullptr_t' to 'llvm::StringRef' invokes a deleted function
it->second.file, nullptr,
 ^~~
  /b/s/w/ir/k/llvm-project/lld/ELF/InputFiles.cpp:1640:21: note: in 
instantiation of member function 
'lld::elf::ObjFile 
>::getVariableLoc' requested here
  template class elf::ObjFile;
  ^
  /b/s/w/ir/k/llvm-project/llvm/include/llvm/ADT/StringRef.h:79:5: note: 
'StringRef' has been explicitly marked deleted here
  StringRef(std::nullptr_t) = delete;
  ^
  
/b/s/w/ir/k/llvm-project/llvm/include/llvm/DebugInfo/DWARF/DWARFDebugLine.h:263:59:
 note: passing argument to parameter 'CompDir' here
  bool getFileNameByIndex(uint64_t FileIndex, StringRef CompDir,
^
  4 errors generated.


Repository:
  rL LLVM

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

https://reviews.llvm.org/D64774



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


[Lldb-commits] [lldb] r366161 - [Target] Remove unused method Target::GetDefaultClangModuleSearchPaths

2019-07-15 Thread Alex Langford via lldb-commits
Author: xiaobai
Date: Mon Jul 15 18:02:32 2019
New Revision: 366161

URL: http://llvm.org/viewvc/llvm-project?rev=366161&view=rev
Log:
[Target] Remove unused method Target::GetDefaultClangModuleSearchPaths

Modified:
lldb/trunk/include/lldb/Target/Target.h
lldb/trunk/source/Target/Target.cpp

Modified: lldb/trunk/include/lldb/Target/Target.h
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Target/Target.h?rev=366161&r1=366160&r2=366161&view=diff
==
--- lldb/trunk/include/lldb/Target/Target.h (original)
+++ lldb/trunk/include/lldb/Target/Target.h Mon Jul 15 18:02:32 2019
@@ -491,8 +491,6 @@ public:
 
   static FileSpecList GetDefaultDebugFileSearchPaths();
 
-  static FileSpecList GetDefaultClangModuleSearchPaths();
-
   static ArchSpec GetDefaultArchitecture();
 
   static void SetDefaultArchitecture(const ArchSpec &arch);

Modified: lldb/trunk/source/Target/Target.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/Target.cpp?rev=366161&r1=366160&r2=366161&view=diff
==
--- lldb/trunk/source/Target/Target.cpp (original)
+++ lldb/trunk/source/Target/Target.cpp Mon Jul 15 18:02:32 2019
@@ -2330,13 +2330,6 @@ FileSpecList Target::GetDefaultDebugFile
   return FileSpecList();
 }
 
-FileSpecList Target::GetDefaultClangModuleSearchPaths() {
-  TargetPropertiesSP properties_sp(Target::GetGlobalProperties());
-  if (properties_sp)
-return properties_sp->GetClangModuleSearchPaths();
-  return FileSpecList();
-}
-
 ArchSpec Target::GetDefaultArchitecture() {
   TargetPropertiesSP properties_sp(Target::GetGlobalProperties());
   if (properties_sp)


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


[Lldb-commits] [PATCH] D64782: [SWIG] Deprecate SWIG 1.x

2019-07-15 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. Thanks. I fear this might break some bots, but the best way to see if 
that's the case is trying.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64782



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


[Lldb-commits] [PATCH] D64782: [SWIG] Deprecate SWIG 1.x

2019-07-15 Thread Jonas Devlieghere via Phabricator via lldb-commits
JDevlieghere added a comment.

In D64782#1586802 , @davide wrote:

> LGTM. Thanks. I fear this might break some bots, but the best way to see if 
> that's the case is trying.


I've updated swig on GreenDragon, and the Windows bot is running 3.0. I'm not 
sure about the Debian bot, as it's incremental it doesn't print the version 
number. Regardless, I'll keep an eye on the bots of course.


Repository:
  rLLDB LLDB

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

https://reviews.llvm.org/D64782



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


[Lldb-commits] [PATCH] D63667: Support __kernel_rt_sigreturn in frame initialization

2019-07-15 Thread Joseph Tremoulet via Phabricator via lldb-commits
JosephTremoulet added a comment.

> I'm guessing on this Linux system, you've got a trap receiver function on the 
> stack that is on its first instruction or something? So backing up the pc 
> value for *that* frame is the problem you're solving.
> ...
>  Just just to check, we've got a backtrace like...

Yes, it's just like you describe.

> I think Unwind::GetFrameInfoAtIndex can take a new output argument, bool 
> behaves_like_zeroth_frame. It would be set to true if idx == 0 or if 
> m_frames[idx - 1].IsTrapHandlerFrame() is true.
> StackFrame.h would pick up a new ivar m_behaves_like_zeroth_frame and 
> accessor method BehavesLikeZerothFrame().
> StackFrameList::GetFramesUpTo will fetch the value via 
> unwinder->GetFrameInfoAtIndex() and pass it as an argument to the 
> StackFrame::StackFrame ctor.
> Then in StackFrame::GetSymbolContext we can use the 
> m_behaves_like_zeroth_frame to fix the symbol lookup logic.
> I'm not wedded to the behaves_like_zeroth_frame nomenclature. But I think 
> this approach makes sense.

Makes sense to me too, thanks for the pointers.  I think I'll upload that as a 
separate patch to keep the reviews incremental, but maybe commit them 
back-to-back since the second would improve any diagnostics if the first fails 
on other platforms.

> Anyway this looks fine to me.

Is that a green light to commit the change (modulo figuring out the issue that 
Jan reported which I'm not able to reproduce), or does that mean LGTY but I 
should get sign-off from someone else as well?  (Sorry if I'm being dense, just 
haven't committed changes to lldb before and want to make sure I understand the 
workflow, and noticed you didn't mark the Phab review as "accepted", wondering 
if that's significant)

Thanks!


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D63667



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


[Lldb-commits] [lldb] r366187 - [lldb] Handle EOF from `lldb-vscode`

2019-07-15 Thread Jan Kratochvil via lldb-commits
Author: jankratochvil
Date: Mon Jul 15 23:34:44 2019
New Revision: 366187

URL: http://llvm.org/viewvc/llvm-project?rev=366187&view=rev
Log:
[lldb] Handle EOF from `lldb-vscode`

Sometimes (when running lldb-vscode under strace) I get:

read(0, "", 16) = 0
read(0, "", 16) = 0
read(0, "", 16) = 0
...

With this patch testcases finish properly even with strace:

read(0, "", 16) = 0
futex(0x1346508, FUTEX_WAKE_PRIVATE, 2147483647) = 0
stat("", 0x7ffe8f2634c8)= -1 ENOENT (No such file or directory)
--- SIGCHLD {si_signo=SIGCHLD, si_code=CLD_KILLED, si_pid=9124, si_uid=1001, 
si_status=SIGINT, si_utime=1, si_stime=0} ---
close(4)= 0
exit_group(0)   = ?
+++ exited with 0 +++

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

Modified:
lldb/trunk/tools/lldb-vscode/IOStream.cpp

Modified: lldb/trunk/tools/lldb-vscode/IOStream.cpp
URL: 
http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/lldb-vscode/IOStream.cpp?rev=366187&r1=366186&r2=366187&view=diff
==
--- lldb/trunk/tools/lldb-vscode/IOStream.cpp (original)
+++ lldb/trunk/tools/lldb-vscode/IOStream.cpp Mon Jul 15 23:34:44 2019
@@ -101,6 +101,11 @@ bool InputStream::read_full(std::ofstrea
 else
   bytes_read = ::read(descriptor.m_fd, ptr, length);
 
+if (bytes_read == 0) {
+  if (log)
+*log << "End of file (EOF) reading from input file.\n";
+  return false;
+}
 if (bytes_read < 0) {
   int reason = 0;
 #if defined(_WIN32)


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


[Lldb-commits] [PATCH] D64698: Handle EOF from `lldb-vscode`

2019-07-15 Thread Jan Kratochvil via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes.
Closed by commit rL366187: [lldb] Handle EOF from `lldb-vscode` (authored by 
jankratochvil, committed by ).
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

Changed prior to commit:
  https://reviews.llvm.org/D64698?vs=209707&id=210026#toc

Repository:
  rL LLVM

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

https://reviews.llvm.org/D64698

Files:
  lldb/trunk/tools/lldb-vscode/IOStream.cpp


Index: lldb/trunk/tools/lldb-vscode/IOStream.cpp
===
--- lldb/trunk/tools/lldb-vscode/IOStream.cpp
+++ lldb/trunk/tools/lldb-vscode/IOStream.cpp
@@ -101,6 +101,11 @@
 else
   bytes_read = ::read(descriptor.m_fd, ptr, length);
 
+if (bytes_read == 0) {
+  if (log)
+*log << "End of file (EOF) reading from input file.\n";
+  return false;
+}
 if (bytes_read < 0) {
   int reason = 0;
 #if defined(_WIN32)


Index: lldb/trunk/tools/lldb-vscode/IOStream.cpp
===
--- lldb/trunk/tools/lldb-vscode/IOStream.cpp
+++ lldb/trunk/tools/lldb-vscode/IOStream.cpp
@@ -101,6 +101,11 @@
 else
   bytes_read = ::read(descriptor.m_fd, ptr, length);
 
+if (bytes_read == 0) {
+  if (log)
+*log << "End of file (EOF) reading from input file.\n";
+  return false;
+}
 if (bytes_read < 0) {
   int reason = 0;
 #if defined(_WIN32)
___
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits