summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* build: use cmake to find the libedit contentSaleem Abdulrasool2018-05-223-1/+68
| | | | | | | | Use proper cmake techniques to detect where the libedit package resides. This allows for the use of libedit from an alternative location which is needed for supporting cross-compilation. llvm-svn: 333041
* Normalize some lldb #include statements.James Y Knight2018-05-2222-67/+37
| | | | | | | | | | | Most non-local includes of header files living under lldb/sources/ were specified with the full path starting after sources/. However, in a few instances, other sub-directories were added to include paths, or Normalize those few instances to follow the style used by the rest of the codebase, to make it easier to understand. llvm-svn: 333035
* Avoid using header from Host/macosx when not testing an apple build.James Y Knight2018-05-221-2/+6
| | | | llvm-svn: 333032
* Enable ProcessMachCore plugin on non-apple platformsPavel Labath2018-05-226-10/+6
| | | | | | | | | | | | | | | | | | | Summary: The plugin already builds fine on other platforms (linux, at least). All that was necessary was to revitalize the hack in PlatformDarwinKernel (not a very pretty hack, but it gets us going at least). I haven't done a thorough investigation of the state of the plugin on other platforms, but at least the two core file tests we have seem to pass, so I enable them. Reviewers: JDevlieghere, jasonmolenda Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D47133 llvm-svn: 332997
* Work around some odd instruction single-step behavior on macOS.Jim Ingham2018-05-223-29/+64
| | | | | | | | | | | | | | | | | | | | | We've seen some cases on macOS where you go to instruction single step (over a breakpoint), and single step returns but the instruction hasn't been executed (and the pc hasn't moved.) The ThreadPlanStepOverBreakpoint used to handle this case by accident, but the patches to handle two adjacent breakpoints broke that accident. This patch fixes the logic of ExplainsStop to explicitly handle the case where the pc didn't move. It also adds a WillPop that re-enables the breakpoint we were stepping over. We never want an unexpected path through the plan to fool us into not doing that. I have no idea how to make this bug happen. It is very inconsistent when it occurs IRL. We really need a full MockProcess Plugin before we can start to write tests for this sort of system hiccup. <rdar://problem/38505726> llvm-svn: 332922
* Fix the Xcode project for the refactoring of theJim Ingham2018-05-211-0/+18
| | | | | | DWARF reader. llvm-svn: 332914
* Enable Python API for OpenBSD.Zachary Turner2018-05-211-0/+3
| | | | | | Patch by David Carlier llvm-svn: 332877
* Fix PathMappingList for relative and empty paths after recent FileSpec ↵Greg Clayton2018-05-218-73/+248
| | | | | | | | | | | | | | | | | | normalization changes PathMappingList was broken for relative and empty paths after normalization changes in FileSpec. There were also no tests for PathMappingList so I added those. Changes include: Change PathMappingList::ReverseRemapPath() to take FileSpec objects instead of ConstString. The only client of this was doing work to convert to and from ConstString objects for no reason. Normalize all paths prefix and replacements that are added to the PathMappingList vector so they match the paths that have been already normalized in the debug info Unify code in the two forms of PathMappingList::RemapPath() so only one contains the actual functionality. Prior to this, there were two versions of this code. Use FileSpec::AppendPathComponent() and remove a long standing TODO so paths are correctly appended to each other. Added tests for absolute, relative and empty paths. Differential Revision: https://reviews.llvm.org/D47021 llvm-svn: 332842
* Reland "[DWARF] Extract indexing code into a separate class hierarchy"Pavel Labath2018-05-2112-702/+911
| | | | | | | After this commit, the xcode project will need to be updated to include the new files added here. llvm-svn: 332841
* Improve coverage of the apple-tables testPavel Labath2018-05-212-4/+30
| | | | | | | | | | | After closer examination, it turns out we mis-classify one of the methods only if two of the structs have the same name. Since this was meant to be a basic test, I rename one of the structs in the test so that we have at least some coverage for the apple tables lookup. Instead, I create an XFAILed test which specifically targets the same-name case (and file a bug to track it). llvm-svn: 332833
* Add some apple-tables lookup testsPavel Labath2018-05-214-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Now that we are able to parse MachO files everywhere, we can write some cross-platform tests for handling of apple accelerator tables. This reruns the same lookup tests we have for manual indexes on MachO files which will use the accelerator tables instead. This makes sure we return the same results regardless of the method we used to access the debug info. The tests confirm we return the same results for looking up types, namespaces and variables, but have found an inconsistency in the treatment of function lookup. In the function case we mis-classify the method "foo" declared in the local struct sbar (inside function ffbar). We classify it as a function whereas it really is a method. Preliminary analysis suggests this is because DWARFASTParserClang::GetClangDeclContextForDIE returns null when given the local "struct sbar" DIE. This causes us to get the wrong CompilerDeclContext when we ask for the context of the inner foo, which means CompilerDeclContext::ISStructUnionOrClass returns false. Until this is fixed, I do not include the darwin versions of the "base" and "method" function lookup tests. Reviewers: JDevlieghere, clayborg Subscribers: aprantl, ilya-biryukov, ioeric, lldb-commits Differential Revision: https://reviews.llvm.org/D47064 llvm-svn: 332831
* [lldb] Fix compile warnings in r332702Eric Liu2018-05-182-4/+5
| | | | | | | | | | | | | | | | Summary: - Fix #include path - Fix warning: ```` error: format specifies type 'unsigned long long' but the argument has type 'uint64_t' (aka 'unsigned long') [-Werror,-Wformat] ``` Reviewers: labath, javed.absar Differential Revision: https://reviews.llvm.org/D47072 llvm-svn: 332733
* Revert "[DWARF] Extract indexing code into a separate class hierarchy"Amara Emerson2018-05-1812-911/+702
| | | | | | | This reverts commit r332719 due to breaking this green dragon build: http://green.lab.llvm.org/green/job/lldb-xcode/6644 llvm-svn: 332730
* [DWARF] Extract indexing code into a separate class hierarchyPavel Labath2018-05-1812-702/+911
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This places the `if(m_using_apple_tables)` branches inside the SymbolFileDWARF class behind an abstract DWARFIndex class. The class currently has two implementations: - AppleIndex, which searches using .apple_names and friends - ManualIndex, which searches using a manually built index Most of the methods of the class are very simple, and simply extract the list of DIEs for the given name from the appropriate sub-table. The main exception are the two GetFunctions overloads, which take a couple of extra paramenters, including some callbacks. It was not possible to split these up the same way as other methods, as here we were doing a lot of post-processing on the results. The post-processing is similar for the two cases, but not identical. I hope to factor these further in separate patches. Other interesting methods are: - Preload(): do any preprocessing to make lookups faster (noop for AppleIndex, forces a build of the lookup tables for ManualIndex). - ReportInvalidDIEOffset(): Used to notify the users of an invalid index (prints a message for AppleIndex, noop for ManualIndex). - Dump(): dumps the index state (noop for AppleIndex, prints the lookup tables for ManualIndex). Reviewers: clayborg, JDevlieghere Subscribers: mgorny, aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D46889 llvm-svn: 332719
* Add back #ifdef __APPLE__ to ↵Pavel Labath2018-05-182-3/+3
| | | | | | | | | | | RegisterContextDarwin_xxx::NumSupportedHardwareWatchpoints It turns out these class still contained some os-specific functionality, but I did not notice that originally, as it was #ifdef arm(64). This adds back the __APPLE__ condition to these particular functions, unbreaking arm builds on other OSs. llvm-svn: 332710
* Make ObjectFileMachO work on non-darwin platformsPavel Labath2018-05-186-31/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this patch we were unable to write cross-platform MachO tests because the parsing code did not compile on other platforms. The reason for that was that ObjectFileMachO depended on RegisterContextDarwin_arm(64)? (presumably for core file parsing) and the two Register Context classes uses constants from the system headers (KERN_SUCCESS, KERN_INVALID_ARGUMENT). As far as I can tell, these two files don't actually interact with the darwin kernel -- they are used only in ObjectFileMachO and MacOSX-Kernel process plugin (even though it has "kernel" in the name, this one communicates with it via network packets and not syscalls). For the time being I have created OS-independent definitions of these constants and made the register context classes use those. Long term, the error handling in these classes should be probably changed to use more standard mechanisms such as Status or Error classes. This is the only change necessary (apart from build system glue) to make ObjectFileMachO work on other platforms. To demonstrate that, I remove REQUIRES:darwin from our (only) cross-platform mach-o test. Reviewers: jasonmolenda, aprantl, clayborg, javed.absar Subscribers: mgorny, lldb-commits, kristof.beyls Differential Revision: https://reviews.llvm.org/D46934 llvm-svn: 332702
* Fix _NSCFBoolean data formatter.Jonas Devlieghere2018-05-182-5/+7
| | | | | | | | | | | | | In r265181 the test for the NSCFBoolean data formatter was removed. Later, in r279353 and r279446 a new implementation was provided for the formatter, which I believe never worked (and this wasn't caught because the test was never re-enabled). This commit fixes the bug and re-enables the old test case. Differential revision: https://reviews.llvm.org/D47014 llvm-svn: 332700
* [Windows, Process] LLDB reads wrong registers on 64bit WindowsStella Stamenova2018-05-171-16/+16
| | | | | | | | | | | | | | | | | | Summary: LLDB reads wrong registers on 64bit Windows because RegisterContextWindows_x64::GetRegisterInfoAtIndex returns wrong reference. I encountered broken backtrace when the program stopped at function which does not have prologue code, such as compiled with '-fomit-frame-pointer'. In this situation, CFA is equal to rsp but LLDB reads r9. RegisterContextWindows_x64::GetRegisterInfoAtIndex depends the order of lldb_XXX_x86_64 values, but RegisterIndex/g_register_infos/g_gpr_reg_indices does not follow order. In source/Plugins/Process/Utility/lldb-x86-register-enums.h The order of GPRs is rax, rbx, rcx, rdx, rdi, rsi, rbp, rsp, r8, ... In source/Plugins/Process/Windows/Common/x64/RegisterContextWindows_x64.cpp The order of GPRs is rax, rbx, rcx, rdx, rdi, rsi, r8, r9, r10, ... Patch by Kenji Koyanagi llvm-svn: 332671
* [Windows, Process] Fix an issue in windows thread handling that was causing ↵Stella Stamenova2018-05-173-7/+25
| | | | | | | | | | | | | | | | LLDB to hang Summary: The function ResumeThread on Windows returns a DWORD which is an unsigned int. In TargetThreadWindows::DoResume, there's code that determines how many times to call ResumeThread based on whether the return value is greater than 0. Since the function returns -1 (as an unsigned int) on failure, this was getting stuck in an infinite loop if ResumeThread failed for any reason. The correct thing to do is check whether the return value is -1 and then return the appropriate error instead of ignoring the return value. Reviewers: asmith, zturner, labath Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47020 llvm-svn: 332670
* Fix buildbots after it 332618Greg Clayton2018-05-171-2/+0
| | | | llvm-svn: 332633
* [lit, lldbsuite] Disable tests that are failing because of pr21765 and pr24489Stella Stamenova2018-05-173-0/+3
| | | | | | | | | | | | | | Summary: These three tests are failing on Windows and looking into the failures, they could be mapped to pr21765 and pr24489 Reviewers: asmith, labath, zturner Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D47018 llvm-svn: 332629
* FileSpec objects that resolve to "." should have "." in m_filename and ↵Greg Clayton2018-05-172-4/+14
| | | | | | | | | | | | m_directory empty. After switching to LLVM normalization, if we init FileSpec with "." we would end up with m_directory being NULL and m_filename being "". This patch fixes this by allowing the path to be normalized and if it normalized to nothing, set it to m_filename. Differential Revision: https://reviews.llvm.org/D46783 llvm-svn: 332618
* [DWARF] Have HashedNameToDIE store a DataExtractor by valuePavel Labath2018-05-171-2/+2
| | | | | | | | | | | | | | | | | Summary: The DataExtractors are cheap to copy so there is no reason to store them by reference. Also, in my upcoming indexing refactor I am planning to remove the apple tables data extractor members from the SymbolFileDWARF class, so there will not be a DataExtractor with a suitable lifetime to refer to. Reviewers: clayborg, JDevlieghere Subscribers: aprantl, lldb-commits Differential Revision: https://reviews.llvm.org/D46888 llvm-svn: 332596
* Revert 332511 after reverting llvm revision 332508.Greg Clayton2018-05-161-4/+4
| | | | llvm-svn: 332556
* Fix FileSpecTest after LLVM changes to remove_dots ↵Greg Clayton2018-05-161-4/+4
| | | | | | (https://reviews.llvm.org/D46887) llvm-svn: 332511
* Reapply "Remove Process references from the Host module"Pavel Labath2018-05-159-28/+38
| | | | | | This re-lands r332250/D46395, after fixing Mac build errors. llvm-svn: 332353
* [lit] Fix several tests that fail when using Python 3 or on WindowsStella Stamenova2018-05-143-12/+27
| | | | | | | | | | | | | | | | Summary: 1) In logtest.cpp, the name of the file that is reported is not always capitalized, so split the comparison to validate the file (case insensitive) and function (case sensitive) separately 2) Update the gdb remote client tests to work with Python 3. In Python 3, socket sends/receives data as bytes rather than byte strings. This also updates the usage of .hex() - this is no longer available in Python 3, so use hexlify instead Reviewers: asmith, labath, zturner Reviewed By: labath Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D46773 llvm-svn: 332293
* Revert "Remove Process references from the Host module"Pavel Labath2018-05-149-38/+29
| | | | | | | | | | The first fix wasn't enough, there is still a missing ProcessInstanceInfo include in Host.mm. I won't be able to test a fix before leaving work, so I am reverting both commits. This reverts commit r332250 and the subsequent fix attempt. llvm-svn: 332261
* Fix macosx build broken by r332250Pavel Labath2018-05-141-0/+1
| | | | llvm-svn: 332255
* Remove Process references from the Host modulePavel Labath2018-05-149-29/+37
| | | | | | | | | | | | | | | | | | | | | The Process class was only being referenced because of the last-ditch effort in the process launchers to set a process death callback in case one isn't set already. Although launching a process for debugging is the most important kind of "launch" we are doing, it is by far not the only one, so assuming this particular callback is the one to be used is not a good idea (besides breaking layering). Instead of assuming a particular exit callback, I change the launcher code to require the callback to be set by the user (and fix up the two call sites which did not set the callback already). Reviewers: jingham, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D46395 llvm-svn: 332250
* FileSpec: Remove PathSyntax enum and use llvm version insteadPavel Labath2018-05-147-118/+93
| | | | | | | | | | | | | | | | | | | | Summary: The llvm version of the enum has the same enumerators, with stlightly different names, so this is mostly just a search&replace exercise. One concrete benefit of this is that we can remove the function for converting between the two enums. To avoid typing llvm::sys::path::Style::windows everywhere I import the enum into the FileSpec class, so it can be referenced as FileSpec::Style::windows. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D46753 llvm-svn: 332247
* Use const_iterator in DWARFUnitJan Kratochvil2018-05-131-3/+3
| | | | | | | Function DWARFUnit::GetDIE is using m_die_array only for reading so it can use DWARFDebugInfoEntry::const_iterator. llvm-svn: 332201
* Revert "Protect DWARFCompileUnit::m_die_array by a new mutex"Jan Kratochvil2018-05-132-18/+3
| | | | | | | | | Pavel Labath found this patch is incomplete and racy. I think there needs to be some more mutexes even before considering DW_TAG_partial_unit. This reverts commit 331229 which was: https://reviews.llvm.org/D40470 llvm-svn: 332200
* Revert "[LLDB] Support GNU-style compressed debug sections (.zdebug)"Davide Italiano2018-05-124-135/+135
| | | | | | | | | | This reverts commit r332162 as it breaks the bots (Ubuntu 14.04) with the following message: Build Command Output: objcopy: option '--compress-debug-sections' doesn't allow an argument llvm-svn: 332165
* [LanguageRuntime/ObjC] Turn off ISA logging once and for all.Davide Italiano2018-05-121-4/+6
| | | | | | On behalf of Jim, who's out today. llvm-svn: 332163
* [LLDB] Support GNU-style compressed debug sections (.zdebug)Davide Italiano2018-05-124-135/+135
| | | | | | | | Patch by Erik Welander! Differential Revision: https://reviews.llvm.org/D45628 llvm-svn: 332162
* Conditionally compile a Darwin-only test.Adrian Prantl2018-05-111-0/+2
| | | | llvm-svn: 332140
* Yet another follow-up to r332111. This also handles the case where anAdrian Prantl2018-05-112-12/+17
| | | | | | | LLDB.framework is built inside the LLDB build directory (but not inside an Xcode installation). llvm-svn: 332126
* Fix a regression in r332111. The LLDB.framework path component is notAdrian Prantl2018-05-112-2/+14
| | | | | | usually the last component. llvm-svn: 332120
* Add a lock to PlatformPOSIX::DoLoadImageFrederic Riss2018-05-114-49/+31
| | | | | | | | | | | | | | Summary: Multiple threads could be calling into DoLoadImage concurrently, only one should be allowed to create the UtilityFunction. Reviewers: jingham Subscribers: emaste, lldb-commits Differential Revision: https://reviews.llvm.org/D46733 llvm-svn: 332115
* HostInfoMacOSX: Share the clang resource directory with Swift.Adrian Prantl2018-05-114-7/+97
| | | | | | | | | | | | | Inside Xcode and in Xcode toolchains LLDB is always in lockstep with the Swift compiler, so it can reuse its Clang resource directory. This allows LLDB and the Swift compiler to share the same Clang module cache. rdar://problem/40039633 Differential Revision: https://reviews.llvm.org/D46736 llvm-svn: 332111
* Remove custom path manipulation functions from FileSpecPavel Labath2018-05-112-89/+9
| | | | | | | | | | | | | | | | | | | | Summary: now that llvm supports host-agnostic path manipulation functions (and most of their kinks have been ironed out), we can remove our copies of the path parsing functions in favour of the llvm ones. This should be NFC except for the slight difference in handling of the "//" path, which is now normalized to "/" (this only applies to the literal "//" path; "//net" and friends still get to keep the two slashes). Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D46687 llvm-svn: 332088
* Retrieve the deployment target when retrieving an object file's triple.Adrian Prantl2018-05-112-12/+238
| | | | | | | | | | | | Getting the deployment target can be significant information when rebuilding clang modules since availability information could depend on it. rdar://problem/40039633 Differential Revision: https://reviews.llvm.org/D46669 llvm-svn: 332067
* Fix the code that gets the Xcode path. After path normalization this could ↵Greg Clayton2018-05-101-1/+1
| | | | | | | | was failing. This meant if the "debugserver" binary was removed from the LLDB.framework, lldb wouldn't be able to find debugserver. llvm-svn: 332050
* Fix one more RunShellcommand occurence in mac codePavel Labath2018-05-101-1/+2
| | | | llvm-svn: 331977
* Fix windows&mac builds broken by r331970 (RunShellCommand/Timeout) refactorPavel Labath2018-05-102-3/+4
| | | | llvm-svn: 331974
* Convert all RunShellCommand functions to use the Timeout classPavel Labath2018-05-1015-64/+63
| | | | | | | this completes the Timeout migration started in r331880 with the Predicate class. llvm-svn: 331970
* CPlusPlusLanguage: Add unit tests for the FindAlternateFunctionManglings methodPavel Labath2018-05-101-2/+23
| | | | | | | | I was considering modifying this function, so I wrote some tests to make sure I don't regress its behavior. I am not sure if I will actually proceed with the modifications, but the tests seem useful nonetheless. llvm-svn: 331966
* [cmake, unittests] Fix the CMake file for the LLDB unittests to support ↵Stella Stamenova2018-05-091-2/+2
| | | | | | | | | | | | | | | | multiple configurations Summary: The current setup for the unit tests only works correctly when the generator does not support multiple configurations. When the generator supports multiple configurations, the inputs are not copied to the correct per-configuration directory. This change sets up the build to copy the inputs in each configuration directory. Reviewers: labath, asmith, zturner Reviewed By: labath Subscribers: mgorny, llvm-commits Differential Revision: https://reviews.llvm.org/D46642 llvm-svn: 331914
* General cleanup to minimize the .debug_types patchGreg Clayton2018-05-0916-335/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | This cleanup is designed to make the https://reviews.llvm.org/D32167 patch smaller and easier to read. Cleanup in this patch: Allow DWARFUnit subclasses to hand out the data that should be used when decoding data for a DIE. The information might be in .debug_info or could be in .debug_types. There is a new virtual function on DWARFUnit that each subclass must override: virtual const lldb_private::DWARFDataExtractor &DWARFUnit::GetData() const; This allows DWARFCompileUnit and eventually DWARFTypeUnit to hand out different data to be used when decoding the DIE information. Add a new pure virtual function to get the size of the DWARF unit header: virtual uint32_t DWARFUnit::GetHeaderByteSize() const = 0; This allows DWARFCompileUnit and eventually DWARFTypeUnit to hand out different offsets where the first DIE starts when decoding DIE information from the unit. Added a new function to DWARFDataExtractor to get the size of an offset: size_t DWARFDataExtractor::GetDWARFSizeOfOffset() const; Removed dead dumping and parsing code in the DWARFDebugInfo class. Inlined a bunch of calls in DWARFUnit for accessors that were just returning integer member variables. Renamed DWARFUnit::Size() to DWARFUnit::GetHeaderByteSize() as it clearly states what it is doing and makes more sense. Differential Revision: https://reviews.llvm.org/D46606 llvm-svn: 331892
OpenPOWER on IntegriCloud