summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Add Arm Architecture plugin to the xcode project file.Jason Molenda2017-10-271-0/+24
| | | | llvm-svn: 316727
* Fix TestMinidump for r316673Pavel Labath2017-10-261-8/+8
| | | | | | | | | The test was asserting that we can only find one frame in the minidump. Now that we have the default unwind plan from the ABI plugin, we are able to find 5 more frames using the frame pointer chaining. Correct the expectation in the test. llvm-svn: 316688
* Allow SysV-i386 ABI on everything other than Apple targetsStephane Sezer2017-10-261-5/+6
| | | | | | | | | | | | | | Summary: This matches other SysV ABIs that are different on Apple and non-Apple targets, like `ABISysV_arm.cpp` for instance. Reviewers: clayborg, emaste Subscribers: aemerson, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D39335 llvm-svn: 316673
* Makefile.rules: move CFLAGS_EXTRAS to the end of compile linePavel Labath2017-10-251-5/+5
| | | | | | | | | This makes sure that any options specified there override generic compiler options. This fixes TestBreakpointIt.py llvm-svn: 316629
* Move StopInfoOverride callback to the new architecture pluginPavel Labath2017-10-2519-203/+428
| | | | | | | | | | | | | | | This creates a new Architecture plugin and moves the stop info override callback to this place. The motivation for this is to remove complex dependencies from the ArchSpec class because it is used in a lot of places that (should) know nothing about Process instances and StopInfo objects. I also add a test for the functionality covered by the override callback. Differential Revision: https://reviews.llvm.org/D31172 llvm-svn: 316609
* Move testcases/arm_emulation to testcases/arm/emulationPavel Labath2017-10-25158-0/+0
| | | | | | | This creates space for addidional arm-specific tests. I will be adding one of those in a follow-up commit. llvm-svn: 316608
* Fix a compile warning on linuxStephane Sezer2017-10-241-1/+1
| | | | | | | Can't cast directly between a pointer to function and a pointer to object. llvm-svn: 316533
* Allow ObjectFilePECOFF to initialize with ARM binaries.Stephane Sezer2017-10-241-0/+5
| | | | | | | | | | | | | | Summary: This is required to start debugging WinPhone ARM targets. Reviewers: compnerd, zturner, omjavaid Reviewed By: compnerd Subscribers: jasonmolenda, aemerson, rengolin, lldb-commits Differential Revision: https://reviews.llvm.org/D19604 llvm-svn: 316532
* [FreeBSD] Remove more dead code. NFCI.Davide Italiano2017-10-241-26/+0
| | | | llvm-svn: 316530
* [ExpressionParser] Garbage-collect dead code. NFCI.Davide Italiano2017-10-241-9/+0
| | | | llvm-svn: 316529
* Remove some unused function calls from ClangUserExpression.cppStephane Sezer2017-10-241-1/+0
| | | | llvm-svn: 316527
* Remove some dead code from ClangExpressionDeclMap.cppStephane Sezer2017-10-241-47/+3
| | | | llvm-svn: 316526
* Revert "[lldbtests] Handle errors instead of crashing."Pavel Labath2017-10-241-5/+1
| | | | | | | | | | | | | The commit breaks the case where you specify just a filename to the compiler. Previously, it would look up the compiler in your path, now it complains that the compiler is not found. One of the lldb buildbots is depending on this. It seems like a nice feature to have, as it means less typing and being able to avoid hard-coding the system compiler path in the bot config. This reverts commit r316393. llvm-svn: 316451
* [lldbtests] Handle errors instead of crashing.Davide Italiano2017-10-231-1/+5
| | | | | | | | | | | | | | | | | | If you pass an invalid compiler/debugger path on the cmdline to `dotest.py` this is what you get. Traceback (most recent call last): [...] File "dotest.py", line 7, in <module> lldbsuite.test.run_suite() [...] And with the patch applied: /home/davide/work/build-lldb/bin/clandasfasg is not a valid path, exiting Differential Revision: https://reviews.llvm.org/D39199 llvm-svn: 316393
* Use ipv4 localhost address in lldb-server testsPavel Labath2017-10-231-1/+1
| | | | | | | | | | | | Since the ipv6 patch, we've experienced occasional flakyness in lldb-server tests. This was due to the fact that lldb-server was trying to listen on both v4 and v6 localhost sockets (and consider it a success if at least one of them succeeded), while the test framework was only trying to connect to the v4 one. This change makes sure lldb-server only listens on the v4 socket. llvm-svn: 316391
* [Symbol] Remove dead code. NFCI.Davide Italiano2017-10-231-23/+0
| | | | llvm-svn: 316390
* Logging: Disable logging after fork()Pavel Labath2017-10-236-7/+24
| | | | | | | | | | | | | | | | | | | | | | | Summary: We had a bug where if we had forked (in the ProcessLauncherPosixFork) while another thread was writing a log message, we would deadlock. This happened because the fork child inherited the locked log rwmutex, which would never get unlocked. This meant the child got stuck trying to disable all log channels. The bug existed for a while but only started being apparent after D37930, which started using ThreadLauncher (which uses logging) instead of std::thread (which does not) for launching TaskPool threads. The fix is to use pthread_atfork to disable logging in the forked child. Reviewers: zturner, eugene, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D38938 llvm-svn: 316368
* [lldbtest] Simplify removing an unneeded else. NFCI.Davide Italiano2017-10-231-2/+1
| | | | llvm-svn: 316355
* lldb-server tests: Propagate environment variables (pr34192)Pavel Labath2017-10-201-0/+8
| | | | | | | | | | | | | | | | Summary: Without this, the launching of the test inferior may fail if it depends on some component of the environment (most likely LD_LIBRARY_PATH). This makes sure we propagate the environment variable to the inferior process. Reviewers: eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39010 llvm-svn: 316244
* Revert "Logging: Make sure logging machinery is in a consistent state after ↵Pavel Labath2017-10-205-27/+3
| | | | | | | | | | | | | | forking" The pthread_atfork trick breaks on android, because pthread_rwlock_unlock detects that it is not the same thread which locked the lock. This means that the subsequent lock attempt will still deadlock (only this time it happens deterministically instead of at random). Reverting to find a better solution. This reverts commit r316173. llvm-svn: 316231
* Logging: Make sure logging machinery is in a consistent state after forkingPavel Labath2017-10-195-3/+27
| | | | | | | | | | | | | | | | | | | | | | | | Summary: We had a bug where if we had forked (in the ProcessLauncherPosixFork) while another thread was writing a log message, we would deadlock. This happened because the fork child inherited the locked log rwmutex, which would never get unlocked. This meant the child got stuck trying to disable all log channels. The bug existed for a while but only started being apparent after D37930, which started using ThreadLauncher (which uses logging) instead of std::thread (which does not) for launching TaskPool threads. The fix is to use pthread_atfork to make sure noone is writing a log message while we are forking. Reviewers: zturner, eugene, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D38938 llvm-svn: 316173
* lldb-server tests: Fix undefined behaviorPavel Labath2017-10-181-2/+2
| | | | | | | We were creating a StringRef pointing to a temporary string. Problem manifested itself when running the test on osx. llvm-svn: 316106
* Silence some "implicit conversion of string literal" warningsPavel Labath2017-10-172-7/+7
| | | | llvm-svn: 316038
* lldb-server tests: Add support for testing debugserverPavel Labath2017-10-176-30/+83
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: This adds support for running the lldb-server test suite (currently consisting of only one test) against the debugserver. Currently, the choice which binary to test is based on the host system. This will need to be replaced by something more elaborate if/when lldb-server starts supporting debugging on darwin. I need to make a couple of tweaks to the test client to work with debugserver: - debugserver has different command-line arguments - launching code adjusted to handle that - debugserver sends duplicate "medata" fields in the stop reply packet - adjusted stop-reply parsing code to handle that - debugserver replies to the k packet instead of just dropping the connection - stopping code adjusted, although we should probably consider aligning the behavior of the two stubs in this case Reviewers: jmajors, beanz Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D35311 llvm-svn: 316010
* Remove shared_pointer from NativeThreadProtocolPavel Labath2017-10-1711-293/+217
| | | | | | | | | | | | | | | | | | | Summary: The NativeThread class is useless without the containing process (and in some places it is already assuming the process is always around). This makes it clear that the NativeProcessProtocol is the object owning the threads, and makes the destruction order deterministic (first threads, then process). The NativeProcess is the only thing holding a thread unique_ptr, and methods that used to hand out thread shared pointers now return raw pointers or references. Reviewers: krytarowski, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D35618 llvm-svn: 316007
* Reverting r315966 - it caused a build failure on an ubuntu x android bot.Jason Molenda2017-10-1710-302/+21
| | | | llvm-svn: 315967
* Committing this for Larry D'Anna:Jason Molenda2017-10-1710-21/+302
| | | | | | | | | | | This patch adds support for passing an arbitrary python stream (anything inheriting from IOBase) to SetOutputFileHandle or SetErrorFileHandle. Differential revision: https://reviews.llvm.org/D38829 <rdar://problem/34870417> llvm-svn: 315966
* The save_crashlog command was still looking at lldb.target andJim Ingham2017-10-121-6/+7
| | | | | | | lldb.process. That hasn't worked for a long time. Convert it to the form that takes an SBExecutionContext and use that instead. llvm-svn: 315549
* Add cases for new type DependentAddressSpace, added in r314649Ted Woodward2017-10-111-0/+9
| | | | llvm-svn: 315524
* Remove default case from switch.Ted Woodward2017-10-111-2/+4
| | | | | | Add case to handle new event lldb::eBreakpointEventTypeAutoContinueChanged. llvm-svn: 315496
* Fix dumping of characters with non-standard sizesPetr Pavlu2017-10-114-93/+176
| | | | | | | | | | | | | | | | * Prevent dumping of characters in DumpDataExtractor() with item_byte_size bigger than 8 bytes. This case is not supported by the code and results in a crash because the code calls DataExtractor::GetMaxU64Bitfield() -> GetMaxU64() that asserts for byte size > 8 bytes. * Teach DataExtractor::GetMaxU64(), GetMaxU32(), GetMaxS64() and GetMaxU64_unchecked() how to handle byte sizes that are not a multiple of 2. This allows DumpDataExtractor() to dump characters and booleans with item_byte_size in the interval of [1, 8] bytes. Values that are not a multiple of 2 would previously result in a crash because they were not handled by GetMaxU64(). llvm-svn: 315444
* [lldb] Enable using out-of-tree dwpsAlexander Shaposhnikov2017-10-102-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously LLDB required the DWP file to be located next to the executable file. This diff uses the helper function Symbols::LocateExecutableSymbolFile to search for DWP files in the standard locations for debug symbols. Test plan: Build a toy test example: main.cpp clang -gsplit-dwarf -g -O0 main.cpp -o main.exe llvm-dwp -e main.exe -o main.exe.dwp mkdir -p debug_symbols mv main.exe.dwp debug_symbols/main.exe.dwp Run lldb: lldb settings set target.debug-file-search-paths ./debug_symbols file ./main.exe br set --name f run Check that debugging works: setting breakpoints, printing local variables. Differential revision: https://reviews.llvm.org/D38568 llvm-svn: 315387
* Support: Have directory_iterator::status() return ↵Peter Collingbourne2017-10-102-10/+10
| | | | | | | | | | | | | | | | | | FindFirstFileEx/FindNextFile results on Windows. This allows clients to avoid an unnecessary fs::status() call on each directory entry. Because the information returned by FindFirstFileEx is a subset of the information returned by a regular status() call, I needed to extract a base class from file_status that contains only that information. On my machine, this reduces the time required to enumerate a ThinLTO cache directory containing 520k files from almost 4 minutes to less than 2 seconds. Differential Revision: https://reviews.llvm.org/D38716 llvm-svn: 315378
* Update ABISysV_arm64::RegisterIsVolatile to accept registers prefixed with rStephane Sezer2017-10-091-1/+1
| | | | | | | | | | | | | | | | | | | | | Summary: While the specification says that the 64bit registers are prefixed with `x`, it seems that many people still use `r`. Until recently, we had been using the `r` prefix instead of the `x` prefix in ds2. This caused lldb to fail during unwinding. I think it's reasonable to check for a register prefixed with `r`, since some people still choose to use `r`. Reviewers: sas, fjricci, clayborg Reviewed By: sas, clayborg Subscribers: aemerson, javed.absar, kristof.beyls Differential Revision: https://reviews.llvm.org/D38376 Change by Alex Langford <apl@fb.com> llvm-svn: 315221
* [DWARFDIE] Rewrite `operator !=` using `operator ==`. NFCI.Davide Italiano2017-10-091-1/+1
| | | | llvm-svn: 315200
* [SymbolFile/DWARF] Simplify two functions. NFCI.Davide Italiano2017-10-091-8/+2
| | | | llvm-svn: 315199
* Remove the input file specification from theJason Molenda2017-10-071-1/+0
| | | | | | | | | | "Prepare Swig Bindings" shell script phase; it wasn't the actual input file and could lead to incorrect dependency analysis by the build system. <rdar://problem/34751196> llvm-svn: 315135
* Specify the input & output results of the "Prepare Swig Bindings"Jason Molenda2017-10-061-0/+2
| | | | | | | shell script phase to aid build systems. <rdar://problem/34751196> llvm-svn: 315123
* [CMake] Add LLDB_INCLUDE_TESTS variableChris Bieneman2017-10-061-3/+8
| | | | | | This behaves like the other *_INCLUDE_TESTS variables in CMake and is tied to LLVM_INCLUDE_TESTS so that if you're building in-tree and not building the LLVM tests, you also won't build the LLDB tests. llvm-svn: 315120
* Implement interactive command interruptionLeonard Mosescu2017-10-0510-24/+139
| | | | | | | | | | | | | | | | | | | The core of this change is the new CommandInterpreter::m_command_state, which models the state transitions for interactive commands, including an "interrupted" state transition. In general, command interruption requires cooperation from the code executing the command, which needs to poll for interruption requests through CommandInterpreter::WasInterrupted(). CommandInterpreter::PrintCommandOutput() implements an optionally interruptible printing of the command output, which for large outputs was likely the longest blocking part. (ex. target modules dump symtab on a complex binary could take 10+ minutes) Differential Revision: https://reviews.llvm.org/D37923 llvm-svn: 315037
* Enable breakpoints and read/write GPRs for ppc64leEugene Zemtsov2017-10-0513-2/+766
| | | | | | | | | | | | Add support for ppc64le to create breakpoints and read/write general purpose registers. Other features for ppc64le and functions to read/write other registers are being implemented. Patch by Alexandre Yukio Yamashita (alexandreyy) Differential Revision: https://reviews.llvm.org/D38323 llvm-svn: 315008
* Work around a bug in the C++ expression parser.Jim Ingham2017-10-051-47/+47
| | | | | | | | | | | | When the expression parser does name resolution for local variables in C++ closures it doesn't give the local name priority over other global symbols of the same name. heap.py uses "info" which is a fairly common name, and so the commands in it fail. This is a workaround, just use lldb_info not info. <rdar://problem/34026140> llvm-svn: 314959
* Another silly little thing you can do with Python commands.Jim Ingham2017-10-051-0/+24
| | | | | | | | | Sometimes you want to step along and print a local each time as you go. You can do that with stop hooks, but that's a little heavy-weight. This is a sketch of a command that steps and then does "frame variable" on all its arguments. llvm-svn: 314958
* LLDB cmake fix: define LLDB_CONFIGURATION_xxx based on the build typeLeonard Mosescu2017-10-042-9/+7
| | | | | | | | | | Neither LLDB_CONFIGURATION_DEBUG nor LLDB_CONFIGURATION_RELEASE were ever set in the CMake LLDB project. Also cleaned up a questionable #ifdef in SharingPtr.h, removing all the references to LLDB_CONFIGURATION_BUILD_AND_INTEGRATION in the process. Differential Revision: https://reviews.llvm.org/D38552 llvm-svn: 314929
* cmake + xcode: prevent gtests from using includes from project rootTim Hammerquist2017-10-0317-37/+36
| | | | | | | | | | | | | | | | | | | | | Summary: At present, several gtests in the lldb open source codebase are using #include statements rooted at $(SOURCE_ROOT)/${LLDB_PROJECT_ROOT}. This patch cleans up this directory/include structure for both CMake and Xcode build systems. rdar://problem/33835795 Reviewers: zturner, jingham, beanz Reviewed By: beanz Subscribers: emaste, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D36598 llvm-svn: 314849
* [lldb] Fix initialization of m_debug_cu_index_mapAlexander Shaposhnikov2017-10-032-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | SymbolFileDWARFDwp contains m_debug_cu_index_map which was previously initialized incorrectly: before m_debug_cu_index.parse is called m_debug_cu_index is empty, thus the map was not actually getting populated properly. This diff moves this step into a private helper method and calls it after m_debug_cu_index.parse inside SymbolFileDWARFDwp::Create. Test plan: Build a toy test example main.cpp clang -gsplit-dwarf -g -O0 main.cpp -o main.exe llvm-dwp -e main.exe -o main.exe.dwp Build LLDB with ENABLE_DEBUG_PRINTF set. Run: lldb -- ./main.exe Check that the indexes are now correct (before this change they were empty) Check that debugging works (setting breakpoints, printing local variables (this was not working before)) Differential revision: http://reviews.llvm.org/D38492 llvm-svn: 314832
* Move install_name_tool to a separate make target.Jason Molenda2017-10-021-1/+3
| | | | llvm-svn: 314731
* Improve FreeBSD kernel debuggingEd Maste2017-10-0211-60/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | FreeBSD kernel modules are actually relocatable (.o) ELF files and this previously caused some issues for LLDB. This change addresses these when using lldb to symbolicate FreeBSD kernel backtraces. The major problems: - Relocations were not being applied to the DWARF debug info despite there being code to do this. Several issues prevented it from working: - Relocations are computed at the same time as the symbol table, but in the case of split debug files, symbol table parsing always redirects to the primary object file, meaning that relocations would never be applied in the debug file. - There's actually no guarantee that the symbol table has been parsed yet when trying to parse debug information. - When actually applying relocations, it will segfault because the object files are not mapped with MAP_PRIVATE and PROT_WRITE. - LLDB returned invalid results when performing ordinary address-to- symbol resolution. It turned out that the addresses specified in the section headers were all 0, so LLDB believed all the sections had overlapping "file addresses" and would sometimes return a symbol from the wrong section. Patch by Brian Koropoff Differential Revision: https://reviews.llvm.org/D38142 llvm-svn: 314672
* [lldb-mi] Fix a thinko in my previous commit.Davide Italiano2017-09-301-1/+1
| | | | | | Hopefully this should unbreak the Android buildbot. llvm-svn: 314606
* [lldb-mi] Add a default case to placate GCC with -Werror.Davide Italiano2017-09-301-0/+2
| | | | llvm-svn: 314604
OpenPOWER on IntegriCloud