summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
* Stack unwinding emulation: handle adjustment of FPTamas Berghammer2016-02-191-1/+16
| | | | | | | | | | | | | | | | | | | | This change is improving the instruction emulation based unwinding to handle when the frame pointer is adjusted (increment/decrement) after it has been initialized. The situation can occur in the prologue of some function where FP is adjusted before it is copied back to SP. Example code (thumb, generated by gcc 4.8): < +0>: push {r4, r7, lr} < +2>: sub sp, #0x14 < +4>: add r7, sp, #0x0 ... <+50>: adds r7, #0x14 ; The CL fixes the handling of this instruction <+52>: mov sp, r7 ; Previously unwinding from here was broken <+54>: pop {r4, r7, pc} Differential revision: http://reviews.llvm.org/D17295 llvm-svn: 261318
* This patch stops lldb from loading a .lldbinit file from the currentJason Molenda2016-02-194-5/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | working directory by default -- a typical security problem that we need to be more conservative about. It adds a new target setting, target.load-cwd-lldbinit which may be true (always read $cwd/.lldbinit), false (never read $cwd/.lldbinit) or warn (warn if there is a $cwd/.lldbinit and don't read it). The default is set to warn. If this is met with unhappiness, we can look at changing the default to true (to match current behavior) on a different platform. This does not affect reading of ~/.lldbinit - that will still be read, as before. If you run lldb in your home directory, it will not warn about the presence of a .lldbinit file there. I had to add two SB API - SBHostOS::GetUserHomeDirectory and SBFileSpec::AppendPathComponent - for the lldb driver code to be able to get the home directory path in an OS neutral manner. The warning text is There is a .lldbinit file in the current directory which is not being read. To silence this warning without sourcing in the local .lldbinit, add the following to the lldbinit file in your home directory: settings set target.load-cwd-lldbinit false To allow lldb to source .lldbinit files in the current working directory, set the value of this variable to true. Only do so if you understand and accept the security risk. <rdar://problem/24199163> llvm-svn: 261280
* Make sure code that is in the middle of figuring out the correct architectureJim Ingham2016-02-182-21/+32
| | | | | | | | | on attach uses the architecture it has figured out, rather than the Target's architecture, which may not have been updated to the correct value yet. <rdar://problem/24632895> llvm-svn: 261279
* Fix Clang-tidy modernize-use-nullptr and modernize-use-default warnings in ↵Eugene Zelenko2016-02-181-191/+147
| | | | | | source/Commands/CommandObjectBreakpoint.cpp; other minor fixes. llvm-svn: 261272
* Fix a typo in FormatCache.cpp such that the cache would potentially return ↵Enrico Granata2016-02-181-1/+1
| | | | | | an invalid format in some cases llvm-svn: 261246
* Fix Clang-tidy modernize-use-nullptr warnings in some files in ↵Eugene Zelenko2016-02-189-200/+155
| | | | | | source/Target; other minor fixes. llvm-svn: 261242
* Fix OSX cmake buildEwan Crawford2016-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | Commit r260721(http://reviews.llvm.org/D17182) introduced the following error when building for OSX using cmake: Undefined symbols for architecture x86_64: "_PyInit__lldb", referenced from: -exported_symbol[s_list] command line option ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) Adding '*' to the regex solves this problem, since it makes the symbol optional. Reviewers: sivachandra, zturner, labath Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17384 llvm-svn: 261227
* [LLDB][MIPS] Provide CPU string to compiler for appropriate code generation ↵Bhushan D. Attarde2016-02-182-4/+64
| | | | | | | | | | | | | | | 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
* Improve the handling of missing elf symtab and missing symbol sizesTamas Berghammer2016-02-186-147/+120
| | | | | | | | | | | | | | | * Generate artificial symbol names from eh_fame during symbol parsing so these symbols are already present when we calcualte the size of the symbols where 0 is specified. * Fix symbol size calculation for the last symbol in the file where it have to last until the end of the parent section. This is the re-commit of the original change after fixing some test failures on OSX. Differential revision: http://reviews.llvm.org/D16996 llvm-svn: 261205
* [Renderscript] Refactor .rs.info parser.Aidan Dodds2016-02-181-52/+66
| | | | | | This patch refactors the .rs.info table parser so that its more in line with the current language runtime code. llvm-svn: 261202
* Fix Clang-tidy modernize-use-nullptr warnings; other minor fixes.Eugene Zelenko2016-02-1811-253/+170
| | | | llvm-svn: 261179
* Apple simulator platforms don't have a shared cache to load Objective-C ↵Enrico Granata2016-02-171-8/+2
| | | | | | | | | | | class information from This code was doing the right thing for the iOS simulator, but not other simulator platforms Fix it by making the warning not happen for all platforms whose name ends in "-simulator" Since this code lives in AppleObjCRuntimeV2.cpp, this already only applies to Apple platforms by definition, so I am not too worried about conflicts with other vendors llvm-svn: 261165
* Revert "Use BKPT instead of UDF for arm/thumb breakpoints"Tamas Berghammer2016-02-162-8/+10
| | | | | | | | | | | This reverts commit 293c18e067d663e0fe93e6f3d800c2a4bfada2b0. The BKPT instruction generates SIGBUS instead of SIGTRAP in the Linux kernel on Nexus 6 - 5.1.1 (kernel version 3.10.40). Revert the CL until we can figure out how can we hanble the SIGBUS or how to get back a SIGTRAP using the BKPT instruction. llvm-svn: 260969
* Fix buildbot failure because I got an include path wrong.Jason Molenda2016-02-161-1/+1
| | | | llvm-svn: 260932
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-1625-29/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Silence some clang warningsSaleem Abdulrasool2016-02-151-13/+13
| | | | | | Silences -Wmissing-brace and -Wformat-pedantic warnings from clang on Linux. NFC. llvm-svn: 260914
* Refinement of r260624. It is possible somebody might try to add to the mapJim Ingham2016-02-151-6/+20
| | | | | | | | while we are finalizing its elements. Prevent that. <rdar://problem/24554920> llvm-svn: 260909
* 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
* Additional fix to my change in r259983 to handle theJason Molenda2016-02-131-5/+11
| | | | | | | | | | | case where a core file has a kernel binary and a user process dyld in the same one. Without this, we were always picking the dyld and trying to process it as a kernel. <rdar://problem/24446112> llvm-svn: 260803
* Adding an SBThread::StepInto that takes an end-line, also moved the code ↵Jim Ingham2016-02-133-64/+101
| | | | | | | | that figures out the address range for the step to SymbolContext. llvm-svn: 260772
* Removed many JIT workarounds from IRForTarget.Sean Callanan2016-02-135-1013/+89
| | | | | | | | | | | | | | | | | | | | | | 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
* Fix stripping of _ when looking for symbols in IRExecutionUnit.Sean Callanan2016-02-121-74/+18
| | | | | | | | | | | | | Previously we would try both versions of a symbol -- the one with _ in it and the one without -- in all cases, because we didn't know what the current platform's policy was. However, stripping _ is only necessary on platforms where _ is the prefix for global symbols. There's an API that does this, though, on llvm::DataLayout, so this patch fixes IRExecutionUnit to use that API to determine whether or not to strip _ from the symbol or not. llvm-svn: 260767
* Remove an unnecessary includeEnrico Granata2016-02-121-1/+0
| | | | llvm-svn: 260761
* Data formatter support for libc++ std::atomic<T>Enrico Granata2016-02-125-5/+158
| | | | | | | | | | On libc++ std::atomic is a fairly simple data type (layout wise, at least), wrapping actual contents in a member variable named "__a_" All the formatters are doing is "peel away" this intermediate layer and exposing user data as direct children or values of the std::atomic root variable Fixes rdar://24329405 llvm-svn: 260752
* Disable recognition of "using" declarations at translation-unit level.Sean Callanan2016-02-121-0/+9
| | | | | | | | | | | | | | | Currently CountDeclLevels uses the ASTs which have no distinction between separate translation units. If one .o file has a "using" declaration at translation unit level, that "using" declaration will be in the same translation unit as functions from other .o files in the same module. This leads to erroneous name conflicts as the CountDeclLevels-based function filtering logic accepts too many fucntions. In the future we will identify the translation units for top-level Decls more reliably and restore that functionality. There's a TODO to that effect in the code. llvm-svn: 260747
* IRInterpreter now recognizes expressions with constants it doesn't handle.Sean Callanan2016-02-121-0/+50
| | | | | | | | | | | | | If an instruction has a constant that IRInterpreter doesn't know how to deal with (say, an array constant, because we can't materialize it to APInt) then we used to ignore that and only fail during expression execution. This is annoying because if IRInterpreter had just returned false from CanInterpret(), the JIT would have been used. Now the IRInterpreter checks constants as part of CanInterpret(), so this should hopefully no longer be an issue. llvm-svn: 260735
* Centralized symbol lookup in IRExecutionUnit, and fixed the code model.Sean Callanan2016-02-122-67/+336
| | | | | | | | | | | | | 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
* Adjust for Python-3.Siva Chandra2016-02-121-0/+1
| | | | | | | | | | | | | | | Summary: This does not yet give us a clean testsuite run but it does help with: 1. Actually building on linux 2. Run the testsuite with over 70% tests passing on linux. Reviewers: tfiala, labath, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17182 llvm-svn: 260721
* Objective-C++ is a kind of C++.Sean Callanan2016-02-121-0/+1
| | | | llvm-svn: 260715
* Make Target::CalculateProcess() return a sensible result.Sean Callanan2016-02-121-1/+1
| | | | | | | | The Calculate* functions in general should not derive any information that isn't implicit, but for Target the process pointer is a member so it's fine to return it for CalculateProcess(). llvm-svn: 260713
* The data formatters for NSArray, NSDictionary and (only partially) NSSet ↵Enrico Granata2016-02-123-158/+7
| | | | | | | | | | | | | | | | | contain logic to inspect the objects without running code. However, they also contain fallback logic that - in cases where LLDB can't recognize the specific subclass - actually does run code in order to inspect those objects. The argument for this logic was that these data types are critical enough that the risk of getting it wrong is outweighed by the advantage of always providing accurate child information. Practical experience however shows that "po" - a code running data-inspection command - is quite frequently used, and not considered burdensome by users. As such, this makes the code-running fallback in the data formatters a risk that carries very little actual reward. Also, unlike the time this code was originally written, we now have accurate class information for Objective-C, and thus we are less likely to improperly identify classes. This commit removes support for the code-running fallback, and aligns the data formatters for NSArray, NSDictionary and NSSet to the general no-code-running behavior of other data formatters. While it is possible for us to add support for some subclasses that are now no longer covered by static inspection alone, this is beyond the scope of this commit. llvm-svn: 260664
* Don't crash if we have a DIE that has a DW_AT_ranges attribute and yet the ↵Greg Clayton2016-02-121-5/+13
| | | | | | | | SymbolFileDWARF doesn't have a DebugRanges. If this happens print a nice error message to prompt the user to file a bug and attach the offending DWARF file so we can get the correct compiler fixed. <rdar://problem/24458016> llvm-svn: 260626
* When calling TypeSystemMap::Clear, objects being destroyed in the process of Jim Ingham2016-02-122-18/+42
| | | | | | | | | | | | | | | | | clearing the map ended up calling back into the TypeSystemMap to do lookups. Not a good idea, and in this case it would cause a deadlock. You would only see this when replacing the target contents after an exec, and only if you had stopped before the exec, evaluated an expression, then continued on to the point where you did the exec. Fixed this by making sure the TypeSystemMap::Clear tears down the TypeSystems in the map before clearing the map. I also add an expression before exec to the TestExec.py so that we'll catch this issue if it crops up again in the future. <rdar://problem/24554920> llvm-svn: 260624
* Removed a bad assertion:Greg Clayton2016-02-111-2/+4
| | | | | | | | | | | assert(((SymbolFileDWARF*)m_ast.GetSymbolFile())->UserIDMatches(die.GetDIERef().GetUID()) && "Adding incorrect type to forward declaration map"); The problem is that "m_ast.GetSymbolFile()" can return a SymbolFileDWARFDebugMap. The code is doing the right thing if the assertion is ignored. <rdar://problem/24437972> llvm-svn: 260618
* Improve ReadRegister for RegisterContextWindowsx86Adrian McCarthy2016-02-112-30/+27
| | | | | | | | | | | | | | | | | In some circumstances (notably, certain minidumps), the thread CONTEXT does not have values for the control registers (EIP, ESP, EBP, EFLAGS). There are flags in the CONTEXT which indicate which portions are valid, but those flags weren't checked. The old code would not detect this and give a garbage value for the register. The new code will log the problem and return an error. I consolidated the error checking and logging into a helper function, which makes the big switch statement easier to read and verify. Ran tests to ensure this doesn't break anything. Manually verified that a minidump without info on the control registers now indicates the problem instead of giving bad information. Differential Review: http://reviews.llvm.org/D17152 llvm-svn: 260559
* [Renderscript] Fix typo in mips64 argument reading code.Aidan Dodds2016-02-111-1/+1
| | | | | | A typo in the mips64 argument reading code would cause register passed arguments to be truncated to 32bits. llvm-svn: 260546
* [Renderscript] Refactor target argument reading code.Aidan Dodds2016-02-112-340/+463
| | | | | | This patch reworks the function argument reading code, allowing us to annotate arguments with their types. The type/size information is needed to correctly parse arguments passed on the stack. llvm-svn: 260525
* Handle floating-point type homogeneous aggregate return values in ABISysV_armOmair Javaid2016-02-111-0/+76
| | | | | | | | For details refer to review link given below. Differential revision: http://reviews.llvm.org/D16975 llvm-svn: 260512
* Revert 260436. I pretty consistently upper-case the letter I use for theJim Ingham2016-02-101-2/+2
| | | | | | | | | short option as an aid to memory. Like it's w because of the W in throW. That helps me remember. If we are going to take these out we should take them all out. But I kind of like them. llvm-svn: 260452
* When importing Objective-C protocols, mark them as having external decls.Sean Callanan2016-02-101-11/+23
| | | | | | | | | | We already do this for Objective-C interfaces, but we never handled protocols because the DWARF didn't represent them. Nowadays, though, we can import them from modules, and we have to mark them properly. <rdar://problem/24193009> llvm-svn: 260445
* No reason for these two letters to be uppercaseEnrico Granata2016-02-101-2/+2
| | | | llvm-svn: 260436
* Now that SymbolFileDWARF supports having types in completely separate .pcm ↵Greg Clayton2016-02-1018-32/+74
| | | | | | | | | | | | | | 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
* Revert "Improve the handling of missing elf symtab and missing symbol sizes"Tamas Berghammer2016-02-106-122/+142
| | | | | | | | This reverts commit 252dda67782f2cbf838e375bce21ed4191f6d9ce. The commit caused several test failure on the OSX build bot. llvm-svn: 260377
* [RenderScript] Refactor allocation expressions Ewan Crawford2016-02-101-77/+85
| | | | | | | Patch refractors RS plugin code specifying how format strings are used to JIT the runtime. Author: Dean De Leo <dean@codeplay.com> llvm-svn: 260372
* Improve the handling of missing elf symtab and missing symbol sizesTamas Berghammer2016-02-106-142/+122
| | | | | | | | | | | | * Generate artificial symbol names from eh_fame during symbol parsing so these symbols are already present when we calcualte the size of the symbols where 0 is specified. * Fix symbol size calculation for the last symbol in the file where it have to last until the end of the parent section. Differential revision: http://reviews.llvm.org/D16996 llvm-svn: 260369
* Fix handling of the arm IT instruction in the unwinderTamas Berghammer2016-02-104-61/+93
| | | | | | | | | | | | | | | | | | | | | | | | | The IT instruction can specify condition code for up to 4 consecutive instruction and it is used quite often by clang in epilogues causing an issue when trying to unwind from locations covered by the IT instruction and for locatins inmediately after the IT instruction. Changes made to fix it: * Introduce the concept of conditional instruction block what is a list of consecutive instructions with the same condition. We update the unwind information during the conditional instruction block and when we reach the end of it (first instruction with a differemt condition) then we restore the unwind information we had before the condition. * Fix a bug in the ARM instruction emulator where neither PC nor the ITSTATE was advanced when we reached an instruction what we can't decode. After the change we have no regression on android-arm running the regular test suit and TestStandardUnwind also passes when running it with clang as the compiler (previously it failed on an IT instruction). Differential revision: http://reviews.llvm.org/D16814 llvm-svn: 260368
* Use BKPT instead of UDF for arm/thumb breakpointsTamas Berghammer2016-02-102-10/+8
| | | | | | | | | The UDF instruction is deprecated in armv7 and in case of thumb2 instructions set it don't work well together with the IT instruction. Differential revision: http://reviews.llvm.org/D16853 llvm-svn: 260367
* This is an idea to make "thread step-in --target" work for the commonJim Ingham2016-02-101-2/+85
| | | | | | | | | | | | | | | | | | | | | | | | | case where you have: 1 -> foo (bar(), 2 baz(), 3 lala()); 4 You are sitting on line 1, and want to step into foo, but not bar, baz & lala. Unfortunately there are line table entries for lines 1-3, and lldb doesn't know anything about the nesting of statement in these lines. So we'll have to use the user's intelligence... This patch adds: (lldb) thread step-in -t foo --end-line 4 That tells lldb to keep stepping in till line 4, but stop if you step into foo. I think I would remember to use this when faced with some of the long gnarly call sequences in lldb. But there might be ways I haven't thought of to make it more convenient. Jason suggests having "end" as a special token for --end-line which just means keep going to the end of the function, I really want to get into this thing... There should be an SB API and tests, which will come if this seems useful. llvm-svn: 260352
* Don't dereference the first element of an empty container.Adrian McCarthy2016-02-101-1/+1
| | | | llvm-svn: 260331
OpenPOWER on IntegriCloud