[Lldb-commits] [PATCH] D32100: [Expression parser] Return both types and variables

2017-04-14 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. Many times a user wants to access a type when there's a variable of the same name, or a variable when there's a type of the same name. Depending on the precise context, currently the expression parser can fail to resolve one or the other. This is because `ClangEx

[Lldb-commits] [PATCH] D32375: [DWARF] Fix lookup in the abstract origins of inlined blocks/functions

2017-04-21 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. spyffe added a project: LLDB. LLDB uses `clang::DeclContext`s for lookups, and variables get put into the `DeclContext` for their //abstract origin//. (The abstract origin is a DWARF pointer that indicates the unique definition of inlined code.) When the expressi

[Lldb-commits] [PATCH] D32375: [DWARF] Fix lookup in the abstract origins of inlined blocks/functions

2017-04-24 Thread Sean Callanan via Phabricator via lldb-commits
spyffe added inline comments. Comment at: source/Plugins/SymbolFile/DWARF/DWARFASTParserClang.cpp:3723-3742 +static DWARFDIE FindAnyChildWithAbstractOrigin(const DWARFDIE &context) { + for (DWARFDIE candidate = context.GetFirstChild(); candidate.IsValid(); + candidate = ca

[Lldb-commits] [PATCH] D32375: [DWARF] Fix lookup in the abstract origins of inlined blocks/functions

2017-04-24 Thread Sean Callanan via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL301263: [DWARF] Fix lookup in the abstract origins of inlined blocks/functions (authored by spyffe). Changed prior to commit: https://reviews.llvm.org/D32375?vs=96229&id=96477#toc Repository: rL LLVM

[Lldb-commits] [PATCH] D32100: [Expression parser] Return both types and variables

2017-04-24 Thread Sean Callanan via Phabricator via lldb-commits
spyffe closed this revision. spyffe added a comment. Closed by r301273 https://reviews.llvm.org/D32100 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D33025: [DWARF parser] Produce correct template parameter packs

2017-05-09 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. Templates can end in parameter packs, like this template struct MyStruct { /*...*/ }; LLDB does not currently support these parameter packs; it does not emit them into the template argument list at all. This causes problems when you specialize, e.g.: templa

[Lldb-commits] [PATCH] D33077: [TypeSystem] Fix inspection of Objective-C object types

2017-05-10 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. `ptr_refs` exposed a problem in ClangASTContext's implementation; it uses an accessor to convert a `QualType` into an `ObjCObjectPointerType`, but the accessor is not fully general. `getAs()` is the safer way to go. I've added a test case that uses `ptr_refs` in a

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-10 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. When it resolved symbol-only variables, the expression parser currently looks only in the global module list. It should prefer the current module. I've fixed that behavior by making it search the current module first, and only search globally if it finds nothing.

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-11 Thread Sean Callanan via Phabricator via lldb-commits
spyffe added a comment. I also would flip 2 and 3. I'll give this a shot. https://reviews.llvm.org/D33083 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-11 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 98672. spyffe added a comment. Improved symbol lookup per Greg and Jim's suggestion, with flipped steps 2 and 3. Also added testing for the error case. https://reviews.llvm.org/D33083 Files: packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefil

[Lldb-commits] [PATCH] D33025: [DWARF parser] Produce correct template parameter packs

2017-05-11 Thread Sean Callanan via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL302833: [DWARF parser] Produce correct template parameter packs (authored by spyffe). Changed prior to commit: https://reviews.llvm.org/D33025?vs=98388&id=98687#toc Repository: rL LLVM https://revie

[Lldb-commits] [PATCH] D33077: [TypeSystem] Fix inspection of Objective-C object types

2017-05-15 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 99052. spyffe marked an inline comment as done. spyffe added a comment. Updated the Makefile to fix a problem caught by Pavel Labath. Also relocated the new test to lang/objc. https://reviews.llvm.org/D33077 Files: packages/Python/lldbsuite/test/lang/objc/

[Lldb-commits] [PATCH] D33077: [TypeSystem] Fix inspection of Objective-C object types

2017-05-15 Thread Sean Callanan via Phabricator via lldb-commits
spyffe closed this revision. spyffe added a comment. Committed r303110. https://reviews.llvm.org/D33077 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-15 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 99084. spyffe added a comment. Two changes after Greg and Pavel's suggestions: - Moved the symbol lookup function into the global context; and - Rewrote the test case's build system to be more generic. https://reviews.llvm.org/D33083 Files: include/lldb/S

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-16 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 99186. spyffe added a comment. Updated to reflect Pavel Labath's suggestions: - Used `CFLAGS_NO_DEBUG` where appropriate - Marked the testcase as having no debug info variants https://reviews.llvm.org/D33083 Files: include/lldb/Symbol/SymbolContext.h pa

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-16 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 99211. spyffe added a comment. Used `CFLAGS_EXTRAS` instead of `CFLAGS` at Greg Clayton's suggestion. https://reviews.llvm.org/D33083 Files: include/lldb/Symbol/SymbolContext.h packages/Python/lldbsuite/test/lang/c/conflicting-symbol/Makefile packages/

[Lldb-commits] [PATCH] D33083: [Expression parser] Look up module symbols before hunting globally

2017-05-16 Thread Sean Callanan via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL303223: [Expression parser] Look up module symbols before hunting globally (authored by spyffe). Changed prior to commit: https://reviews.llvm.org/D33083?vs=99211&id=99227#toc Repository: rL LLVM ht

[Lldb-commits] [PATCH] D33812: [TypeSystem] Handle Clang AttributedTypes

2017-06-01 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. When parsing types originating in modules, it is possible to encounter `AttributedType`s (such as the type generated for `NSString *_Nonnull`). Some of LLDB's `ClangASTContext` methods deal with them; others do not. In particular, one function that did not was `G

