summaryrefslogtreecommitdiffstats
path: root/lldb/source/Expression
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix the test suite after the changes made in revision 196616 exposed issues ↵Greg Clayton2013-12-101-1/+3
| | | | | | | | in the test suite. We must make sure that all ValueObject objects always contain a valid target. llvm-svn: 196983
* Fix the build failure of lldb wrt clang recent change. Patch by Todd FialaSylvestre Ledru2013-12-051-1/+0
| | | | llvm-svn: 196483
* Fixed printf warnings. The GetByteSize() results return uint64_t values, not ↵Greg Clayton2013-11-131-1/+4
| | | | | | size_t values. llvm-svn: 194587
* Increase log detail for size mismatch in EntityVariable::MaterializeEd Maste2013-11-111-1/+1
| | | | llvm-svn: 194413
* Changed the ABIs and ClangFunction to take aSean Callanan2013-11-082-8/+18
| | | | | | | | | | | | | llvm::ArrayRef of arguments rather than taking a fixed number of possibly-NULL pointers to arguments. Also changed ClangFunction::GetThreadPlanToCallFunction to take the address of the argument struct by value instead of by reference, since it doesn't actually modify the value passed into it. llvm-svn: 194232
* This patch does a couple of things. Jim Ingham2013-11-072-173/+58
| | | | | | | | | | | | | | | | | | | | | | It completes the job of using EvaluateExpressionOptions consistently throughout the inferior function calling mechanism in lldb begun in Greg's patch r194009. It removes a handful of alternate calls into the ClangUserExpression/ClangFunction/ThreadPlanCallFunction which were there for convenience. Using the EvaluateExpressionOptions removes the need for them. Using that it gets the --debug option from Greg's patch to work cleanly. It also adds another EvaluateExpressionOption to not trap exceptions when running expressions. You shouldn't use this option unless you KNOW your expression can't throw beyond itself. This is: <rdar://problem/15374885> At present this is only available through the SB API's or python. It fixes a bug where function calls would unset the ObjC & C++ exception breakpoints without checking whether they were set by somebody else already. llvm-svn: 194182
* <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
* Added a "--debug" option to the "expression" command. Greg Clayton2013-11-041-50/+27
| | | | | | | | Cleaned up ClangUserExpression::Evaluate() to have only one variant that takes a "const EvaluateExpressionOptions& options" instead of taking many arguments. The "--debug" option is designed to allow you to debug your expression by stopping at the first instruction (it enables --ignore-breakpoints=true and --unwind-on-error=false) and allowing you to step through your JIT code. It needs to be more integrated with the thread plan, so I am checking this in so Jim Ingham can make it happen. llvm-svn: 194009
* Roll back the changes I made in r193907 which created a new FrameJason Molenda2013-11-045-37/+37
| | | | | | | | | | pure virtual base class and made StackFrame a subclass of that. As I started to build on top of that arrangement today, I found that it wasn't working out like I intended. Instead I'll try sticking with the single StackFrame class -- there's too much code duplication to make a more complicated class hierarchy sensible I think. llvm-svn: 193983
* It is no longer necessary to opt out of pretty stack traces.Filip Pizlo2013-11-041-2/+0
| | | | llvm-svn: 193972
* Add a new base class, Frame. It is a pure virtual function whichJason Molenda2013-11-025-37/+37
| | | | | | | | | | | | | | | | | | | | | defines a protocol that all subclasses will implement. StackFrame is currently the only subclass and the methods that Frame vends are nearly identical to StackFrame's old methods. Update all callers to use Frame*/Frame& instead of pointers to StackFrames. This is almost entirely a mechanical change that touches a lot of the code base so I'm committing it alone. No new functionality is added with this patch, no new subclasses of Frame exist yet. I'll probably need to tweak some of the separation, possibly moving some of StackFrame's methods up in to Frame, but this is a good starting point. <rdar://problem/15314068> llvm-svn: 193907
* Fix the format warnings.Sylvestre Ledru2013-10-313-6/+6
| | | | | | | | | | In almost all cases, the misuse is about "%lu" being used instead of the correct "%zu" (even though these are compatible on 64-bit platforms in practice). There are even a couple of cases where "%ld" (ie., signed int) is used instead of "%zu", and one where "%lu" is used instead of "%" PRIu64. Fixes bug #17551. Patch by "/dev/humancontroller" llvm-svn: 193832
* <rdar://problem/14496092>Greg Clayton2013-10-311-5/+18
| | | | | | Fixes from code review by Jim Ingham that reinstate preferring an external vs non-external symbol when finding function addresses. llvm-svn: 193761
* <rdar://problem/14496092>Greg Clayton2013-10-301-22/+41
| | | | | | Fixed the expression parser to be able to iterate across all function name matches that it finds when it is looking for the address of a function that the IR is looking for. Also taught it to deal with reexported symbols. llvm-svn: 193716
* Simplified the code that materializes a variable,Sean Callanan2013-10-221-9/+3
| | | | | | obviating the need to create a new ValueObject. llvm-svn: 193191
* Fixes to get LLDB building on Windows again.Deepak Panickal2013-10-221-2/+2
| | | | llvm-svn: 193159
* Update ResolveFunctionPointers to build after the changesJason Molenda2013-10-221-2/+2
| | | | | | of llvm r193091. Thanks to Ed Maste for narrowing it down. llvm-svn: 193140
* <rdar://problem/14496092>Greg Clayton2013-10-211-16/+66
| | | | | | | | Fixed an issue with reexported symbols on MacOSX by adding support for symbols re-exporting symbols. There is now a new symbol type eSymbolTypeReExported which contains a new name for the re-exported symbol and the new shared library. These symbols are only used when a symbol is re-exported as a symbol under a different name. Modified the expression parser to be able to deal with finding the re-exported symbols and track down the actual symbol it refers to. llvm-svn: 193101
* Added support for reading thread-local storage variables, as defined using ↵Richard Mitton2013-10-171-6/+70
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the __thread modifier. To make this work this patch extends LLDB to: - Explicitly track the link_map address for each module. This is effectively the module handle, not sure why it wasn't already being stored off anywhere. As an extension later, it would be nice if someone were to add support for printing this as part of the modules list. - Allow reading the per-thread data pointer via ptrace. I have added support for Linux here. I'll be happy to add support for FreeBSD once this is reviewed. OS X does not appear to have __thread variables, so maybe we don't need it there. Windows support should eventually be workable along the same lines. - Make DWARF expressions track which module they originated from. - Add support for the DW_OP_GNU_push_tls_address DWARF opcode, as generated by gcc and recent versions of clang. Earlier versions of clang (such as 3.2, which is default on Ubuntu right now) do not generate TLS debug info correctly so can not be supported here. - Understand the format of the pthread DTV block. This is where it gets tricky. We have three basic options here: 1) Call "dlinfo" or "__tls_get_addr" on the inferior and ask it directly. However this won't work on core dumps, and generally speaking it's not a good idea for the debugger to call functions itself, as it has the potential to not work depending on the state of the target. 2) Use libthread_db. This is what GDB does. However this option requires having a version of libthread_db on the host cross-compiled for each potential target. This places a large burden on the user, and would make it very hard to cross-debug from Windows to Linux, for example. Trying to build a library intended exclusively for one OS on a different one is not pleasant. GDB sidesteps the problem and asks the user to figure it out. 3) Parse the DTV structure ourselves. On initial inspection this seems to be a bad option, as the DTV structure (the format used by the runtime to manage TLS data) is not in fact a kernel data structure, it is implemented entirely in useerland in libc. Therefore the layout of it's fields are version and OS dependent, and are not standardized. However, it turns out not to be such a problem. All OSes use basically the same algorithm (a per-module lookup table) as detailed in Ulrich Drepper's TLS ELF ABI document, so we can easily write code to decode it ourselves. The only question therefore is the exact field layouts required. Happily, the implementors of libpthread expose the structure of the DTV via metadata exported as symbols from the .so itself, designed exactly for this kind of thing. So this patch simply reads that metadata in, and re-implements libthread_db's algorithm itself. We thereby get cross-platform TLS lookup without either requiring third-party libraries, while still being independent of the version of libpthread being used. Test case included. llvm-svn: 192922
* Implemented TruncInst in the IRInterpreter.Sean Callanan2013-10-111-0/+37
| | | | | | <rdar://problem/15188389> llvm-svn: 192489
* This reverts r192484, which I really shouldn't have checked in. Apologies.Richard Mitton2013-10-111-1/+1
| | | | llvm-svn: 192488
* Fixed bad return code, which would cause invalid expressions to silently fail.Richard Mitton2013-10-111-1/+1
| | | | llvm-svn: 192484
* Fixed a leak of ASTStructExtractors and alsoSean Callanan2013-10-102-10/+6
| | | | | | | | | made sure we don't keep around no-longer-valid ASTTransformers. <rdar://problem/15182379> llvm-svn: 192333
* Fixed a bug in the Materializer where we sent theSean Callanan2013-10-091-1/+1
| | | | | | | | wrong information to ValueObjectConstResult. <rdar://problem/15101795> llvm-svn: 192264
* Fix build break: clang no longer supports -ast-dump-xml.Richard Smith2013-10-081-1/+0
| | | | llvm-svn: 192155
* Changed the bool conversion operator on ConstStringSean Callanan2013-10-031-2/+2
| | | | | | | | | | | | | | | to be explicit, to prevent horrid things like std::string a = ConstString("foo") from taking the path ConstString -> bool -> char -> std::string. This fixes, among other things, ClangFunction. <rdar://problem/15137989> llvm-svn: 191934
* Fix build after LLVM memory management API changes.Filip Pizlo2013-10-021-3/+5
| | | | llvm-svn: 191806
* Convert ClangASTType::GetTypeName over to return a ConstString to be ↵Jim Ingham2013-09-271-1/+1
| | | | | | | | consistent with the other "Get*TypeName" functions. llvm-svn: 191556
* Convert to UNIX line endings.Joerg Sonnenberger2013-09-251-23/+23
| | | | llvm-svn: 191367
* Use a StreamString to fix the endianness inSean Callanan2013-09-171-3/+10
| | | | | | | | constants before using them in the IR interpreter. Patch by Félix Cloutier. llvm-svn: 190877
* Remove a spurious comment.Jim Ingham2013-09-051-1/+0
| | | | llvm-svn: 190027
* Remove an unused ivar.Jim Ingham2013-09-051-1/+0
| | | | llvm-svn: 190026
* Remove some unused #includes.Jim Ingham2013-09-051-4/+0
| | | | llvm-svn: 190025
* Report all methods in an Objective-C class thatSean Callanan2013-09-041-22/+25
| | | | | | | | | | have a certain name, not just the first. This is useful if a class method and an instance method have the same name. <rdar://problem/14872081> llvm-svn: 190008
* 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
* Cleanup/rearrange includes:Virgile Bello2013-08-281-0/+4
| | | | | | | - factorize unistd.h and stdbool.h in lldb-types.h. - Add <functional> and <string> where required. llvm-svn: 189477
* MingW compilation (windows). Includes various refactoring to improve ↵Virgile Bello2013-08-231-3/+3
| | | | | | portability. llvm-svn: 189107
* Make sure that ClangExpressionDeclMap doesn'tSean Callanan2013-08-231-1/+6
| | | | | | | | | | | | | | live beyont parsing. This is important because all the ClangASTImporter::Minions for a parser's ASTContext are cleared when ClangExpressionDeclMap is deleted. This resolves many hard-to-reproduce crashes, especially ones involving breakpoint conditions. <rdar://problem/14775391> llvm-svn: 189080
* clean up about 22 warnings messagesMichael Sartain2013-08-072-3/+3
| | | | llvm-svn: 187900
* Initialize m_leak member variable.Michael Sartain2013-08-061-8/+8
| | | | llvm-svn: 187822
* Reverts r187449 (report_fatal_error) in favor of a log message sinceAshok Thirumurthi2013-07-311-3/+3
| | | | | | | | the extra check introduces 22 new test failures with the LLDB clang buildbot. Note that the unhandled DWARF_OP codes in DWARFExpression::Evaluate don't cause test failures if the check is ignored. llvm-svn: 187480
* The DisassemblerLLVMC has a retain cycle - the InstructionLLVMC's contained ↵Jim Ingham2013-07-311-5/+7
| | | | | | | | | | | | in its instruction list have a shared pointer back to their DisassemblerLLVMC. This checkin force clears the InstructionList in all the places we use the DisassemblerSP to stop the leaking for now. I'll go back and fix this for real when I have time to do so. <rdar://problem/14581918> llvm-svn: 187473
* Add a default case to the LLVM expression opcode switch statementDaniel Malea2013-07-301-0/+4
| | | | | | - better than failing silently next time the DWARF standard introduces new opcodes! llvm-svn: 187449
* Adds a DW_OP_call_frame_cfa handler when evaluating DWARF 3/4 expressionsAshok Thirumurthi2013-07-291-0/+32
| | | | | | | | | | | | | | in LLDB that load the canonical frame address rather than a location list. - Handles the simple case where a CFA can be pulled from the current stack frame. - Fixes more than one hundred failing tests with gcc 4.8! TODO: Use UnwindPlan::GetRowForFunctionOffset if the DWARFExpression needs to be evaluated in a context analogous to a virtual unwind (perhaps using RegisterContextLLDB). - Also adds some comments to DWARFCallFrameInfo whenever I got confused. llvm-svn: 187361
* Remove builtin attribute from calls whose targets we replaceStefanus Du Toit2013-07-231-0/+14
| | | | | | | | | | | If we are replacing a function with the nobuiltin attribute, it may be called with the builtin attribute on call sites. Remove any such attributes since it's illegal to have a builtin call to something other than a nobuiltin function. This fixes the current buildbot breakage (where LLDB crashes on "expression new foo(42)"). llvm-svn: 186990
* Fixed a problem in IRForTarget where we would notSean Callanan2013-07-151-2/+9
| | | | | | | | | | | delete a constant after we replaced it with a dynamically-computed value. Also ensured that we replace all users of the constant if there are multiple ones. Added a testcase. <rdar://problem/14379043> llvm-svn: 186363
* Actually use the return value we get back whenSean Callanan2013-07-151-15/+10
| | | | | | | | | creating a persistent variable, rather than making a (potentially expensive) lookup by name. <rdar://problem/14337653> llvm-svn: 186337
* Modified the expression parser to only try toSean Callanan2013-07-122-5/+15
| | | | | | | | | | | | | | | write to registers if they were modified in the expression. This eliminates spurious errors if the register can't be written to but the expression didn't write to it anyway. Also improved error handling for the materializer to make "couldn't materialize struct" errors more informative. <rdar://problem/14322579> llvm-svn: 186228
* Huge change to clean up types.Greg Clayton2013-07-119-983/+414
| | | | | | | | A long time ago we start with clang types that were created by the symbol files and there were many functions in lldb_private::ClangASTContext that helped. Later we create ClangASTType which contains a clang::ASTContext and an opauque QualType, but we didn't switch over to fully using it. There were a lot of places where we would pass around a raw clang_type_t and also pass along a clang::ASTContext separately. This left room for error. This checkin change all type code over to use ClangASTType everywhere and I cleaned up the interfaces quite a bit. Any code that was in ClangASTContext that was type related, was moved over into ClangASTType. All code that used these types was switched over to use all of the new goodness. llvm-svn: 186130
* Cleanup on the unified section list changes. Main changes are:Greg Clayton2013-07-101-7/+2
| | | | | | | | | | | | | | | - ObjectFile::GetSymtab() and ObjectFile::ClearSymtab() no longer takes any flags - Module coordinates with the object files and contain a unified section list so that object file and symbol file can share sections when they need to, yet contain their own sections. Other cleanups: - Fixed Symbol::GetByteSize() to not have the symbol table compute the byte sizes on the fly - Modified the ObjectFileMachO class to compute symbol sizes all at once efficiently - Modified the Symtab class to store a file address lookup table for more efficient lookups - Removed Section::Finalize() and SectionList::Finalize() as they did nothing - Improved performance of the detection of symbol files that have debug maps by excluding stripped files and core files, debug files, object files and stubs - Added the ability to tell if an ObjectFile has been stripped with ObjectFile::IsStripped() (used this for the above performance improvement) llvm-svn: 185990
OpenPOWER on IntegriCloud