summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Make sure that the following SymbolFileDWARF functions can handle getting a ↵Greg Clayton2016-04-252-9/+57
| | | | | | | | | | | | | | | | | | | | lldb::user_id_t for another SymbolFileDWARF: CompilerDecl SymbolFileDWARF::GetDeclForUID (lldb::user_id_t type_uid); CompilerDeclContext SymbolFileDWARF::GetDeclContextForUID (lldb::user_id_t type_uid) CompilerDeclContext SymbolFileDWARF::GetDeclContextContainingUID (lldb::user_id_t type_uid) Type* SymbolFileDWARF::ResolveTypeUID (lldb::user_id_t type_uid) <rdar://problem/25592223> llvm-svn: 267494
* Fix TestGetVariables.py.Chaoren Lin2016-04-252-2/+3
| | | | | | | | | | Reviewers: sivachandra, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D19511 llvm-svn: 267492
* Fix StackFrame::GetVariables(...) function that was broken by 261858 when ↵Greg Clayton2016-04-254-1/+224
| | | | | | | | lambda functions were added to Block::AppendBlockVariables(). The Stackframe::GetVariables(...) function should get all variables regardless if they are in scope. This wasn't caught by the test suite so I added a test for it. llvm-svn: 267478
* Maintain register numbering across xml include featuresFrancis Ricci2016-04-251-6/+7
| | | | | | | | | | | | | | | | | | Summary: If the remote uses include features when communicating xml register info back to lldb, the existing code would reset the lldb register index at the beginning of each include node. This would lead to multiple registers having the same lldb register index. Since the lldb register numbers should be contiguous and unique, maintain them accross the parsing of all of the xml feature nodes. Reviewers: jingham, jasonmolenda, clayborg Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19303 llvm-svn: 267468
* Properly unload modules from target image list when using svr4 packetsFrancis Ricci2016-04-251-2/+24
| | | | | | | | | | | | | | | | | | | Summary: When we receive an svr4 packet from the remote, we check for new modules and add them to the list of images in the target. However, we did not do the same for modules which have been removed. This was causing TestLoadUnload to fail when using ds2, which uses svr4 packets to communicate all library info on Linux. This patch fixes the failing test. Reviewers: zturner, tfiala, ADodds Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19230 llvm-svn: 267467
* Use Process Plugin register indices when communicating with remoteFrancis Ricci2016-04-252-8/+9
| | | | | | | | | | | | | | | | | | Summary: eRegisterKindProcessPlugin is used to store the register indices used by the remote, and eRegisterKindLLDB is used to store the internal lldb register indices. However, we're currently using the lldb indices instead of the process plugin indices when sending p/P packets. This will break if the remote uses non-contiguous register indices. Reviewers: jasonmolenda, clayborg Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19305 llvm-svn: 267466
* Store absolute path for lldb executable in dotest.pyFrancis Ricci2016-04-251-1/+1
| | | | | | | | | | | | | | | | | | | | Summary: lldb-server tests are currently being skipped on the check-lldb target. This is because we get the path of lldb-server by modifying the path to the lldb executable. However, by this point, we've changed directories, and a relative path to the build/bin directory will no longer point to the location of lldb-server. Storing an absolute path solves this issue. Reviewers: vharron, zturner, tfiala, labath Subscribers: labath, lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19082 llvm-svn: 267463
* Create _lldb python symlink correctly when LLVM_LIBDIR_SUFFIX is usedFrancis Ricci2016-04-253-10/+45
| | | | | | | | | | | | | | | | Summary: Do not assume that liblldb.so is located in $(lldb -P)/../../../lib when creating the _lldb python symlink. Instead, use the path passed to LLVM_LIBDIR_SUFFIX, defaulting to $(lldb -P)/../../../lib when this variable is not set. Reviewers: vharron, emaste, zturner Subscribers: zturner, labath, lldb-commits, sas Differential Revision: http://reviews.llvm.org/D19067 llvm-svn: 267462
* Add missing qRegisterInfo option to gdbremote testcaseFrancis Ricci2016-04-251-0/+1
| | | | | | | | | | | | | | Summary: "gcc" is equivalent to "ehframe" in ProcessGDBRemote, but only "ehframe" was a valid response in the test suite. Reviewers: tfiala, jasonmolenda, clayborg Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18807 llvm-svn: 267459
* test commitFrancis Ricci2016-04-251-1/+1
| | | | llvm-svn: 267443
* Fix ARM attribute parsing for Android after rL267291Tamas Berghammer2016-04-252-14/+26
| | | | | | Differential revision: http://reviews.llvm.org/D19480 llvm-svn: 267422
* skip TestBitfields.py on OS XTodd Fiala2016-04-251-0/+1
| | | | | | | tracked by: https://llvm.org/bugs/show_bug.cgi?id=27515 llvm-svn: 267421
* Skip TestBitfileds on linuxPavel Labath2016-04-251-0/+1
| | | | | | | Test added in r267248 exposed a bug in handling of dwarf produced by clang>=3.9, which causes a crash during expression evaluation. Skip the test until this is sorted out. llvm-svn: 267407
* Handle invalid values of PLT entry size generated by linkerOmair Javaid2016-04-251-1/+4
| | | | | | | | Make sure we figure out correct plt entry field in case linker has generated a small value below realistic entry size like 4 bytes or below. Differential revision: http://reviews.llvm.org/D19252 llvm-svn: 267405
* Remove flaky decorator from two tests on linuxPavel Labath2016-04-252-4/+0
| | | | | | The flakyness is no longer reproducible, and the tests seem to be passing reliably now. llvm-svn: 267392
* Add a --element-count option to the expression commandEnrico Granata2016-04-2514-13/+294
| | | | | | | | | | | | | This option evaluates an expression and, if the result is of pointer type, treats it as if it was an array of that many elements and displays such elements This has a couple subtle points but is mostly as straightforward as it sounds Add a parray N <expr> alias for this new mode Also, extend the --object-description mode to do the moral equivalent of the above but display each element in --object-description mode Add a poarray N <expr> alias for this llvm-svn: 267372
* Fix unwind failures when PC points beyond the end of a functionUlrich Weigand2016-04-242-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RegisterContextLLDB::InitializeNonZerothFrame already has code to attempt to detect and handle the case where the PC points beyond the end of a function, but there are certain cases where this doesn't work correctly. In fact, there are *two* different places where this detection is attempted, and the failure is in fact a result of an unfortunate interaction between those two separate attempts. First, the ResolveSymbolContextForAddress routine is called with the resolve_tail_call_address flag set to true. This causes the routine to internally accept a PC pointing beyond the end of a function, and still resolving the PC to that function symbol. Second, the InitializeNonZerothFrame routine itself maintains a "decr_pc_and_recompute_addr_range" flag and, if that turns out to be true, itself decrements the PC by one and searches again for a symbol at that new PC value. Both approaches correctly identify the symbol associated with the PC. However, the problem is now that later on, we also need to find the DWARF CFI record associated with the PC. This is done in the RegisterContextLLDB::GetFullUnwindPlanForFrame routine, and uses the "m_current_offset_backed_up_one" member variable. However, that variable only actually contains the PC "backed up by one" if the *second* approach above was taken. If the function was already identified via the first approach above, that member variable is *not* backed up by one but simply points to the original PC. This in turn causes GetEHFrameUnwindPlan to not correctly identify the DWARF CFI record associated with the PC. Now, in many cases, if the first method had to back up the PC by one, we *still* use the second method too, because of this piece of code: // Or if we're in the middle of the stack (and not "above" an asynchronous event like sigtramp), // and our "current" pc is the start of a function... if (m_sym_ctx_valid && GetNextFrame()->m_frame_type != eTrapHandlerFrame && GetNextFrame()->m_frame_type != eDebuggerFrame && addr_range.GetBaseAddress().IsValid() && addr_range.GetBaseAddress().GetSection() == m_current_pc.GetSection() && addr_range.GetBaseAddress().GetOffset() == m_current_pc.GetOffset()) { decr_pc_and_recompute_addr_range = true; } In many cases, when the PC is one beyond the end of the current function, it will indeed then be exactly at the start of the next function. But this is not always the case, e.g. if there happens to be alignment padding between the end of one function and the start of the next. In those cases, we may sucessfully look up the function symbol via ResolveSymbolContextForAddress, but *not* set decr_pc_and_recompute_addr_range, and therefore fail to find the correct DWARF CFI record. A very simple fix for this problem is to just never use the first method. Call ResolveSymbolContextForAddress with resolve_tail_call_address set to false, which will cause it to fail if the PC is beyond the end of the current function; or else, identify the next function if the PC is also at the start of the next function. In either case, we will then set the decr_pc_and_recompute_addr_range variable and back up the PC anyway, but this time also find the correct DWARF CFI. A related problem is that the ResolveSymbolContextForAddress sometimes returns a "symbol" with empty name. This turns out to be an ELF section symbol. Now, usually those get type eSymbolTypeInvalid. However, there is code in ObjectFileELF::ParseSymbols that tries to change the type of invalid symbols to eSymbolTypeCode or eSymbolTypeData if the symbol lies within the code or data section. Unfortunately, this check also hits the symbol for the code section itself, which is then marked as eSymbolTypeCode. While the size of the section symbol is 0 according to the ELF file, LLDB considers this size invalid and attempts to figure out the "correct" size. Depending on how this goes, we may end up with a symbol that overlays part of the code section, even outside areas covered by real function symbols. Therefore, if we call ResolveSymbolContextForAddress with PC pointing beyond the end of a function, we may get this bogus section symbol. This again means InitializeNonZerothFrame thinks we have a valid PC, but then we don't find any unwind info for it. The fix for this problem is me to simply always leave ELF section symbols as type eSymbolTypeInvalid. Differential Revision: http://reviews.llvm.org/D18975 llvm-svn: 267363
* ObjectFile: parse EABI AttributesSaleem Abdulrasool2016-04-232-0/+104
| | | | | | | | This adds basic parsing of the EABI attributes section. This section contains additional information about the target for which the file was built. Attempt to infer additional architecture information from that section. llvm-svn: 267291
* DWARF layout for bitfields is wrong when the bit offset is negative. Greg Clayton2016-04-223-3/+25
| | | | | | | | Some older versions of clang emitted bit offsets that were negative and these bitfields would have their bitfield-ness stripped off and it would cause a clang assertion in clang assertions were enabled. I updated the bitfield C test to make sure we don't regress. <rdar://problem/21082998> llvm-svn: 267248
* Source: fix another -Wunused-variable warningSaleem Abdulrasool2016-04-221-0/+2
| | | | | | | Conditionalise a variable definition which may be unused in certain compilations due to the preprocessor. Protect the variable accordingly. NFC. llvm-svn: 267247
* Fixed in issue with ObjectFileMachO where it would add empty sections to the ↵Greg Clayton2016-04-223-8/+22
| | | | | | | | section list that was used to try and cap symbols to the max address of the section in which it is contained. The empty sections would make cap the symbols and make their sizes zero. Also fixed a few other things that could cause problems in the SymbolFileDWARFDebugMap when zero sized symbols were found and used to make OSO range map entries. <rdar://problem/25886773> llvm-svn: 267237
* Fix a build-llvm.py crasher when we can't find cmake. Now it exits with a ↵Greg Clayton2016-04-221-1/+1
| | | | | | valid error that explains what went wrong. llvm-svn: 267235
* Renumber ThreadSanitizer-provided thread IDs to match LLDB thread numbers.Kuba Brecka2016-04-224-17/+178
| | | | llvm-svn: 267133
* Update comment in lldb-enumerations.hPavel Labath2016-04-221-1/+1
| | | | llvm-svn: 267124
* Update Go OS Plugin for newer runtimes.Ryan Brown2016-04-211-2/+13
| | | | | | Differential Revision: http://reviews.llvm.org/D19273 llvm-svn: 267048
* API: fix a -Wunused-variable warningSaleem Abdulrasool2016-04-211-0/+2
| | | | | | | expr_log is only conditionally used via preprocessing. Ensure that we guard the definition accordingly. NFC. llvm-svn: 267001
* Host: fix some -Wformat-pedantic warningsSaleem Abdulrasool2016-04-211-6/+6
| | | | | | Add explicit casts for function pointer to void * for %p conversion. NFC. llvm-svn: 267000
* Expressions can run without a process.Jim Ingham2016-04-211-17/+30
| | | | | | | | | | | Code was added in ClangExpressionParser::ClangExpressionParser that was calling through the process w/o checking that it was good. Also, we were pretending that we could do something reasonable if we had no target, but that's actually not true, so I check for a target at the beginning of the constructor and don't make a compiler in that case. <rdar://problem/25841198> llvm-svn: 266944
* Corrected wording of REPL not available messaging (contained a repeated word ↵Kate Stone2016-04-212-2/+2
| | | | | | and lacked clarity.) llvm-svn: 266941
* Added command prefix to new help messages to ensure that they're correctly ↵Kate Stone2016-04-211-11/+5
| | | | | | words in REPL mode. llvm-svn: 266940
* Removed extraneous print() in decorator for enabling module debuggingKate Stone2016-04-201-1/+0
| | | | llvm-svn: 266924
* When making an array or stuct/union/class elements, make sure the type is ↵Greg Clayton2016-04-201-1/+28
| | | | | | | | complete. If the type isn't complete, complete the type so that clang won't assert and kill your program. Since the DWARF assists in doing layout, it won't show the array or struct/unions/class elements correctly, but it will stop you from crashing if you have a struct/union/class that contains one of these arrays. <rdar://problem/25057391> llvm-svn: 266922
* update Jenkins Xcode buildbot target for r266885Todd Fiala2016-04-201-1/+1
| | | | llvm-svn: 266917
* Fix a bug where LLDB would crash if 'apropos <anything>' was used after ↵Enrico Granata2016-04-208-1/+87
| | | | | | spawning an inferior process llvm-svn: 266911
* Add missing file needed for PDB unittests.Zachary Turner2016-04-201-0/+0
| | | | llvm-svn: 266886
* test infra: move test event-related handling into its own packageTodd Fiala2016-04-2014-674/+734
| | | | | | | | | | | | | | | | | | | | | | | This change moves all the test event handling and its related ResultsFormatter classes out of the packages/Python/lldbsuite/test dir into a packages/Python/lldbsuite/test_event package. Formatters are moved into a sub-package under that. I am limiting the scope of this change to just the motion and a few minor issues caught by a static Python checker (e.g. removing unused import statements). This is a pre-step for adding package-level tests to the test event system. I also intend to simplify test event results formatter selection after I make sure this doesn't break anybody. See: http://reviews.llvm.org/D19288 Reviewed by: Pavel Labath llvm-svn: 266885
* Fix xfail for test_tilde_home_directory on windowsTamas Berghammer2016-04-201-1/+1
| | | | llvm-svn: 266867
* llvm::sys::path::home_directory() relies on having "HOME" set in the ↵Greg Clayton2016-04-192-1/+75
| | | | | | | | | | environment and that might not always be set. Our FileSpec class uses this function to resolve any paths that start with "~/" on systems that support home directories as '~'. I have modified FileSpec::ResolveUsername (llvm::SmallVectorImpl<char> &path) to deal with the cases where llvm::sys::path::home_directory() returns false by digging a little further on unix systems and setting "HOME" in the environment so that subsequent calls to llvm::sys::path::home_directory() will succeed. I also added a test to ensure we don't regress. <rdar://problem/25342377> llvm-svn: 266832
* Eliminate circular dependency introduced between lldbtest.py and decorators.pyKate Stone2016-04-191-3/+2
| | | | llvm-svn: 266815
* Adds a test to detect when clang omits specialized generic types from debug ↵Kate Stone2016-04-196-0/+118
| | | | | | information when using precompiled headers and -gmodules. llvm-svn: 266791
* Revert "LLDB: Fixed two race conditions when stopping private state thread"Pavel Labath2016-04-192-8/+9
| | | | | | This reverts commit r266733 as it causes a number of failures on linux buildbots. llvm-svn: 266736
* LLDB: Fixed two race conditions when stopping private state threadMarianne Mailhot-Sarrasin2016-04-192-9/+8
| | | | | | | | | | | | | | When stopping the private state thread, there was a race condition between the time the thread exits (resetting the HostThread object) and the time a Join was attempted, especially in the case of a timeout. The previous workaround of copying the HostThread object is not enough, since on a Reset the internal thread stuff gets nulled out regardless of which HostThread object actually has Reset called on it, resulting in an attempt to dereference a null pointer on the subsequent call to Join from the copy as well. Additionally, there was a race between the detach (called when stopping the process) and the stop itself, causing the stop to time out because it was waiting for the private state thread to see the stop state, but it had exited immediately after entering the detached state. Patch by cameron314 Differential Revision: http://reviews.llvm.org/D19122 llvm-svn: 266733
* Fix typo in TestSourceManager.pyPavel Labath2016-04-191-1/+1
| | | | llvm-svn: 266725
* test infra cleanup: convert test_runner lib into packageTodd Fiala2016-04-196-30/+19
| | | | | | | | | | | | | | | | | | | | | Also does the following: * adopts PEP8 naming convention for OptionalWith class (now optional_with). * moves test_runner/lldb_utils.py to lldbsuite/support/optional_with.py. * packages tests in a subpackage of test_runner per recommendations in http://the-hitchhikers-guide-to-packaging.readthedocs.org/en/latest/creation.html Tests can be run from within pacakges/Python/lldbsuite/test via this command: python -m unittest discover test_runner The primary cleanup this allows is avoiding the need to muck with the PYTHONPATH variable from within the source files. This also aids some of the static code checkers as they don't need to run code to determine the proper python path. llvm-svn: 266710
* Fix Windows build.Chaoren Lin2016-04-191-0/+1
| | | | llvm-svn: 266702
* ensure lldbinline remembers .py extensionTodd Fiala2016-04-182-6/+20
| | | | | | | | | | | | | | | | | | This ensure lldbinline.test_file paths are tracked as .py files rather than .pyc files. Also, this change adds an assert to the test infrastructure if a filename that is not ending in .py is attempted to be added to the test events infrastructure where we track test results. See: http://reviews.llvm.org/D19215 Earlier revision reviewed by: Pavel Labath llvm-svn: 266664
* fix a race is the LLDB test suite results collectionTodd Fiala2016-04-184-6/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | The race boiled down to this: If a test worker queue is able to run the test inferior and clean up before the dosep.py listener socket is spun up, and the worker queue is the last one (as would be the case when there's only one test rerunning in the rerun queue), then the test suite will exit the main loop before having a chance to process any test events coming from the test inferior or the worker queue job control. I found this race to be far more likely on fast hardware. Our Linux CI is one such example. While it will show up primarily during meta test events generated by a worker thread when a test inferior times out or exits with an exceptional exit (e.g. seg fault), it only requires that the OS takes longer to hook up the listener socket than it takes for the final test inferior and worker thread to shut down. See: http://reviews.llvm.org/D19214 reviewed by: Pavel Labath llvm-svn: 266624
* Attempt to fix darwin build after header refactor in llvm (r266595)Pavel Labath2016-04-181-1/+1
| | | | llvm-svn: 266605
* Fixup r266327Pavel Labath2016-04-181-2/+2
| | | | | | Fix XFAILed tests in TestThreadStates for the new signature of wait_for_running_event. llvm-svn: 266598
* [LLDB][MIPS] Fix TestConcurrentEventsMohit K. Bhakkad2016-04-181-35/+35
| | | | | | | | | | Patch by Nitesh Jain Reviewers: clayborg Subscribers: jaydeep, bhushan, mohit.bhakkad, sagar Differential Revision: http://reviews.llvm.org/D18389 llvm-svn: 266589
OpenPOWER on IntegriCloud