[Lldb-commits] [PATCH] D33812: [TypeSystem] Handle Clang AttributedTypes

2017-06-01 Thread Sean Callanan via Phabricator via lldb-commits
spyffe added a comment. `ModifiedType` gets assigned during construction and `getModifiedType()` is just an accessor, so if that is `nullptr` something very bad is happening. We should not expect that except in case of a parser bug of some sort. `AttributedType` checks that a `Type*` is an `At

[Lldb-commits] [PATCH] D33812: [TypeSystem] Handle Clang AttributedTypes

2017-06-01 Thread Sean Callanan via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL304510: [TypeSystem] Handle Clang AttributedTypes (authored by spyffe). Changed prior to commit: https://reviews.llvm.org/D33812?vs=101140&id=101158#toc Repository: rL LLVM https://reviews.llvm.org/

[Lldb-commits] [PATCH] D35083: [TypeSystem] Guard the global `ASTSourceMap` with a mutex

2017-07-06 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. `s_source_map` in `ClangExternalASTSourceCommon.cpp` is unguarded and therefore can break in multithreaded conditions. This can cause crashes in particular if multiple targets are being set up at once. This patch wraps `s_source_map` in a function that ensures exc

[Lldb-commits] [PATCH] D35083: [TypeSystem] Guard the global `ASTSourceMap` with a mutex

2017-07-09 Thread Sean Callanan via Phabricator via lldb-commits
spyffe added a comment. Responded to Lang's comments inline. **Jim**: you say this patch "doesn't actually enforce that you take the lock to get the SourceMap." How do you get the source map otherwise? It's static inside the function so nothing can see it outside. Do you mean that it's still

[Lldb-commits] [PATCH] D35083: [TypeSystem] Guard the global `ASTSourceMap` with a mutex

2017-07-11 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 106087. spyffe added a comment. Upon reflection, it's not worth coming up with a new pattern if - that pattern does not considerably reduce the incidence of bugs in the source file I'm applying it in (and indeed that seems quite unlikely), and - that pattern

[Lldb-commits] [PATCH] D35083: [TypeSystem] Guard the global `ASTSourceMap` with a mutex

2017-07-25 Thread Sean Callanan via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL308993: [TypeSystem] Guard the global `ASTSourceMap` with a mutex (authored by spyffe). Changed prior to commit: https://reviews.llvm.org/D35083?vs=106087&id=108116#toc Repository: rL LLVM https://r

[Lldb-commits] [PATCH] D38153: Inhibit global lookups for symbols in the IR dynamic checks

2017-09-21 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. spyffe added a project: LLDB. Herald added subscribers: arichardson, aprantl, sdardis. The IR dynamic checks are self-contained functions whose job is to - verify that pointers referenced in an expression are valid at runtime; and - verify that selectors sent to Obje

[Lldb-commits] [PATCH] D38153: Inhibit global lookups for symbols in the IR dynamic checks

2017-09-25 Thread Sean Callanan via Phabricator via lldb-commits
spyffe marked 5 inline comments as done. spyffe added a comment. Thank you. I am testing a new revision with your suggestions. Repository: rL LLVM https://reviews.llvm.org/D38153 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://l

[Lldb-commits] [PATCH] D38153: Inhibit global lookups for symbols in the IR dynamic checks

2017-09-25 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 116444. spyffe added a comment. Applied Greg's and Zachary's suggestions: - Used `R"(...)"` for multiline strings. - Used `StringRef`s appropriately. - Factored out symbol-ignoring into a function shared between `ClangASTSource` and `ClangExpressionDeclMap`.

[Lldb-commits] [PATCH] D38153: Inhibit global lookups for symbols in the IR dynamic checks

2017-09-26 Thread Sean Callanan via Phabricator via lldb-commits
spyffe abandoned this revision. spyffe added a comment. Committed as LLDB r314225 Repository: rL LLVM https://reviews.llvm.org/D38153 ___ lldb-commits mailing list lldb-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-co

[Lldb-commits] [PATCH] D38153: Inhibit global lookups for symbols in the IR dynamic checks

2017-09-26 Thread Sean Callanan via Phabricator via lldb-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rL314225: [Expression Parser] Inhibit global lookups for symbols in the IR dynamic checks (authored by spyffe). Changed prior to commit: https://reviews.llvm.org/D38153?vs=116444&id=116727#toc Repository

[Lldb-commits] [PATCH] D27291: Handle UTF-16 and UTF-32 constant CFStrings

2016-11-30 Thread Sean Callanan via Phabricator via lldb-commits
spyffe created this revision. spyffe added a reviewer: jingham. spyffe added a subscriber: LLDB. spyffe set the repository for this revision to rL LLVM. We have a longstanding issue where the expression parser does not handle wide CFStrings (e.g., `@"凸凹"`) correctly, producing the useless error m

[Lldb-commits] [PATCH] D27291: Handle UTF-16 and UTF-32 constant CFStrings

2016-12-01 Thread Sean Callanan via Phabricator via lldb-commits
spyffe updated this revision to Diff 79935. spyffe added a comment. Updated to reflect Jim's comments. Repository: rL LLVM https://reviews.llvm.org/D27291 Files: packages/Python/lldbsuite/test/lang/objc/unicode-string/TestUnicodeString.py packages/Python/lldbsuite/test/lang/objc/unicode-

[Lldb-commits] [PATCH] D27394: Fix expression evaluation inside lambda functions for gcc

2016-12-05 Thread Sean Callanan via Phabricator via lldb-commits
spyffe added a subscriber: aprantl. spyffe added a comment. How does Clang-emitted debug information express the region in which a type is declared if it has been moved to the containing Decl? I'm thinking specifically of this case: int foo() { return []() { struct A { int a; } a1;