summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/ExpressionParser
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-0/+1
| | | | | | the right thing and break. llvm-svn: 261950
* Improve readability and performance of ↵Aidan Dodds2016-02-251-5/+4
| | | | | | | | | | ClangExpressionParser::FindFunctionInModule Committed on behalf of: Luke Drummond Differential Revision: http://reviews.llvm.org/D17274 llvm-svn: 261861
* refactor/cleanup ClangExpressionParser::ParseEwan Crawford2016-02-191-33/+20
| | | | | | | | | | | | | | | This patches does the following: + fix return type: ClangExpressionParser::Parse returns unsigned, but was actually returning a signed value, num_errors. + use helper clang::TextDiagnosticBuffer::getNumErrors() instead of counting the errors ourself. + limit scoping of block-level automatic variables as much as practical. + remove reused multipurpose TextDiagnosticBuffer::const_iterator in favour of loop-scoped err, warn, and note variables in the diagnostic printing code. + refactor diagnostic printing loops to use a proper loop invariant. Author: Luke Drummond <luke.drummond@codeplay.com> Differential Revision: http://reviews.llvm.org/D17273 llvm-svn: 261345
* Delete unused function in ClangExpressionParserEwan Crawford2016-02-191-15/+0
| | | | | | | | | | | | [git 65dafa83] introduced the GetBuiltinIncludePath function copied from cfe/lib/Driver/CC1Options.cpp This function is no longer used in lldb's expression parser and I believe it is safe to remove it. Author: Luke Drummond <luke.drummond@codeplay.com> Differential Revision: http://reviews.llvm.org/D17266 llvm-svn: 261328
* [LLDB][MIPS] Provide CPU string to compiler for appropriate code generation ↵Bhushan D. Attarde2016-02-181-4/+14
| | | | | | | | | | | | | | | for MIPS SUMMARY: This patch implements ArchSpec::GetClangTargetCPU() that provides string representing current architecture as a target CPU. This string is then passed to tools like clang so that they generate correct code for that target. Reviewers: clayborg, zturner Subscribers: mohit.bhakkad, sagar, jaydeep, lldb-commits Differential Revision: http://reviews.llvm.org/D17022 llvm-svn: 261206
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* ExpressionParser: silence some GCC warningsSaleem Abdulrasool2016-02-152-2/+2
| | | | | | | Silence a -Wreorder warning about order of member initialization and a -Wqual-cast warning about casting away constness. NFC. llvm-svn: 260868
* Removed many JIT workarounds from IRForTarget.Sean Callanan2016-02-134-985/+58
| | | | | | | | | | | | | | | | | | | | | | Since IRExecutionUnit is now capable of looking up symbols, and the JIT is up to the task of generating the appropriate relocations, we don't need to do all the work that IRForTarget used to do to fixup symbols at the IR level. We also don't need to allocate data manually (with its attendant bugs) because the JIT is capable of doing so without crashing. We also don't need the awkward lldb.call.realName metadata to determine what calls are objc_msgSend, because they now just reference objc_msgSend. To make this work, we ensure that we recognize which symbols are extern "C" and report them to the compiler as such. We also report the full Decl of functions rather than just making up top-level functions with the appropriate types. This should not break any testcases, but let me know if you run into any issues. <rdar://problem/22864926> llvm-svn: 260768
* Centralized symbol lookup in IRExecutionUnit, and fixed the code model.Sean Callanan2016-02-121-0/+12
| | | | | | | | | | | | | I'm preparing to remove symbol lookup from IRForTarget, where it constitutes a dreadful hack working around no-longer-existing JIT bugs. Thanks to our contributors, IRForTarget has a lot of smarts that IRExecutionUnit doesn't have, so I've cleaned them up a bit and moved them over to IRExecutionUnit. Also for historical reasons, IRExecutionUnit used the "Small" code model on non- ELF platforms (namely, OS X). That's no longer necessary, and we can use the same code model as everyone else on OS X. I've fixed that. llvm-svn: 260734
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-102-4/+8
| | | | | | | | | | | | | | file with "-fmodules -gmodules", each SymbolFileDWARF can reference module DWARF info by looking in other DWARF files. Then if you have 1000 .o files that each reference one or more .pcm files in their debug info, a simple Module::FindTypes(...) call can end up searching the same .pcm file over and over and over. Now all internal FindTypes methods in classes (ModuleList, Module, SymbolFile) now take an extra argument: llvm::DenseSet<lldb_private::SymbolFile *> &searched_symbol_files Each time a SymbolFile::FindTypes() is called, it needs to check the searched_symbol_files list to make sure it hasn't already been asked to find the type and return immediately if it has been checked. This will stop circular dependencies from also crashing LLDB during type queries. This has proven to be an issue when debugging large applications on MacOSX that use DWARF in .o files. <rdar://problem/24581488> llvm-svn: 260434
* Take 2: Use an artifical namespace so that member vars do not hide local vars.Siva Chandra2016-02-052-4/+67
| | | | | | | | | | | | Summary: This relands r259810 with fix for failures on Mac. Reviewers: spyffe, tfiala Subscribers: tfiala, lldb-commits Differential Revision: http://reviews.llvm.org/D16900 llvm-svn: 259902
* Revert "Use an artifical namespace so that member vars do not hide local vars."Siva Chandra2016-02-042-67/+4
| | | | | | | | | | | | | | Summary: This reverts commit 8af14b5f9af68c31ac80945e5b5d56f0a14b38e4. Reverting as it breaks a few tests on Mac. Reviewers: spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16895 llvm-svn: 259823
* Use an artifical namespace so that member vars do not hide local vars.Siva Chandra2016-02-042-4/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: While evaluating expressions when stopped in a class method, there was a problem of member variables hiding local variables. This was happening because, in the context of a method, clang already knew about member variables with their name and assumed that they were the only variables with those names in scope. Consequently, clang never checks with LLDB about the possibility of local variables with the same name and goes wrong. This change addresses the problem by using an artificial namespace "$__lldb_local_vars". All local variables in scope are declared in the "$__lldb_expr" method as follows: using $__lldb_local_vars::<local var 1>; using $__lldb_local_vars::<local var 2>; ... This hides the member variables with the same name and forces clang to enquire about the variables which it thinks are declared in $__lldb_local_vars. When LLDB notices that clang is enquiring about variables in $__lldb_local_vars, it looks up local vars and conveys their information if found. This way, member variables do not hide local variables, leading to correct evaluation of expressions. A point to keep in mind is that the above solution does not solve the problem for one specific case: namespace N { int a; } class A { public: void Method(); int a; }; void A::Method() { using N::a; ... // Since the above solution only touches locals, it does not // force clang to enquire about "a" coming from namespace N. } Reviewers: clayborg, spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16746 llvm-svn: 259810
* Add ability to override JIT expr compiler options.Aidan Dodds2016-02-031-25/+78
| | | | | | | | | Runtimes should be able to pass custom compilation options to the JIT for their stack frame. This patch adds a custom expression options member class to LanguageOptions, and modifies the clang expression evaluator to check the current runtime for those options. If those options are available on the runtime, they are passed to the clang compiler. Committed for Luke Drummond. Differential Revision: http://reviews.llvm.org/D15527 llvm-svn: 259644
* Fix build after clang interface change in r259489Pavel Labath2016-02-021-3/+3
| | | | llvm-svn: 259494
* Revert "fix up missing header from change r259084."Todd Fiala2016-01-291-1/+0
| | | | | | | | This change was made based on a bad signal from the Green Dragon LLDB builder. This change was not needed. Reverting out r259114. llvm-svn: 259216
* fix up missing header from change r259084.Todd Fiala2016-01-281-0/+1
| | | | llvm-svn: 259114
* Remove autoconf support from source directories.Eugene Zelenko2016-01-282-28/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* Fix build after rL259070.Chaoren Lin2016-01-281-1/+1
| | | | llvm-svn: 259086
* Update lldb for API change in clang r259070.Manman Ren2016-01-281-1/+1
| | | | llvm-svn: 259084
* Enable the use of modules in the expression parser by default.Sean Callanan2016-01-141-0/+2
| | | | | | | | | | If your program refers to modules (as indicated in DWARF) we will now try to load these modules and give you access to their types in expressions. This used to be gated by a setting ("settings set target.auto-import-clang-modules true") but that setting defaulted to false. Now it defaults to true -- but you can disable it by toggling the setting to false. llvm-svn: 257812
* Fix some compiler warnings with MSVC 2015.Zachary Turner2016-01-131-0/+1
| | | | llvm-svn: 257671
* Better scheme to lookup alternate mangled name when looking up function address.Siva Chandra2016-01-072-35/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This change is relevant for inferiors compiled with GCC. GCC does not emit complete debug info for std::basic_string<...>, and consequently, Clang (the LLDB compiler) does not generate correct mangled names for certain functions. This change removes the hard-coded alternate names in ItaniumABILanguageRuntime.cpp. Before the hard-coded names were put in ItaniumABILanguageRuntime.cpp, one could not evaluate std::string methods (ex. std::string::length). After putting in the hard-coded names, one could evaluate them. However, it did not still enable one to call methods on, say for example, std::vector<string>. This change makes that possible. There is some amount of incompleteness in this change. Consider the following example: std::string hello("hello"), world("world"); std::map<std::string, std::string> m; m[hello] = world; One can still not evaluate the expression "m[hello]" in LLDB. Will address this issue in another pass. Reviewers: jingham, vharron, evgeny777, spyffe, dawn Subscribers: clayborg, dawn, lldb-commits Differential Revision: http://reviews.llvm.org/D12809 llvm-svn: 257113
* Fix scope-based lookup when more than one function is found.Dawn Perchik2015-12-121-0/+122
| | | | | | | | | | | | | | | | | | | | | | | | When multiple functions are found by name, lldb removes duplicate entries of functions with the same type, so the first function in the symbol context list is chosen, even if it isn't in scope. This patch uses the declaration context of the execution context to select the function which is in scope. This fixes cases like the following: int func(); namespace ns { int func(); void here() { // Run to BP here and eval 'p func()'; // lldb used to find ::func(), now finds ns::func(). } } Reviewed by: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D15312 llvm-svn: 255439
* Trying to submit 254476 one more time. This implement -gmodule debugging ↵Greg Clayton2015-12-081-0/+5
| | | | | | | | | | | | | | support. It was previously reverted due to issues that showed up only on linux. I was able to reproduce these issues and fix the underlying cause. So this is the same patch as 254476 with the following two fixes: - Fix not trying to complete classes that don't have external sources - Fix ClangASTSource::CompleteType() to check the decl context of types that it finds by basename to ensure we don't complete a type "S" with a type like "std::S". Before this fix ClangASTSource::CompleteType() would accept _any_ type that had a matching basename and copy it into the other type. <rdar://problem/22992457> llvm-svn: 254980
* Made the ClangASTImporter into a shared pointer, eliminating a race condition.Sean Callanan2015-11-103-49/+49
| | | | | | | | | | | | | | | It used to be a unique pointer, and there could be a case where ClangASTSource held onto a copy of the pointer but Target::Destroy destroyed the unique pointer in the mean time. I also ensured that there is a validity check on the target (which confirms that a ClangASTImporter can be generated) before the target's shared pointer is copied into ClangASTSource. This race condition caused a crash if Target::Destroy was called and then later the target objecct was deleted. llvm-svn: 252665
* Make lldb::endian::InlHostByteOrder() private.Bruce Mitchener2015-11-071-1/+1
| | | | | | | | | | | | | | | | | | Summary: Since this is within the lldb namespace, the compiler tries to export a symbol for it. Unfortunately, since it is inlined, the symbol is hidden and this results in a mess of warnings when building on OS X with cmake. Moving it to the lldb_private namespace eliminates that problem. Reviewers: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D14417 llvm-svn: 252396
* lldb/ADT: Remove implicit ilist iterator conversions, NFCDuncan P. N. Exon Smith2015-11-071-8/+8
| | | | | | | Remove implicit ilist iterator conversions before reapplying r252372 (which will disallow them). llvm-svn: 252378
* Fix some Clang-tidy warnings and formatting in recently added code.Eugene Zelenko2015-11-072-18/+37
| | | | | | | | | | | Fixed Clang-tidy warnings: * modernize-use-override; * modernize-use-nullptr; * modernize-use-default; * readability-simplify-boolean-expr. llvm-svn: 252374
* Add IRExecutionUnitSP to lldb-forward and use it instead of hand-rolling in ↵Jim Ingham2015-11-052-2/+2
| | | | | | place. llvm-svn: 252129
* AddInitialArguments -> AddArguments, and we pass in the struct_address and ↵Jim Ingham2015-11-052-7/+13
| | | | | | | | | push it too. All the callers had to do this by hand and we ended up never actually adding initial arguments and then reusing them by passing in the struct address separately, so the distinction wasn't needed. llvm-svn: 252108
* Add the ability to pass an EvaluateExpressionOptions when you make a ↵Jim Ingham2015-11-034-8/+14
| | | | | | | | UserExpression. This isn't used in this commit but will be in a future commit. llvm-svn: 251887
* Create an expression parser for Go.Ryan Brown2015-11-0213-9/+6244
| | | | | | | | | | | The Go interpreter doesn't JIT or use LLVM, so this also moves all the JIT related code from UserExpression to a new class LLVMUserExpression. Differential Revision: http://reviews.llvm.org/D13073 Fix merge llvm-svn: 251820
* Revert "Clang module compilation options need to be per-platform."Adrian McCarthy2015-10-261-1/+12
| | | | | | | | This reverts commit r251340. Breaks the Windows build because Windows doesn't have getuid. The fix is not obvious. llvm-svn: 251354
* Clang module compilation options need to be per-platform.Sean Callanan2015-10-261-12/+1
| | | | | | | | On UNIX (but not Darwin) the username needs to be respected when creating a temporary module directory, so that different users don't pollute each others' module caches. llvm-svn: 251340
* Fixed some issues with reporting "this" when the current function is not listedSean Callanan2015-10-232-43/+47
| | | | | | | | | in DWARF as a member of a class, but it has a "this" parameter. Specifically, *this needs to have the LLDB expression added as a method. This fixes TestWithLimitDebugInfo. llvm-svn: 251151
* Fix Clang-tidy modernize-use-override warnings in some files in ↵Eugene Zelenko2015-10-215-94/+91
| | | | | | | | source/Plugins; other minor fixes. Differential Revision: http://reviews.llvm.org/D13916 llvm-svn: 250872
* Reduce header inclusion in Expression.Bruce Mitchener2015-10-074-4/+2
| | | | | | | | | | Reviewers: spyffe Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D13333 llvm-svn: 249570
* Add PersistentVariableDelegate to handle language-specific dematerialization.Sean Callanan2015-10-035-11/+95
| | | | | | | | | | | | | | | | | | | | | | | | The concept here is that languages may have different ways of communicating results. In particular, languages may have different names for their result variables and in fact may have multiple types of result variables (e.g., error results). Materializer was tied to one specific model of result handling. Instead, now UserExpressions can register their own handlers for the result variables they inject. This allows language-specific code in Materializer to be moved into the expression parser plug-in, and it simplifies Materializer. These delegates are subclasses of PersistentVariableDelegate. PersistentVariableDelegate can provide the name of the result variable, and is notified when the result variable is populated. It can also be used to touch persistent variables if need be, updating language-specific state. The UserExpression owns the delegate and can decide on its result based on consulting all of its (potentially multiple) delegates. The user expression itself now makes the determination of what the final result of the expression is, rather than relying on the Materializer, and I've added a virtual function to UserExpression to allow this. llvm-svn: 249233
* Eliminated redundant "constructors" for ClangExpressionVariable. ↵Sean Callanan2015-10-015-75/+58
| | | | | | | | | | | | | The ClangExpressionVariable::CreateVariableInList functions looked cute, but caused more confusion than they solved. I removed them, and instead made sure that there are adequate facilities for easily adding newly-constructed ExpressionVariables to lists. I also made some of the constructors that are common be generic, so that it's possible to construct expression variables from generic places (like the ABI and ValueObject) without having to know the specifics about the class. llvm-svn: 249095
* Made Target hold a map of languages to TypeSystems, and added some accessors.Sean Callanan2015-10-014-4/+4
| | | | | | | | Also added some target-level search functions so that persistent variables and symbols can be searched for without hand-iterating across the map of TypeSystems. llvm-svn: 249027
* Changed PersistentExpressionState to allow symbol lookups. Clang doesn'tSean Callanan2015-10-011-0/+3
| | | | | | report any (yet). llvm-svn: 248970
* Now persistent expression data no longer lives with the Target, but rather withSean Callanan2015-09-306-8/+21
| | | | | | | | | | the corresponding TypeSystem. This makes sense because what kind of data there is -- and how it can be looked up -- depends on the language. Functionality that is common to all type systems is factored out into PersistentExpressionState. llvm-svn: 248934
* Moved ClangExpressionHelper.h into the Clang expression parser plug-in.Sean Callanan2015-09-253-2/+82
| | | | llvm-svn: 248631
* Moved more Clang-specific parts of the expression parser into the Clang plugin.Sean Callanan2015-09-2525-0/+13745
| | | | | | | | | There are still a bunch of dependencies on the plug-in, but this helps to identify them. There are also a few more bits we need to move (and abstract, for example the ClangPersistentVariables). llvm-svn: 248612
* ExpressionVariable now uses llvm::cast() instead of As...() for RTTI.Sean Callanan2015-09-082-10/+15
| | | | | | | | As part of our overall switch from hand-rolling RTTI to using LLVM-compatible methods, I've done the same for ExpressionVariable. The main documentation for how to do this is in TypeSystem.h, so I've simply referred to that. llvm-svn: 247085
* Fix Makefile buildKeno Fischer2015-09-051-0/+14
| | | | llvm-svn: 246932
* This patch separates the generic portion of ClangExpressionVariable, whichSean Callanan2015-09-042-338/+86
| | | | | | | | | stores information about a variable that different parts of LLDB use, from the compiler-specific portion that only the expression parser cares about. http://reviews.llvm.org/D12602 llvm-svn: 246871
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-031-2/+0
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Fix cmake build.Bruce Mitchener2015-09-032-0/+6
| | | | llvm-svn: 246746
OpenPOWER on IntegriCloud