summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangExpressionParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the build failure of lldb wrt clang recent change. Patch by Todd FialaSylvestre Ledru2013-12-051-1/+0
| | | | llvm-svn: 196483
* <rdar://problem/15367406>Greg Clayton2013-11-041-0/+2
| | | | | | | | Fixed a case where on darwin, after recent compiler changes a few months ago, we could not execute dlopen() in an expression, or use "process load". The issue was some compiler option default values changed. We now override these settings to get the old behavior back. llvm-svn: 194012
* It is no longer necessary to opt out of pretty stack traces.Filip Pizlo2013-11-041-2/+0
| | | | llvm-svn: 193972
* Fix build break: clang no longer supports -ast-dump-xml.Richard Smith2013-10-081-1/+0
| | | | llvm-svn: 192155
* Enable MCJIT on FreeBSDEd Maste2013-08-291-4/+0
| | | | | | | | | | | Testing shows it works for at least trivial cases, while the USE_STANDARD_JIT case does not even work for those. Thus, don't define USE_STANDARD_JIT on FreeBSD. I've left the #if block choosing the appropriate #include in case it's useful for testing. llvm-svn: 189611
* Remove unused include.Rafael Espindola2013-06-261-1/+0
| | | | llvm-svn: 184954
* Fix the lldb build.Rafael Espindola2013-06-261-12/+10
| | | | llvm-svn: 184948
* Fix the build. clang/Driver/OptTable.h was removed.Rafael Espindola2013-06-141-1/+0
| | | | llvm-svn: 183991
* Don't depend on the transitive inclusion of PathV1.hRafael Espindola2013-06-131-0/+1
| | | | llvm-svn: 183946
* Fixed a problem where the dynamic checkers (i.e.,Sean Callanan2013-05-181-17/+20
| | | | | | | | | the Objective-C object checker and the pointer checker) were not always installed into expressions. <rdar://problem/13882566> llvm-svn: 182183
* Fixed a few obvious errors pointed out by the static analyzer.Jim Ingham2013-05-151-1/+1
| | | | llvm-svn: 181911
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-181-4/+4
| | | | | | the macros and just use C++11. llvm-svn: 179805
* This commit changes the way LLDB executes userSean Callanan2013-04-181-37/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | expressions. Previously, ClangUserExpression assumed that if there was a constant result for an expression then it could be determined during parsing. In particular, the IRInterpreter ran while parser state (in particular, ClangExpressionDeclMap) was present. This approach is flawed, because the IRInterpreter actually is capable of using external variables, and hence the result might be different each run. Until now, we papered over this flaw by re-parsing the expression each time we ran it. I have rewritten the IRInterpreter to be completely independent of the ClangExpressionDeclMap. Instead of special-casing external variable lookup, which ties the IRInterpreter closely to LLDB, we now interpret the exact same IR that the JIT would see. This IR assumes that materialization has occurred; hence the recent implementation of the Materializer, which does not require parser state (in the form of ClangExpressionDeclMap) to be present. Materialization, interpretation, and dematerialization are now all independent of parsing. This means that in theory we can parse expressions once and run them many times. I have three outstanding tasks before shutting this down: - First, I will ensure that all of this works with core files. Core files have a Process but do not allow allocating memory, which currently confuses materialization. - Second, I will make expression breakpoint conditions remember their ClangUserExpression and re-use it. - Third, I will tear out all the redundant code (for example, materialization logic in ClangExpressionDeclMap) that is no longer used. While implementing this fix, I also found a bug in IRForTarget's handling of floating-point constants. This should be fixed. llvm-svn: 179801
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-181-12/+12
| | | | | | | | C++11 is being used. To do this, we follow what we have done for shared pointers and we define a STD_UNIQUE_PTR macro that can be used and it will "do the right thing". Due to some API differences in std::unique_ptr and due to the fact that we need to be able to compile without C++11, we can't use move semantics so some code needed to change so that it can compile with either C++. Anyone wanting to use a unique_ptr or auto_ptr should now use the "STD_UNIQUE_PTR(TYPE)" macro. llvm-svn: 179779
* Flipped the big switch: LLDB now uses the new Sean Callanan2013-04-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | Materializer for all expressions that need to run in the target. This includes the following changes: - Removed a bunch of (de-)materialization code from ClangExpressionDeclMap and assumed the presence of a Materializer where we previously had a fallback. - Ensured that an IRMemoryMap is passed into ClangExpressionDeclMap::Materialize(). - Fixed object ownership on LLVMContext; it is now owned by the IRExecutionUnit, since the Module and the ExecutionEngine both depend on its existence. - Fixed a few bugs in IRMemoryMap and the Materializer that showed up during testing. llvm-svn: 179649
* Audited the existing Materializer code to ensureSean Callanan2013-04-151-1/+1
| | | | | | | | that it works in the absence of a process. Codepaths in the Materializer now use the best execution context scope available to them. llvm-svn: 179539
* Factored out memory access into the target processSean Callanan2013-04-051-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from IRExecutionUnit into a superclass called IRMemoryMap. IRMemoryMap handles all reading and writing, ensuring that areas are kept track of and memory is properly cached (and deleted). Also fixed several cases where we would simply leak binary data in the target process over time. Now the expression objects explicitly own their IRExecutionUnit and delete it when they go away. This is why I had to modify ClangUserExpression, ClangUtilityFunction, and ClangFunction. As a side effect of this, I am removing the JIT mutex for an IRMemoryMap. If it turns out that we need this mutex, I'll add it in then, but right now it's just adding complexity. This is part of a more general project to make expressions fully reusable. The next step is to make materialization and dematerialization use the IRMemoryMap API rather than writing and reading directly from the process's memory. This will allow the IR interpreter to use the same data, but in the host's memory, without having to use a different set of pointers. llvm-svn: 178832
* Enabled blocks support in the expression parser.Sean Callanan2013-04-011-0/+1
| | | | | | | | | | | Note: although it is now possible to declare blocks and call them inside the same expression, we do not generate correct block descriptors so these blocks cannot be passed to functions like dispatch_async. <rdar://problem/12578656> llvm-svn: 178509
* Disable warnings from Clang correctly, by directlySean Callanan2013-03-301-2/+2
| | | | | | | | manipulating the diagnostics engine. <rdar://problem/13508470> llvm-svn: 178399
* <rdar://problem/13521159>Greg Clayton2013-03-271-1/+1
| | | | | | | | LLDB is crashing when logging is enabled from lldb-perf-clang. This has to do with the global destructor chain as the process and its threads are being torn down. All logging channels now make one and only one instance that is kept in a global pointer which is never freed. This guarantees that logging can correctly continue as the process tears itself down. llvm-svn: 178191
* Refactored the expression parser so that the IRSean Callanan2013-03-191-274/+18
| | | | | | | | | | | | | | | | | | | | | | | | | and the JITted code are managed by a standalone class that handles memory management itself. I have removed RecordingMemoryManager and ProcessDataAllocator, which filled similar roles and had confusing ownership, with a common class called IRExecutionUnit. The IRExecutionUnit manages all allocations ever made for an expression and frees them when it goes away. It also contains the code generator and can vend the Module for an expression to other clases. The end goal here is to make the output of the expression parser re-usable; that is, to avoid re-parsing when re-parsing isn't necessary. I've also cleaned up some code and used weak pointers in more places. Please let me know if you see any leaks; I checked myself as well but I might have missed a case. llvm-svn: 177364
* Removed One Definition Rule warnings because they'reSean Callanan2013-03-081-0/+1
| | | | | | | | noisy when dealing with anonymous structs. <rdar://problem/13246914> llvm-svn: 176738
* Convert from the C-based LLVM Disassembler shim to the full MC Disassembler ↵Jim Ingham2013-03-021-1/+3
| | | | | | | | | | | | API's. Calculate "can branch" using the MC API's rather than our hand-rolled regex'es. As extra credit, allow setting the disassembly flavor for x86 based architectures to intel or att. <rdar://problem/11319574> <rdar://problem/9329275> llvm-svn: 176392
* Change to JITDefault code model for ELF targetsAndrew Kaylor2013-02-211-1/+9
| | | | | | On x86-64 platforms, the small code model assumes that code will be loaded below the 2GB boundary. With the static relocation model, the fact that the expression code is initially loaded (in the LLDB debugger address space) above that boundary causes problems. Switching to the JITDefault code model causes the large code model to be used for 64-bit targets and small code model of 32-bit targets. llvm-svn: 175828
* Fixed a bug where certain vector code didn'tSean Callanan2013-02-211-0/+10
| | | | | | | | | work on i386. Now we let the JIT emit SSE/SSE2 instructions on i386. <rdar://problem/13240476> llvm-svn: 175700
* Change ELF relocation model to staticAndrew Kaylor2013-02-201-1/+6
| | | | llvm-svn: 175671
* Bring lldb up to date with clang revision 175141.Filipe Cabecinhas2013-02-141-0/+1
| | | | llvm-svn: 175213
* <rdar://problem/13069948>Greg Clayton2013-01-251-1/+1
| | | | | | | | | | | | Major fixed to allow reading files that are over 4GB. The main problems were that the DataExtractor was using 32 bit offsets as a data cursor, and since we mmap all of our object files we could run into cases where if we had a very large core file that was over 4GB, we were running into the 4GB boundary. So I defined a new "lldb::offset_t" which should be used for all file offsets. After making this change, I enabled warnings for data loss and for enexpected implicit conversions temporarily and found a ton of things that I fixed. Any functions that take an index internally, should use "size_t" for any indexes and also should return "size_t" for any sizes of collections. llvm-svn: 173463
* Quick fix to make LLDB TOT work with Clang TOT.Sean Callanan2013-01-221-1/+1
| | | | | | | Avoids an error about an ambiguous constructor call. llvm-svn: 173118
* Update to reflect API changes in r171367.Chandler Carruth2013-01-021-2/+2
| | | | llvm-svn: 171381
* Rewrite #includes for llvm/Foo.h to llvm/IR/Foo.h as appropriate to reflect theChandler Carruth2013-01-021-2/+2
| | | | | | | | | migration in r171366. I don't know anything about lldb, but a force run of the build bot indicated it would need this patch. I'll try to watch the build bot to get it green. llvm-svn: 171374
* Fix Linux build warnings due to redefinition of macros:Daniel Malea2012-12-051-0/+2
| | | | | | | | | - add new header lldb-python.h to be included before other system headers - short term fix (eventually python dependencies must be cleaned up) Patch by Matt Kopec! llvm-svn: 169341
* Resolve printf formatting warnings on Linux:Daniel Malea2012-11-291-2/+2
| | | | | | | | - use macros from inttypes.h for format strings instead of OS-specific types Patch from Matt Kopec! llvm-svn: 168945
* Fix lldb to compile with top of tree LLVM/clang.Greg Clayton2012-11-161-1/+1
| | | | llvm-svn: 168204
* Patch from Matt Kopec:Greg Clayton2012-10-301-1/+1
| | | | | | This patch switches support on Linux from JIT to MCJIT. llvm-svn: 167026
* Cleanup some variable names to indicate auto pointers and also manager the ↵Greg Clayton2012-10-241-18/+15
| | | | | | llvm::Module memory more correctly. llvm-svn: 166598
* Added support for "bool", "true", and "false" toSean Callanan2012-10-171-0/+2
| | | | | | | the expression parser (also wchar_t) and added a test case. llvm-svn: 166131
* Bunch of cleanups for warnings found by the llvm static analyzer.Jim Ingham2012-10-121-0/+1
| | | | llvm-svn: 165808
* Removed some debugging cruft.Sean Callanan2012-09-241-3/+0
| | | | llvm-svn: 164572
* Brought LLDB top-of-tree into sync with LLVM/ClangSean Callanan2012-09-241-56/+75
| | | | | | | | | | | | | top-of-tree. Removed all local patches and llvm.zip. The intent is that fron now on top-of-tree will always build against LLVM/Clang top-of-tree, and that problems building will be resolved as they occur. Stable release branches of LLDB can be constructed as needed and linked to specific release branches of LLVM/Clang. llvm-svn: 164563
* Disable the "pretty stack trace" signal handler,Sean Callanan2012-09-061-0/+2
| | | | | | | which can conflict with accurate crash reporting in multithreaded contexts. llvm-svn: 163282
* Removed explicit NULL checks for shared pointersSean Callanan2012-08-091-1/+1
| | | | | | | | | and instead made us use implicit casts to bool. This generated a warning in C++11. <rdar://problem/11930775> llvm-svn: 161559
* Instructions generated by a disassembler can nowSean Callanan2012-08-011-1/+1
| | | | | | | | | | | | | | | | | | keep a shared pointer to their disassembler. This is important for the LLVM-C disassembler because it needs to lock its parent in order to disassemble itself. This means that every interface that returned a Disassembler* needs to return a DisassemblerSP, so that the instructions and any external owners share the same reference count on the object. I changed all clients to use this shared pointer, which also plugged a few leaks. <rdar://problem/12002822> llvm-svn: 161123
* Minor fixes for ARM/iOS targets:Sean Callanan2012-06-081-0/+3
| | | | | | | | | | - On iOS, we select the "apcs-gnu" ABI to match what libraries expect. - Literals are now allocated at their preferred alignment, eliminating many alignment crashes. llvm-svn: 158236
* Enabled C++11 in the expression parser. auto andSean Callanan2012-05-161-0/+2
| | | | | | | | | various other syntactic sugar work. Lambdas do not due to some problems relocating code containing lambdas. Rvalue references work when returned from expressions, but need more testing. llvm-svn: 156948
* <rdar://problem/11330621>Greg Clayton2012-05-101-2/+1
| | | | | | | | | | | | Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size. Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code. Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function). Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions. llvm-svn: 156532
* Disabled spell checking in the expression parser,Sean Callanan2012-04-171-0/+6
| | | | | | | which incurs large overheads in terms of type parsing and importing. llvm-svn: 154885
* Updated the revision of LLVM/Clang used by LLDB.Sean Callanan2012-03-081-4/+9
| | | | | | | | | | | | | | | This takes two important changes: - Calling blocks is now supported. You need to cast their return values, but that works fine. - We now can correctly run JIT-compiled expressions that use floating-point numbers. Also, we have taken a fix that allows us to ignore access control in Objective-C as in C++. llvm-svn: 152286
* Updated LLVM to take a new MC JIT that supportsSean Callanan2012-03-011-1/+2
| | | | | | | | | | allocations by section. We install these sections in the target process and inform the JIT of their new locations. Also removed some unused variable warnings. llvm-svn: 151789
* <rdar://problem/10103468>Greg Clayton2012-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | I started work on being able to add symbol files after a debug session had started with a new "target symfile add" command and quickly ran into problems with stale Address objects in breakpoint locations that had lldb_private::Section pointers into modules that had been removed or replaced. This also let to grabbing stale modules from those sections. So I needed to thread harded the Address, Section and related objects. To do this I modified the ModuleChild class to now require a ModuleSP on initialization so that a weak reference can created. I also changed all places that were handing out "Section *" to have them hand out SectionSP. All ObjectFile, SymbolFile and SymbolVendors were inheriting from ModuleChild so all of the find plug-in, static creation function and constructors now require ModuleSP references instead of Module *. Address objects now have weak references to their sections which can safely go stale when a module gets destructed. This checkin doesn't complete the "target symfile add" command, but it does get us a lot clioser to being able to do such things without a high risk of crashing or memory corruption. llvm-svn: 151336
OpenPOWER on IntegriCloud