summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core
Commit message (Collapse)AuthorAgeFilesLines
...
* include locale.h in IOHandler.cppPavel Labath2018-03-131-0/+1
| | | | | | | This is needed for the setlocale() call, and it seems that it is not transitively pulled in for some build configurations. llvm-svn: 327413
* Introduce a setting to disable Spotlight while running the test suiteAdrian Prantl2018-03-121-1/+12
| | | | | | | | | | | This is a more principled approach to disabling Spotlight .dSYM lookups while running the testsuite, most importantly it also works for the LIT-based tests, which I overlooked in my initial fix (renaming the test build dir to lldb-tests.noindex). Differential Revision: https://reviews.llvm.org/D44342 llvm-svn: 327330
* Rename clang.modules-cache-path to symbols.clang-modules-cache-pathAdrian Prantl2018-03-102-4/+4
| | | | | | | | I want to extend the properties on ModuleList to also contain other more general settings and renaming the settings category to symbols seems to be the least bad of choices. llvm-svn: 327193
* Make the clang module cache setting available without a targetAdrian Prantl2018-03-022-5/+62
| | | | | | | | | | | | | | | It turns out that setting the clang module cache after LLDB has a Target can be too late. In particular, the Swift language plugin needs to know the setting without having access to a Target. This patch moves the setting into the *LLDB* module cache, where it is a global setting that is available before any Target is created and more importantly, is shared between all Targets. rdar://problem/37944432 Differential Revision: https://reviews.llvm.org/D43984 llvm-svn: 326628
* [lldb][PPC64] Fixed long double variables dumpPavel Labath2018-01-171-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: LLDB's DumpDataExtractor was not prepared to handle PowerPC's long double type: PPCDoubleDouble. As it is somewhat special, treating it as other regular float types resulted in getting wrong information about it. In this particular case, llvm::APFloat::getSizeInBits(PPCDoubleDouble) was returning 0. This caused the TestSetValues.py test to fail, because lldb would abort on an assertion failure on APInt(), because of the invalid size. Since in the PPC case the value of item_byte_size was correct and the getSizeInBits call was only added to support x87DoubleExtended semantics, this restricts the usage of getSizeInBits to the x87 semantics. Reviewers: labath, clayborg Reviewed By: labath Subscribers: llvm-commits, anajuliapc, alexandreyy, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D42083 Author: Leandro Lupori <leandro.lupori@gmail.com> llvm-svn: 322666
* [Core/Debugger] Remove some code that doesn't compile anymore.Davide Italiano2018-01-021-69/+0
| | | | llvm-svn: 321654
* [Module] Throw away some more commented code. NFCI.Davide Italiano2017-11-181-37/+0
| | | | llvm-svn: 318579
* [Core] Garbage collect dead code untouched in years. NFCI.Davide Italiano2017-11-181-31/+0
| | | | | | | This sketching can be resurrected if anybody needs it, although I doubt is relevant these days. llvm-svn: 318576
* Add check for self-assignment. NFCDon Hinton2017-11-142-0/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D39578 llvm-svn: 318164
* Move ArchSpec to the Utility modulePavel Labath2017-11-1310-1502/+4
| | | | | | | | | | | | | The rationale here is that ArchSpec is used throughout the codebase, including in places which should not depend on the rest of the code in the Core module. This commit touches many files, but most of it is just renaming of #include lines. In a couple of cases, I removed the #include ArchSpec line altogether, as the file was not using it. In one or two places, this necessitated adding other #includes like lldb-private-defines.h. llvm-svn: 318048
* Remove last Host usage from ArchSpecPavel Labath2017-11-131-12/+1
| | | | | | | | | | | | | | | | | | | | | | | Summary: In D39387, I was quick to jump to conclusion that ArchSpec has no external dependencies. It turns there still was one call to HostInfo::GetArchitecture left -- for implementing the "systemArch32" architecture and friends. Since GetAugmentedArchSpec is the place we handle these "incomplete" triples that don't specify os or vendor and "systemArch" looks very much like an incomplete triple, I move its handling there. After this ArchSpec *really* does not have external dependencies, and I'll move it to the Utility module as a follow-up. Reviewers: zturner, clayborg, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D39896 llvm-svn: 318046
* Improve the posix core file triple detectionTamas Berghammer2017-11-041-0/+3
| | | | | | | | | | | | | | | | | | | | | | | Summary: Posix core files sometime don't contain enough information to correctly detect the OS. If that is the case we should use the OS from the target instead as it will contain usable information in more cases and if the target and the core contain different OS-es then we are already in a pretty bad state so moving from an unknown OS to a known (but possibly incorrect) OS will do no harm. We already had similar code in place for MIPS. This change tries to make it more generic by using ArchSpec::MergeFrom and extends it to all architectures but some MIPS specific issue prevent us from getting rid of special casing MIPS. Reviewers: clayborg, nitesh.jain Subscribers: aemerson, sdardis, arichardson, kristof.beyls, lldb-commits Differential Revision: https://reviews.llvm.org/D36046 llvm-svn: 317411
* Add float/vector registers for ppc64lePavel Labath2017-11-031-0/+2
| | | | | | | | | | | | | | | Summary: Add read and write functions for VSX, VMX and float registers and fix watchpoint size Reviewers: clayborg Reviewed By: clayborg Subscribers: eugene, labath, clayborg, nemanjai, kbarton, JDevlieghere, anajuliapc, gut, lbianc, lldb-commits Differential Revision: https://reviews.llvm.org/D39487 Patch by: Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br> llvm-svn: 317329
* Fix some warnings found by ToT clangPavel Labath2017-11-022-2/+2
| | | | | | | | These fall into two categories: - unused variables - (uint8_t *)NULL + X -- changed to reinterpret_cast(X) llvm-svn: 317270
* Revert r317182 for https://reviews.llvm.org/D39128Jason Molenda2017-11-021-14/+0
| | | | | | | we're still failing on android. I'll ask Larry to ask Pavel for any tips he might be able to give. llvm-svn: 317183
* Commit Lawrence D'Anna's patch to changeJason Molenda2017-11-021-0/+14
| | | | | | | | | | | | | | | SetOututFileHandle to work with IOBase. I did make one change after checking with Larry -- I renamed SBDebugger::Flush to FlushDebuggerOutputHandles and added a short docstring to the .i file to make it a little clearer under which context programs may need to use this API. Differential Revision: https://reviews.llvm.org/D39128 <rdar://problem/34870417> llvm-svn: 317182
* Ahhhh roll back that commit, I didn't see that Lawrence had filedJason Molenda2017-11-021-14/+0
| | | | | | | a separate phabracator with the revised change. This was his first atttempt which broke on the bots the second time too. llvm-svn: 317181
* Commit Lawrence D'Anna's patch to changeJason Molenda2017-11-021-0/+14
| | | | | | | | | | | | | | SetOututFileHandle to work with IOBase. I did make one change after checking with Larry -- I renamed SBDebugger::Flush to FlushDebuggerOutputHandles and added a short docstring to the .i file to make it a little clearer under which context programs may need to use this API. Differential Revision: https://reviews.llvm.org/D38829 llvm-svn: 317180
* [Core] Comparison for unsigned >= 0 is redundant. NFCI.Davide Italiano2017-11-011-1/+1
| | | | llvm-svn: 317145
* Invert ArchSpec<->Platform dependencyPavel Labath2017-10-311-87/+5
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: ArchSpec::SetTriple was taking a Platform as an argument, and used it to fill in missing pieces of the specified triple. I invert the dependency by moving this code to other classes. For this purpose, I've created three new functions. - HostInfo::GetAugmentedArchSpec: fills in the triple using the host platform (this used to be implemented by passing a null platform pointer). By putting this code in the Host module, we can provide a way to anyone who does not have a platform instance (lldb-server) an easy way to get Host data. - Platform::GetAugmentedArchSpec: if you have a platform instance, you can call this to let it fill in the triple. - static Platform::GetAugmentedArchSpec: implements the "if platform == 0 then use_host() else use_platform()" part. Reviewers: zturner, jingham, clayborg Subscribers: mgorny, javed.absar, lldb-commits Differential Revision: https://reviews.llvm.org/D39387 llvm-svn: 316987
* Move StopInfoOverride callback to the new architecture pluginPavel Labath2017-10-252-102/+49
| | | | | | | | | | | | | | | 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
* Reverting r315966 - it caused a build failure on an ubuntu x android bot.Jason Molenda2017-10-171-14/+0
| | | | llvm-svn: 315967
* Committing this for Larry D'Anna:Jason Molenda2017-10-171-0/+14
| | | | | | | | | | | 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
* Fix dumping of characters with non-standard sizesPetr Pavlu2017-10-111-0/+7
| | | | | | | | | | | | | | | | * 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
* Implement interactive command interruptionLeonard Mosescu2017-10-051-1/+1
| | | | | | | | | | | | | | | | | | | 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
* Improve FreeBSD kernel debuggingEd Maste2017-10-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Revert patch r313904, as it breaks "command source" and in Jim Ingham2017-09-281-1/+1
| | | | | | | | | | | | particular causes lldb to die on startup if you have a ~/.lldbinit file. I filed: https://bugs.llvm.org/show_bug.cgi?id=34758 to cover fixing the bug. llvm-svn: 314371
* [LLDB] Implement interactive command interruptionAdrian McCarthy2017-09-211-1/+1
| | | | | | | | | | | | | | | | | | | | | 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) patch by lemo Differential Revision: https://reviews.llvm.org/D37923 llvm-svn: 313904
* Remove uses of std::auto_ptr, it's going away in C++17.Benjamin Kramer2017-09-141-1/+1
| | | | | | | std::unique_ptr is pretty much a drop-in replacement here. Also remove nullptr checks that are doing nothing. llvm-svn: 313265
* [Core/Value] Remove dead code that hasn't been touched in years. NFC.Davide Italiano2017-09-031-25/+0
| | | | llvm-svn: 312453
* Now a ppc64le binary is correctly detected:Eugene Zemtsov2017-08-301-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (lldb) target create "tst" Current executable set to 'tst' (powerpc64le). (lldb) disassemble -n main tst`main: tst[0x7b0] <+0>: addis 2, 12, 2 tst[0x7b4] <+4>: addi 2, 2, 30544 tst[0x7b8] <+8>: mflr 0 Wihout the patch, the endianess was incorrect: (lldb) target create "tst" Current executable set to 'tst' (powerpc64). (lldb) disassemble -n main tst`main: tst[0x7b0] <+0>: .long 0x02004c3c ; unknown opcode tst[0x7b4] <+4>: rlwimi 23, 3, 8, 8, 28 tst[0x7b8] <+8>: lhzu 16, 2172(2) tst[0x7bc] <+12>: .long 0x100001f8 ; unknown opcode Simple binary used is identified as: $ file tst tst: ELF 64-bit LSB shared object, 64-bit PowerPC or cisco 7500, version 1 (SYSV), dynamically linked, interpreter /lib64/ld64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=17a8fa2b24ce2837ba6625fabb34e6b29c6c5db7, not stripped Patch by Gustavo Serra Scalet <gustavo.scalet@eldorado.org.br> Differential Revision: https://reviews.llvm.org/D36804 llvm-svn: 312151
* Add support for the DWP debug info formatTamas Berghammer2017-08-251-0/+2
| | | | | | | | | | | | | | | | | | | | Summary: The DWP (DWARF package) format is used to pack multiple dwo files generated by split-dwarf into a single ELF file to make distributing them easier. It is part of the DWARFv5 spec and can be generated by dwp or llvm-dwp from a set of dwo files. Caviats: * Only the new version of the dwp format is supported (v2 in GNU numbering schema and v5 in the DWARF spec). The old version (v1) is already deprecated but binutils 2.24 still generates that one. * Combining DWP files with module debugging is not yet supported. Subscribers: emaste, mgorny, aprantl Differential Revision: https://reviews.llvm.org/D36062 llvm-svn: 311775
* [cmake] Add explicit linkage from Core to cursesMichal Gorny2017-08-171-0/+10
| | | | | | | | | | | | | | | | | | | | | | | The Core library calls functions provided by the curses library. Add an appropriate explicit LINK_LIBS to ${CURSES_LIBRARIES} to propagate the dependency correctly within the build system. It seems that so far the linkage was handled by some kind of implicit magic LLDB_SYSTEM_LIBS variable. However, it stopped working for unittests as the curses libraries are passed before the LLDBCore library, resulting in `-Wl,--as-needed` stripping the yet-unused library before it is required by LLDBCore, and effectively breaking the build. I think it's better to focus on listing all the dependencies explicitly and let CMake propagate them rather than trying to figure out why this hack stopped working. This is also more consistent with LLVM where the curses linkage in LLVMSupport is expressed directly in the library rather than deferred to the final programs. Differential Revision: https://reviews.llvm.org/D36358 llvm-svn: 311122
* Remove the DWARFExpression -> Clang ExpressionParser dependencyTamas Berghammer2017-08-161-3/+2
| | | | | | | | It was completly unused and broke the part of the encapsulation that common code shouldn't depend on specific plugins or language specific features. llvm-svn: 311000
* Pass in the disassembler flavor when disassembling inJason Molenda2017-07-111-1/+2
| | | | | | | | DumpDataExtractor. Patch from Jeffrey Crowell, https://reviews.llvm.org/D34929 llvm-svn: 307618
* Move Timer and TraceOptions from Core to UtilityPavel Labath2017-06-295-141/+5
| | | | | | | | | | | | | | Summary: The classes have no dependencies, and they are used both by lldb and lldb-server, so it makes sense for them to live in the lowest layers. Reviewers: zturner, jingham Subscribers: emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34746 llvm-svn: 306682
* Move StructuredData from Core to UtilityPavel Labath2017-06-273-320/+5
| | | | | | | | | | | | | | | | Summary: It had a dependency on StringConvert and file reading code, which is not in Utility. I've replaced that code by equivalent llvm operations. I've added a unit test to demonstrate that parsing a file still works. Reviewers: zturner, jingham Subscribers: kubamracek, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D34625 llvm-svn: 306394
* Move Connection and IOObject interfaces to Utility modulePavel Labath2017-06-273-34/+1
| | | | | | | | | | | | | | | | | | | Summary: These interfaces have no dependencies, so it makes sense for them to be in the lowest level modules, to make sure that other parts of the codebase can use them without introducing loops. The only exception here is the Connection::CreateDefaultConnection method, which I've moved to Host, as it instantiates concrete implementations, and that's where the implementations live. Reviewers: jingham, zturner Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D34400 llvm-svn: 306391
* Fix LLDB build.Zachary Turner2017-06-232-2/+2
| | | | | | | | | This was broken due to directly including windows.h, which caused a problem when someone in LLVM called std::min in a header file. LLDB has a windows.h include to work around this, but it wasn't being used in these two files. llvm-svn: 306186
* Remove home-grown thread-local storage wrappersPavel Labath2017-06-201-30/+14
| | | | | | | | | | | | | | Summary: Use c++11 thread_local variables instead. As far as I am aware, they are supported by all compilers/targets we care about. Reviewers: zturner, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D34274 llvm-svn: 305779
* Introduce new command: thread backtrace uniquePavel Labath2017-06-121-22/+51
| | | | | | | | | | | | | | | | | This patch introduces a new thread backtrace command "unique". The command is based off of "thread backtrace all" but will instead find all threads which share matching call stacks and de-duplicate their output, listing call stack and all the threads which share it. This is especially useful for apps which use thread/task pools sitting around waiting for work and cause excessive duplicate output. I needed this behavior recently when debugging a core with 700+ threads. Differential Revision: https://reviews.llvm.org/D33426 Reviewers: clayborg, jingham Patch by Brian Gianforcaro <b.gianfo@gmail.com> llvm-svn: 305197
* Fix backtrace of noreturn functions situated at the end of a modulePavel Labath2017-06-082-16/+18
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: When a call instruction is the last instruction in a function, the backtrace PC will point past the end of the function. We already had special code to handle that, but we did not handle the case where the PC ends up outside of the bounds of the module containing the function, which is a situation that occured in TestNoreturnUnwind on android for some arch/compiler combinations. I fix this by adding an argument to Address resolution code which states that we are ok with addresses pointing to the end of a module/section to resolve to that module/section. I create a reproducible test case for this situation by hand-crafting an executable which has a noreturn function at the end of a module. Reviewers: jasonmolenda, jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32022 llvm-svn: 304976
* Move Object format code to lib/BinaryFormat.Zachary Turner2017-06-072-4/+5
| | | | | | | | | | | | This creates a new library called BinaryFormat that has all of the headers from llvm/Support containing structure and layout definitions for various types of binary formats like dwarf, coff, elf, etc as well as the code for identifying a file from its magic. Differential Revision: https://reviews.llvm.org/D33843 llvm-svn: 304864
* Added new API to SBStructuredData classAbhishek Aggarwal2017-05-292-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Added API to access data types -- integer, double, array, string, boolean and dictionary data types -- Earlier user had to parse through the string output to get these values - Added Test cases for API testing - Added new StructuredDataType enum in public include file -- Replaced locally-defined enum in StructuredData.h with this new one -- Modified other internal files using this locally-defined enum Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: clayborg, lldb-commits Reviewed By: clayborg Subscribers: labath Differential Revision: https://reviews.llvm.org/D33434 llvm-svn: 304138
* Fix incorrect Status -> Error rename in IOHandlerPavel Labath2017-05-221-1/+1
| | | | | | | | | | | | | Change 302872 was a massive rename of the Error class to Status. The change included an incorrect rename of the "Status" window in the LLDB GUI from "Status to "Error". This patch undoes this incorrect rename and restores the status window's correct name. Differential Revision: https://reviews.llvm.org/D33241 Patch by Brian Gianforcaro. llvm-svn: 303553
* Remove an expensive lock from TimerPavel Labath2017-05-154-57/+56
| | | | | | | | | | | | | The Timer destructor would grab a global mutex in order to update execution time. Add a class to define a category once, statically; the class adds itself to an atomic singly linked list, and thus subsequent updates only need to use an atomic rather than grab a lock and perform a hashtable lookup. Differential Revision: https://reviews.llvm.org/D32823 Patch by Scott Smith <scott.smith@purestorage.com>. llvm-svn: 303058
* Update StructuredData::String to return StringRefs.Zachary Turner2017-05-122-11/+10
| | | | | | | | It was returning const std::string& which was leading to unnecessary copies all over the place, and preventing people from doing things like Dict->GetValueForKeyAsString("foo", ref); llvm-svn: 302875
* Rename Error -> Status.Zachary Turner2017-05-1230-175/+183
| | | | | | | | | | | | | | | This renames the LLDB error class to Status, as discussed on the lldb-dev mailing list. A change of this magnitude cannot easily be done without find and replace, but that has potential to catch unwanted occurrences of common strings such as "Error". Every effort was made to find all the obvious things such as the word "Error" appearing in a string, etc, but it's possible there are still some lingering occurences left around. Hopefully nothing too serious. llvm-svn: 302872
* [LLDB][MIPS] Fix TestStepOverBreakpoint.py failure.Nitesh Jain2017-05-041-0/+4
| | | | | | | | | | Reviewers: jingham, labath Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D32168 llvm-svn: 302139
* Provide a mechanism to do some pre-loading of symbols up front.Jim Ingham2017-04-281-0/+16
| | | | | | | | | | | Loading a shared library can require a large amount of work; rather than do that serially for each library, this patch will allow parallelization of the symbols and debug info name indexes. From scott.smith@purestorage.com https://reviews.llvm.org/D32598 llvm-svn: 301609
OpenPOWER on IntegriCloud