summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression/ClangExpressionParser.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Update for LLVM API change.Rafael Espindola2014-08-271-2/+2
| | | | llvm-svn: 216603
* Initialize LLVM when LLDB is initialized, andSean Callanan2014-08-231-10/+0
| | | | | | | | install a crash handler. <rdar://problem/18083226> llvm-svn: 216309
* Fixes a few more places where we were manually setting the filename.Zachary Turner2014-08-211-1/+1
| | | | llvm-svn: 216247
* Move Host::GetLLDBPath to HostInfo.Zachary Turner2014-08-211-1/+2
| | | | | | | | This continues the effort to get Host code moved over to HostInfo, and removes many more instances of preprocessor defines along the way. llvm-svn: 216195
* Fixed the build broken by the r215046.Hafiz Abid Qadeer2014-08-071-2/+2
| | | | llvm-svn: 215107
* (no commit message)Greg Clayton2014-07-301-1/+1
| | | | llvm-svn: 214319
* remove trailing whitespace + remove some useless commentsSylvestre Ledru2014-07-061-77/+77
| | | | llvm-svn: 212411
* Update lldb code to match the change in clang r212386Sylvestre Ledru2014-07-061-1/+1
| | | | llvm-svn: 212410
* Track changes from clang r212388Alp Toker2014-07-061-3/+3
| | | | llvm-svn: 212391
* Don't truncate the target triple when initializing clang.Zachary Turner2014-06-271-13/+0
| | | | | | | | Reviewed by: Sean Callanan Differential Revision: http://reviews.llvm.org/D4282 llvm-svn: 211968
* Don't set the ABI to apcs-gnu for non-ARM iOS targets (i.e., theSean Callanan2014-06-231-2/+3
| | | | | | | | simulator). <rdar://problem/17399406> llvm-svn: 211536
* Track clang changes from r210764Alp Toker2014-06-121-3/+5
| | | | llvm-svn: 210765
* Update for llvm api change in r209266.Rafael Espindola2014-05-211-3/+6
| | | | llvm-svn: 209303
* Track recent changes in clang internalsAlp Toker2014-05-031-3/+2
| | | | llvm-svn: 207913
* lldb arm64 import.Jason Molenda2014-03-291-3/+7
| | | | | | | | | | | | | | | | These changes were written by Greg Clayton, Jim Ingham, Jason Molenda. It builds cleanly against TOT llvm with xcodebuild. I updated the cmake files by visual inspection but did not try a build. I haven't built these sources on any non-Mac platforms - I don't think this patch adds any code that requires darwin, but please let me know if I missed something. In debugserver, MachProcess.cpp and MachTask.cpp were renamed to MachProcess.mm and MachTask.mm as they picked up some new Objective-C code needed to launch processes when running on iOS. llvm-svn: 205113
* JITed functions can now have debug info and be debugged with debug and ↵Greg Clayton2014-03-241-23/+75
| | | | | | | | | | | | | | | | | | | source info: (lldb) b puts (lldb) expr -g -i0 -- (int)puts("hello") First we will stop at the entry point of the expression before it runs, then we can step over a few times and hit the breakpoint in "puts", then we can continue and finishing stepping and fininsh the expression. Main features: - New ObjectFileJIT class that can be easily created for JIT functions - debug info can now be enabled when parsing expressions - source for any function that is run throught the JIT is now saved in LLDB process specific temp directory and cleaned up on exit - "expr -g --" allows you to single step through your expression function with source code <rdar://problem/16382881> llvm-svn: 204682
* cleanup unreferenced functionsSaleem Abdulrasool2014-03-201-81/+0
| | | | | | | | | | | | | This is a mechanical cleanup of unused functions. In the case where the functions are referenced (in comment form), I've simply commented out the functions. A second pass to clean that up is warranted. The functions which are otherwise unused have been removed. Some of these were introduced in the initial commit and not in use prior to that point! NFC llvm-svn: 204310
* Fix expression parsing (on FreeBSD, at least)Ed Maste2014-03-181-0/+1
| | | | | | | This reverts part of r204112 (Expression: cleanup unused include). It looks like MCJIT.h is required to force MCJIT to be linked. llvm-svn: 204170
* Expression: cleanup unused includeSaleem Abdulrasool2014-03-181-5/+0
| | | | | | | | The standard JIT has been discarded in favour of MCJIT. USE_STANDARD_JIT is no longer defined. Furthermore, the execution engine is now built in IRExecutionUnit. Simply remove inclusion of both JIT headers. llvm-svn: 204112
* Update for clang r203213Ben Langmuir2014-03-071-1/+1
| | | | llvm-svn: 203217
* Replace uses of OwningPtr<T> with std::unique_ptr<T>.Ahmed Charles2014-03-071-2/+2
| | | | llvm-svn: 203200
* update the declaration from llvm::OwningPtr to llvm::IntrusiveRefCntPtr to ↵Sylvestre Ledru2014-02-271-1/+1
| | | | | | match the clang update (r202346) on ASTContext llvm-svn: 202376
* Revert "Track Clang virtualFileSystem change (r201618)"Juergen Ributzka2014-02-201-1/+0
| | | | | | This reverts commit r201671, because the clang changes have been reverted. llvm-svn: 201759
* Track Clang virtualFileSystem change (r201618)Ed Maste2014-02-191-0/+1
| | | | | | | Clang now requires calling CompilerInstance::createVirtualFileSystem before CompilerInstance::createFileManager. llvm-svn: 201671
* Merging the iohandler branch back into main. Greg Clayton2014-01-271-1/+2
| | | | | | | | | | | | The many many benefits include: 1 - Input/Output/Error streams are now handled as real streams not a push style input 2 - auto completion in python embedded interpreter 3 - multi-line input for "script" and "expression" commands now allow you to edit previous/next lines using up and down arrow keys and this makes multi-line input actually a viable thing to use 4 - it is now possible to use curses to drive LLDB (please try the "gui" command) We will need to deal with and fix any buildbot failures and tests and arise now that input/output and error are correctly hooked up in all cases. llvm-svn: 200263
* 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
OpenPOWER on IntegriCloud