summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
* Fix for expression/breakpoint setting of gnu indirect functions.Matt Kopec2013-04-221-1/+25
| | | | | | Do this until we are able to resolve these symbols to their actual implementations without needing runtime support. llvm-svn: 180029
* Fixed the expression parser's handling of resultSean Callanan2013-04-201-15/+40
| | | | | | | | | | and persistent variables so that they are not treated as remaining in the target process (i.e., having live data) when the process does not allow persistent allocations (e.g., when there is no process or in the case of kernel core files). llvm-svn: 179919
* Fixed an error message.Sean Callanan2013-04-201-1/+1
| | | | llvm-svn: 179918
* <rdar://problem/13697881>Greg Clayton2013-04-204-55/+98
| | | | | | Fixed the GDB remote with the python OS plug-in to not show core threads when they aren't desired and also to have the threads "to the right thing" when continuing. llvm-svn: 179912
* Make sure file rangle integers are large enough for very large core files.Greg Clayton2013-04-201-1/+1
| | | | llvm-svn: 179910
* Fixed being able to mmap an entire file by letting the default args "do the ↵Greg Clayton2013-04-201-1/+2
| | | | | | right thing". llvm-svn: 179909
* Change my patch to TargetList::CreateTarget to only tryJason Molenda2013-04-191-1/+5
| | | | | | | | realpathing the executable binary if we fail to find a binary and if it starts with a ~ character, based on feedback from Greg Clayton. llvm-svn: 179904
* Fixed some linux buildbot warnings.Greg Clayton2013-04-1913-36/+56
| | | | llvm-svn: 179892
* Fixed two problems when reading constant/registerSean Callanan2013-04-192-2/+19
| | | | | | | | | | | | | | variables in the ValueObject code: - Report an error if the variable does not have a valid address. - Return the contents of the data to GetData(), even if the value is constant. <rdar://problem/13690855> llvm-svn: 179876
* Simplified the management of the data buffer forSean Callanan2013-04-191-35/+50
| | | | | | | | an Allocation to reduce heap fragmentation and make the code less brittle (and to make some buildbots happier). llvm-svn: 179868
* Provided a variant of ReadCStringFromMemory that supports null terminators ↵Ashok Thirumurthi2013-04-192-4/+61
| | | | | | | | | | | | | | | | | | of any character width. This prevents unbounded reads (i.e. reads of GetMaximumSizeOfStringSummary() bytes) from causing test failures (i.e. due to ptrace EIO or EFAULT on Linux). Note that ReadCStringFromMemory is marked as deprecated because the loop that calls ReadMemory does not continue until the string has been completely read. The expected behavior is to read until until max_bytes or a null terminator. Note: As discussed on lldb-dev, further testing will be performed with ReadStringFromMemory before further changes are made for users of ReadCStringFromMemory. Thanks to Enrico, Matt and Andy for their review feedback. llvm-svn: 179857
* Removed 2800+ lines of code that no longer do anythingSean Callanan2013-04-192-2373/+19
| | | | | | | now that the IR interpreter and the JIT share the same materialization codepaths. llvm-svn: 179842
* Optimized the way breakpoint conditions are evaluated.Sean Callanan2013-04-194-78/+184
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the options for a breakopint or its locations stored only the text of the breakpoint condition (ironically, they used ClangUserExpression as a glorified std::string) and, each time the condition had to be evaluated in the StopInfo code, the expression parser would be invoked via a static method to parse and then execute the expression. I made several changes here: - Each breakpoint location now has its own ClangUserExpressionSP containing a version of the breakpoint expression compiled for that exact location. - Whenever the breakpoint is hit, the breakpoint condition expression is simply re-run to determine whether to stop. - If the process changes (e.g., it's re-run) or the source code of the expression changes (we use a hash so as to avoid doing string comparisons) the ClangUserExpressionSP is re-generated. This should improve performance of breakpoint conditions significantly, and takes advantage of the recent expression re-use work. llvm-svn: 179838
* Reverted 179810, which breaks the expressionSean Callanan2013-04-191-3/+1
| | | | | | parser. llvm-svn: 179832
* Change TargetList::CreateTarget to realpath the c-string filename of theJason Molenda2013-04-191-1/+1
| | | | | | | executable -- if I do "(lldb) file ~/bin/exe" that tilde expansion needs to take place here. llvm-svn: 179831
* Made IRMemoryMap::FindSpace a little cleverer,Sean Callanan2013-04-191-40/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | and made attempts to allocate memory in the process fall back to FindSpace and just allocate memory on the host (but with real-looking pointers, hence FindSpace) if the process doesn't allow allocation. This allows expressions to run on processes that don't support allocation, like core files. This introduces an extremely rare potential problem: If all of the following are true: - The Process doesn't support allocation; - the user writes an expression that refers to an address that does not yet map to anything, or is dynamically generated (e.g., the result of calling a function); and - the randomly-selected address for the static data for that specific expression runs into the address the user was expecting to work with; then dereferencing the pointer later results in the user seeing something unexpected. This is unlikely but possible; as a future piece of work, we should have processes be able to hint to the expression parser where it can allocate temporary data of this kind. llvm-svn: 179827
* Remove an unneeded local var, a missing return statement in kernel search ↵Jason Molenda2013-04-191-4/+2
| | | | | | code, thanks to Greg Clayton for finding these. llvm-svn: 179822
* Split Linux-specific and OS X specific stuff. Add include_directoriesFilipe Cabecinhas2013-04-193-6/+16
| | | | | | Only add the -std=c++11 flag when needed, don't touch current flags. llvm-svn: 179821
* More fallout unique_ptr changes for from ↵Greg Clayton2013-04-181-1/+1
| | | | | | http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/3565. llvm-svn: 179815
* Try and unblock issue found in: ↵Greg Clayton2013-04-181-1/+3
| | | | | | http://lab.llvm.org:8011/builders/lldb-x86_64-linux/builds/3564 llvm-svn: 179810
* After discussing with Chris Lattner, we require C++11, so lets get rid of ↵Greg Clayton2013-04-1874-164/+164
| | | | | | the macros and just use C++11. llvm-svn: 179805
* This commit changes the way LLDB executes userSean Callanan2013-04-189-422/+747
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Try to unbreak the lldb-x86_64-linux buildbot after recent ↵Greg Clayton2013-04-181-15/+15
| | | | | | std::auto_ptr/std::unique_ptr changes. llvm-svn: 179799
* Missed some cases when switching over to using our STD_UNIQUE_PTR macros.Greg Clayton2013-04-181-1/+1
| | | | llvm-svn: 179796
* Make KQueue import the header in the correct path.Filipe Cabecinhas2013-04-181-1/+1
| | | | llvm-svn: 179795
* <rdar://problem/13627061>Greg Clayton2013-04-181-15/+15
| | | | | | Fixed an issue where "platform process list" help message has options displayed a couple dozen times. llvm-svn: 179792
* <rdar://problem/13678882>Greg Clayton2013-04-181-1/+2
| | | | | | Disable "source info" until actually implemented. llvm-svn: 179787
* Since we use C++11, we should switch over to using std::unique_ptr when ↵Greg Clayton2013-04-1872-204/+219
| | | | | | | | 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
* Re-enable m_private_run_lock changes from 179329, but only for Apple hosted ↵Greg Clayton2013-04-181-9/+29
| | | | | | builds so it doesn't break the buildbots. We will try and work the issues out in the Apple build before enabling this feature for everyone. llvm-svn: 179772
* Revert of r179378 and r179329, which introduce a private thread lock around ↵Ashok Thirumurthi2013-04-181-27/+11
| | | | | | | | thread enumeration, in order to prevent consistent hangs on all 3 LLDB buildbots. llvm-svn: 179759
* Fixed a few m_private_run_lock issues when attaching and also fixed the ↵Greg Clayton2013-04-181-2/+7
| | | | | | process to not try to restart the process if the process is exited, crashed or detached. Partial patch from Carlo Kok. llvm-svn: 179738
* Fix for regression in TestCPPStaticMethods.py due to refactoring in clang.Ashok Thirumurthi2013-04-171-3/+4
| | | | | | | | - Specify SC_Static given DIE attributes for static methods and operators. Thanks to Wei Pan for his review and the help with root-causing. llvm-svn: 179727
* Fix build on LinuxDaniel Malea2013-04-173-0/+26
| | | | | | | - add a workaround header to define uuid_t on platforms that need it - unbreak remote debugging of mac os x apps llvm-svn: 179710
* Revert 179694 -- it breaks remote debugging of mac os x targets for some folkDaniel Malea2013-04-174-21/+8
| | | | | | - will commit a different workaround momentarily llvm-svn: 179705
* Added a new API to the IRInterpreter (the old APISean Callanan2013-04-171-0/+756
| | | | | | | | | | | | will be gone soon!) that lets it interpret a function using just an llvm::Module, an llvm::Function, and a MemoryMap. Also added an API to IRExecutionUnit to get at its llvm::Function, so that the IRInterpreter can work with it. llvm-svn: 179704
* Made the IRInterpreter's methods static, sinceSean Callanan2013-04-172-32/+23
| | | | | | it doesn't actually hold any important state. llvm-svn: 179702
* Made the IRInterpreter be able to operate withoutSean Callanan2013-04-172-50/+22
| | | | | | | | | a ClangExpressionDeclMap. Any functions that require value resolution etc. fail if the ClangExpressionDeclMap isn't present - which is exactly what is desired. llvm-svn: 179695
* Fix Linux build of LLDBDaniel Malea2013-04-174-8/+21
| | | | | | | - conditionally build mac-specific plugins only on mac (PluginObjectFileMachO, PluginDynamicLoaderDrawinKernel and PluginDynamicLoaderMacOSXDYLD) - clean up warnings by ignoring deprecated declarations (auto_ptr for example) llvm-svn: 179694
* Removed the "expr" alias for "expression," whichSean Callanan2013-04-171-3/+1
| | | | | | | is entirely unnecessary and confuses the command interpreter when the user types "exp". llvm-svn: 179691
* Updated the IRInterpreter to work with anSean Callanan2013-04-173-598/+466
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IRMemoryMap rather than through its own memory abstraction. This considerably simplifies the code, and makes it possible to run the IRInterpreter multiple times on an already-parsed expression in the absence of a ClangExpressionDeclMap. Changes include: - ClangExpressionDeclMap's interface methods for the IRInterpreter now take IRMemoryMap arguments. They are not long for this world, however, since the IRInterpreter will soon be working with materialized variables. - As mentioned above, removed the Memory class from the IR interpreter altogether. It had a few functions that remain useful, such as keeping track of Values that have been placed in memory, so I moved those into methods on InterpreterStackFrame. - Changed IRInterpreter to work with lldb::addr_t rather than Memory::Region as its primary currency. - Fixed a bug in the IRMemoryMap where it did not report correct address byte size and byte order if no process was present, because it was using Target::GetDefaultArchitecture() rather than Target::GetArchitecture(). - Made IRMemoryMap methods clear the Errors they receive before running. Having to do this by hand is just annoying. The testsuite seems happy with these changes, but please let me know if you see problems (especially in use cases without a process). llvm-svn: 179675
* Modified the IRInterpreter to take an IRMemoryMap.Sean Callanan2013-04-162-5/+12
| | | | | | | | It doesn't use it yet; the next step is to make it use the IRMemoryMap instead of its own conjured-up Memory class. llvm-svn: 179650
* Flipped the big switch: LLDB now uses the new Sean Callanan2013-04-166-922/+200
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix a pointer arithmetic thinko in ObjectFileMachO::GetLLDBSharedCacheUUID().Jason Molenda2013-04-161-1/+1
| | | | llvm-svn: 179643
* Make sure all the threads get a chance to compute their StopInfo's before we ↵Jim Ingham2013-04-161-1/+12
| | | | | | | | | | | start running ShouldStop on the threads, which might destroy information needed to correctly compute another thread's StopInfo. <rdar://problem/13664026> llvm-svn: 179641
* Add warning messages for the cases where the inferior process shared cacheJason Molenda2013-04-161-5/+10
| | | | | | | | | differs from lldb's own shared cache, and where the inferior process shared cache does not match up with the on-disk shared cache file. Simplify the code where lldb gets its own shared cache uuid a little bit. llvm-svn: 179633
* Remove a debug print statement that I left in.Greg Clayton2013-04-161-2/+0
| | | | llvm-svn: 179623
* <rdar://problem/13657900>Greg Clayton2013-04-161-0/+21
| | | | | | Special handling for file descriptor connections that are tty files. llvm-svn: 179613
* <rdar://problem/13468295>Greg Clayton2013-04-161-13/+24
| | | | | | Show an error message when we have a corrupt mach-o file where the LC_SEGMENT or LC_SEGMENT_64 load command have file offsets or file offsets + sizes that extend beyond the end of the file. llvm-svn: 179605
* Update the dyld_all_image_infos size definition inJason Molenda2013-04-161-1/+4
| | | | | | | DynamicLoaderMacOSXDYLD::ReadAllImageInfosStructure for version 13 of that structure. llvm-svn: 179584
* The dyld_all_image_infos structure, at version 13 and higher, hasJason Molenda2013-04-162-13/+127
| | | | | | | | | | | | a UUID for the shared cache libraries that can be used to confirm that one process' shared cache is the same as another, or that a process' in-memory shared cache is a match for a given on-disk dyld_shared_cache binary file. Use these UUIDs to catch some uncommon problems when the shared caches are being changed for debug purposes. <rdar://problem/13524467> llvm-svn: 179583
OpenPOWER on IntegriCloud