summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* ManualDWARFIndex: reduce long parameter listsPavel Labath2018-05-252-117/+93
| | | | | | | | | Several functions were passing a list of 8 NameToDIE arguments around. This puts those variables in a struct and passes that instead, reducing code duplication and the possibility of error (swapping two arguments accidentally). llvm-svn: 333264
* HostInfoMacOSX: Support finding the clang resource directory within CLTools.Adrian Prantl2018-05-252-9/+21
| | | | | | rdar://problem/40537961 llvm-svn: 333248
* Add DWARFBaseDie.{h,cpp} to the Xcode build.Jim Ingham2018-05-241-0/+6
| | | | | | This should unbreak the green dragon bot builds. llvm-svn: 333238
* Use DWARFBaseDIE as a compile-time protectionJan Kratochvil2018-05-244-10/+10
| | | | | | | | | As suggested by Pavel Labath in D46810 DWARFUnit::GetUnitDIEOnly() returning a pointer to m_first_die should not permit using methods like GetFirstChild(). Differential revision: https://reviews.llvm.org/D47276 llvm-svn: 333224
* DWARFDIE split out to DWARFBaseDIEJan Kratochvil2018-05-245-306/+358
| | | | | | | | | | | | This new DWARFBaseDIE is going to be used for DWARFUnit::GetUnitDIEOnly() as other DIEs are unavailable that time so the caller should not have methods available to access them. This patch is only a mechanical split without any use of it. Differential revision: https://reviews.llvm.org/D47275 llvm-svn: 333222
* pc's should be printed in hex...Jim Ingham2018-05-241-1/+1
| | | | llvm-svn: 333208
* Add SystemInitializerLLGS to the lldb-server target.Jim Ingham2018-05-241-1/+7
| | | | | | This should unbreak the xcode build. llvm-svn: 333207
* [lldb-mi] Add possibility to set breakpoints without selecting a target.Adrian Prantl2018-05-246-5/+41
| | | | | | | | | | | Now it's possible to set breakpoints before selecting a target, they will be set to the dummy target and then copied to an each added one. Patch by Alexander Polyakov! Differential Revision: https://reviews.llvm.org/D46588 llvm-svn: 333205
* Fix windows/mac builds broken by r333182.Pavel Labath2018-05-241-2/+2
| | | | | | | I should've known that something was wrong when only one of my plugins was prefixed by the lldb_private namespace. llvm-svn: 333183
* Move ObjectFile initialization out of SystemInitializerCommonPavel Labath2018-05-248-15/+90
| | | | | | | | | | | | | | | | | | | | | | Summary: For lldb-server, it is sufficient to parse only the native object file format for its target OS (no other file can be loaded into a running process). This moves the object file initialization code into specific initializer classes: lldb-test and liblldb get all object files; lldb-server gets only one of them. For this to work, I've needed to create a special SystemInitializer for use in lldb-server, instead of it calling directly into the common one. This reduces the size of lldb-server by about 2%, which is not earth-shattering, but it's an easy win, and it helps. Reviewers: zturner, clayborg Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47250 llvm-svn: 333182
* DWARF: Move indexing code from DWARFUnit to ManualDWARFIndexPavel Labath2018-05-244-346/+346
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: I think this makes sense for several reasons: - better separation of concerns: DWARFUnit's job should be to provide a nice interface to its users to access the unit contents. ManualDWARFIndex can then use this interface to build an index and provide it to its users. - closer alignment with llvm parsers: there is no indexing equivalent in llvm, and there probably never will be, as the index is very centered around how lldb wants to access debug info. If we ever switch to llvm's parser, this will allow us swap out DWARFUnit implementations and keep indexing as-is. - closer proximity of the indexing code to AppleDWARFIndex will make it easier to keep the two in sync (e.g. right now the two use very different algorithms to determine whether a DW_TAG_subroutine represents a "method"). This is my primary motivation for making this change now, but I am leaving this work to a separate patch. The only interface change to DWARFUnit I needed to make was to add an efficient way to iterate over the list of all DIEs. Adding this also aligns us closer to the llvm parser. Reviewers: JDevlieghere, clayborg, aprantl Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D47253 llvm-svn: 333178
* Add PPC64le support informationPavel Labath2018-05-243-4/+4
| | | | | | | | | | | | | | | Summary: Add PPC64le support information on LLDB site Reviewers: clayborg Reviewed By: clayborg Subscribers: labath, lldb-commits, lbianc, clayborg Differential Revision: https://reviews.llvm.org/D47285 Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>. llvm-svn: 333173
* Remove unused include, and corresponding library dependency.James Y Knight2018-05-242-2/+0
| | | | llvm-svn: 333151
* Add missing include.Zachary Turner2018-05-241-0/+1
| | | | llvm-svn: 333145
* Break dependency from Core to ObjectFileJIT.Zachary Turner2018-05-235-35/+33
| | | | | | | | | | | | | | | | | | The only reason this was here was so that Module could have a function called CreateJITModule which created things in a special order. Instead of making this specific to creating JIT modules, I converted this into a template function that can create a module for any type of object file plugin and just forwards arguments through. Since the template is not instantiated in Core, the linker (and header file) dependency moves to the point where it is instantiated, which only happens in Expression. Conceptually, this location also makes more sense for a dependency on ObjectFileJIT. After all, we JIT expressions so it's no surprise that Expression needs to make use of ObjectFileJIT. Differential Revision: https://reviews.llvm.org/D47228 llvm-svn: 333143
* Add a --synchronous option to lldb-mi to facilitate reliable testing.Adrian Prantl2018-05-234-0/+8
| | | | | | | | Patch by Alexander Polyakov! Differential Revision: https://reviews.llvm.org/D47110 llvm-svn: 333140
* Remove spurious dependency on Process/elf-core from Process/Utility.James Y Knight2018-05-237-31/+7
| | | | | | | These checks do absolutely nothing other than cause a library layering violation in the code. llvm-svn: 333134
* Fix PathMappingList tests on windowsPavel Labath2018-05-231-25/+24
| | | | | | | | | | The tests added in r332842 don't work on windows, because they do path comparisons on strings, and on windows, the paths coming out of the mappings had backslashes in them. This switches comparisons to FileSpecs, so the results come out right. llvm-svn: 333074
* ProcessLauncherPosixFork: move setgid call into the if(debug) branchPavel Labath2018-05-231-4/+4
| | | | | | | | | | | | | | | | This call was originally being only made when launching for debug (as an attempt to make sure we don't impart extra privileges on the launched process), but after the debug and non-debug paths were merged, it made it's way into generic code. This was causing problems in locked down android environments which disallowed calling setgid even if it would be a no-op. This prevented launching llgs from lldb-server platform. Overall I'm not sure we should be calling setgid in the first place (it seems random -- e.g. why don't we call setuid then as well). However, all our other copies of launch code have it, so I choose to keep it for now. llvm-svn: 333073
* [SymbolFilePDB] PDB_BuiltinType::Char16 and Char32 are unsigned in MSVC.Aaron Smith2018-05-231-2/+2
| | | | llvm-svn: 333055
* [SymbolFilePDB] Add a test for wchar_t type in PDB.Aaron Smith2018-05-233-0/+6
| | | | | | | | The wchar_t is unsigned. https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx llvm-svn: 333051
* [SymbolFilePDB] Add support for resolving variable symbolsAaron Smith2018-05-234-4/+420
| | | | | | | | | | | | | | | | | Summary: Implement FindGlobalVariables and ParseVariableContext methods. Compile unit information is necessary for resolving variable context, however some PDB symbols do not have this information. For now an empty DWARFExpression is used to construct a lldb::Variable instance with the limitation that using lldb to lookup the value of a global or local variable is not available. This commit may slow down lit/SymbolFile/PDB/compilands.test since the test includes MS specific modules that spend more time parsing variables. Reviewers: rnk, zturner, lldb-commits Subscribers: aprantl, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D45224 llvm-svn: 333049
* 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
OpenPOWER on IntegriCloud