summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* [IRMemoryMap] Test host-side allocationsVedant Kumar2018-05-312-3/+11
| | | | | | | | r333583 introduced testing for IRMemoryMap's process-side allocations (eAllocationPolicyProcessOnly). This adds support for the host-side variety (eAllocationPolicyHostOnly). llvm-svn: 333698
* [IRMemoryMap] Fix the alignment adjustment in MallocVedant Kumar2018-05-314-33/+49
| | | | | | | | | | | | | | | | | | | | This prevents Malloc from allocating the same chunk of memory twice, as a byproduct of an alignment adjustment which gave the client access to unallocated memory. Prior to this patch, the newly-added test failed with: $ lldb-test ir-memory-map ... ir-memory-map-overlap1.test ... Command: malloc(size=64, alignment=32) Malloc: address = 0x1000cd080 Command: malloc(size=64, alignment=8) Malloc: address = 0x1000cd0b0 Malloc error: overlapping allocation detected, previous allocation at [0x1000cd080, 0x1000cd0c0) Differential Revision: https://reviews.llvm.org/D47551 llvm-svn: 333697
* Set m_struct_valid to initial value in ctor. Jason Molenda2018-05-311-1/+2
| | | | | | | | Patch from Tom Tromey <ttromey@mozilla.com>. Differential Revision: https://reviews.llvm.org/D47481 llvm-svn: 333690
* Remove infinite recursion due to FileSpec change.Jonas Devlieghere2018-05-311-5/+3
| | | | | | | | | Fixes infinite recursion due to change in how FileSpec deals with removing the last path component. Fixes timout for TestMiniDumpNew.py llvm-svn: 333666
* Remove the TestSequenceFunctions "example" testPavel Labath2018-05-311-34/+0
| | | | | | | | This test was using unittest (not unittest2) as the test framework, and it worked with dotest only by accident. Remove it as we have a much more realistic example test in test/testcases/sample_test. llvm-svn: 333640
* Remove append parameter to FindGlobalVariablesPavel Labath2018-05-3124-144/+88
| | | | | | | | | | | | | | | | | | | Summary: As discussed in https://bugs.llvm.org/show_bug.cgi?id=37317, FindGlobalVariables does not properly handle the case where append=false. As this doesn't seem to be used in the tree, this patch removes the parameter entirely. Reviewers: clayborg, jingham, labath Reviewed By: clayborg Subscribers: aprantl, lldb-commits, kubamracek, JDevlieghere Differential Revision: https://reviews.llvm.org/D46885 Patch by Tom Tromey <ttromey@mozilla.com>. llvm-svn: 333639
* Simplify DWARFUnit::m_die_array swap() to use shrink_to_fit()Jan Kratochvil2018-05-311-9/+1
| | | | | | | | | rL145086 introduced m_die_array.shrink_to_fit() implemented by exact_size_die_array.swap, it was before LLVM became written in C++11. Differential revision: https://reviews.llvm.org/D47492 llvm-svn: 333636
* [lldb-test] ir-memory-map: Avoid accessing a bad iteratorVedant Kumar2018-05-301-10/+8
| | | | | | | Do not access Probe.start() when Probe is at the end of the interval map. llvm-svn: 333585
* [lldb-test] Add a testing harness for the JIT's IRMemoryMapVedant Kumar2018-05-303-20/+215
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This teaches lldb-test how to launch a process, set up an IRMemoryMap, and issue memory allocations in the target process through the map. This makes it possible to test IRMemoryMap in a targeted way. This has uncovered two bugs so far. The first bug is that Malloc performs an adjustment on the pointer returned from AllocateMemory (for alignment purposes) which ultimately allows overlapping memory regions to be created. The second bug is that after most of the address space on the host side is exhausted, Malloc may return the same address multiple times. These bugs (and hopefully more!) can be uncovered and tested for with targeted lldb-test commands. At an even higher level, the motivation for addressing these bugs is that they can lead to strange user-visible failures (e.g, variables assume the wrong value during expression evaluation, or the debugger crashes). See my third comment on this swift-lldb PR for an example: https://github.com/apple/swift-lldb/pull/652 I hope lldb-test is the right place to add this testing harness. Setting up a gtest-style unit test proved too cumbersome (you need to recreate or mock way too much debugger state), as did writing end-to-end tests (it's hard to write a test that actually hits a buggy path). With lldb-test, it's easy to read/generate the test input and parse the test output. I'll attach a simple "fuzz" tester which generates failing test cases to the Phab review. Here's an example: ``` Command: malloc(size=1024, alignment=32) Malloc: address = 0xca000 Command: malloc(size=64, alignment=16) Malloc: address = 0xca400 Command: malloc(size=1024, alignment=16) Malloc: address = 0xca440 Command: malloc(size=16, alignment=8) Malloc: address = 0xca840 Command: malloc(size=2048, alignment=16) Malloc: address = 0xcb000 Command: malloc(size=64, alignment=32) Malloc: address = 0xca860 Command: malloc(size=1024, alignment=16) Malloc: address = 0xca890 Malloc error: overlapping allocation detected, previous allocation at [0xca860, 0xca8a0) ``` {F6288839} Differential Revision: https://reviews.llvm.org/D47508 llvm-svn: 333583
* [LLDB] Re-apply r303907 that's reverted by mistakeTim Shen2018-05-302-7/+13
| | | | llvm-svn: 333552
* [FileSpec] Re-implmenet removeLastPathComponentJonas Devlieghere2018-05-303-30/+57
| | | | | | | | | | | | | | | | | | | | | When reading DBGSourcePathRemapping from a dSYM, we remove the last two path components to make the source lookup more general. However, when dealing with a relative path that has less than 2 components, we ended up with an invalid (empty) FileSpec. This patch changes the behavior of removeLastPathComponent to remove the last path component, if possible. It does this by checking whether a parent path exists, and if so using that as the new path. We rely entirely on LLVM's path implementation to do the heavy lifting. We now also return a boolean which indicates whether the operator was successful or not. Differential revision: https://reviews.llvm.org/D47495 rdar://37791687 llvm-svn: 333540
* @skipUnlessDarwin TestOrderedSetPavel Labath2018-05-301-0/+1
| | | | llvm-svn: 333526
* Fix return value of DWARFUnit::ExtractDIEsIfNeeded()Jan Kratochvil2018-05-301-6/+5
| | | | | | This is a leftover regression from: https://reviews.llvm.org/D46810 llvm-svn: 333517
* [LLDB] Revert r303907.Tim Shen2018-05-292-13/+7
| | | | | | See https://reviews.llvm.org/rL303907 for details about the bug. llvm-svn: 333478
* [ObjC] Add a Makefile for the test added in r333465.Davide Italiano2018-05-291-0/+6
| | | | | | | | | Not strictly necessary, but makes the test more robust in case we end up changing the defaults. <rdar://problem/40622096> llvm-svn: 333466
* [ObjC] Fix the formatter for NSOrderedSet.Davide Italiano2018-05-293-28/+30
| | | | | | | | While I'm here, delete some dead code. <rdar://problem/40622096> llvm-svn: 333465
* Remove unused DWARFUnit::HasDIEsParsed()Jan Kratochvil2018-05-292-4/+0
| | | | | | | It was not implemented correctly after https://reviews.llvm.org/D46810 but then it has not been used anywhere anyway. llvm-svn: 333452
* Fix compiler unused variable warning in DWARFUnitJan Kratochvil2018-05-291-2/+0
| | | | | | Alex Langford has reported it from: https://reviews.llvm.org/D46810 llvm-svn: 333449
* Remove lldb-private headers when building LLDB.framework with CMakeAlex Langford2018-05-291-2/+1
| | | | | | | | | | | | | | | | | | | | Summary: Generating LLDB.framework when building with CMake+Ninja will copy the lldb-private headers because public_headers contains them, even though we try to make sure they don't get copied by removing root_private_headers from root_public_headers. This patch also removes SystemInitializerFull.h from the LLDB.framework headers when building with CMake. Reviewers: compnerd, sas, labath, beanz, zturner Reviewed By: labath Subscribers: clayborg, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D47278 llvm-svn: 333444
* Fix DWARFUnit::GetUnitDIEPtrOnly stale pointerJan Kratochvil2018-05-295-80/+130
| | | | | | | | | | | | | GetUnitDIEPtrOnly() needs to return pointer to the first DIE. But the first element of m_die_array after ExtractDIEsIfNeeded(true) may move in memory after later ExtractDIEsIfNeeded(false). DWARFDebugInfoEntry::collection m_die_array is std::vector, its data may move during its expansion. Differential revision: https://reviews.llvm.org/D46810 llvm-svn: 333437
* [lit] Add support for passing arguments to dotest.py via lit.Jonas Devlieghere2018-05-291-0/+8
| | | | | | | | | | | | | | | | The lldb test suite is highly configurable. While part of this configuration takes place at configure/build-time, a common scenario involves running the test suite several times with different configuration. For example, we might want to test the current lldb against inferiors built with different compilers. This configuration was already possible for lldb-dotest, but was lacking for the lit counterpart. It is now possible to pass arguments to pass arguments like this: ./bin/llvm-lit ../llvm/tools/lldb/lit/Suite/ -Ddotest-args="-foo;-bar" llvm-svn: 333432
* [test] Fix --framework argument passed to dotest.Jonas Devlieghere2018-05-292-3/+7
| | | | | | | | | | The framework argument was broken when I removed the generator expressions upstream. I replaced $<TARGET_FILE_DIR:liblldb> with ${LLVM_LIBRARY_OUTPUT_INTDIR}) which is not correct. rdar://40534649 llvm-svn: 333412
* XFAIL TestMachCore for windows hostsPavel Labath2018-05-291-0/+1
| | | | | | | | It's been failing since I enabled the test for non-darwin targets. I made it reference the same bug as the linux core, as it's likely that the root cause is the same. llvm-svn: 333401
* Remove Linux-specific includes for posix/FileSystem.cppBruce Mitchener2018-05-291-5/+0
| | | | | | | | | | | | | | Summary: This improves the process of cross-compiling from macOS to Linux since these files aren't used / needed at all. Reviewers: clayborg, labath Subscribers: lldb-commits, krytarowski Differential Revision: https://reviews.llvm.org/D47420 llvm-svn: 333400
* Typo fixes.Bruce Mitchener2018-05-2937-72/+72
| | | | | | | | | | Reviewers: javed.absar Subscribers: ki.stfu, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D47421 llvm-svn: 333399
* ManualDWARFIndex: Treat DW_TAG_subprogram and DW_TAG_inlined_subroutine the ↵Pavel Labath2018-05-293-23/+154
| | | | | | | | | | | | | | | | | | | | | | | | | | | | same way Summary: We were treating subprograms and inlined subroutines differently when building the index. The difference was in which indexes were individual tags inserted (subprograms went to all indexes, where as inlined subroutines only into the basename and full name indexes). This seems like an error, because an inlined subroutine can still represent an C++ or an ObjC method. I don't see anything in the subprogram branch which should not apply to an inlined subroutine, so I propose to just treat them identically. This makes searching for an inlined method behave the same way as for the apple index. I write an assembly-based test because I did not want to depend on particular clang inlining behavior (and because I wanted to see how hard would it be). Reviewers: clayborg, JDevlieghere Subscribers: eraman, lldb-commits Differential Revision: https://reviews.llvm.org/D47368 llvm-svn: 333398
* NFC: Fix some comment typos.Bob Wilson2018-05-284-4/+4
| | | | llvm-svn: 333364
* Fix memory leak in SubsPrimitiveParmItaniumRaphael Isemann2018-05-271-1/+3
| | | | | | | | | | | | | | Summary: FastDemangle gives us a C-string that we own (which is allocated in SymbolDemangler::GetDemangledCopy). As we are not deleting the string, we leak memory whenever we call SubsPrimitiveParmItanium. Reviewers: javed.absar Subscribers: kristof.beyls, chrib, lldb-commits Differential Revision: https://reviews.llvm.org/D47418 llvm-svn: 333353
* Add missing includes to some LLDB headers.Raphael Isemann2018-05-264-0/+7
| | | | | | | | | | Summary: When compiling with modules, these missing includes cause the build to fail (as the header can't be compiled into a module). Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47412 llvm-svn: 333345
* Don't include headers from inside a namespace in MIUtilSingletonHelper.hRaphael Isemann2018-05-261-2/+2
| | | | | | | | Subscribers: ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D47410 llvm-svn: 333343
* Forward declare DumpValueObjectOptions in ValueObject.hRaphael Isemann2018-05-262-1/+4
| | | | | | | | | | | | Summary: This resolves unnecessary the header dependency from Core to DataFormatters. Patch is necessary for the introduction of C++ modules to the LLDB build system. Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D47409 llvm-svn: 333342
* Fix Xcode build broken by SystemInitializerFull.h moveAlex Langford2018-05-251-2/+2
| | | | llvm-svn: 333322
* Move SystemInitializerFull header to source/APIAlex Langford2018-05-253-2/+4
| | | | | | | | | | | | | | | | | | | Summary: It seems to me that files in include/lldb/API/ are headers that should be exposed to liblldb users. Because SystemInitializerFull.h exposes details of lldb_private, I think having it there is not the right thing to do. Since it's only included from files in source/API, we should move it there and treat it as private. Reviewers: labath, clayborg Reviewed By: labath, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D47342 llvm-svn: 333304
* Fix typo in CMake commentsAlex Langford2018-05-251-2/+2
| | | | llvm-svn: 333299
* Remove DWARFUnit::ClearDIEs parameter keep_compile_unit_dieJan Kratochvil2018-05-253-7/+6
| | | | | | | It has been now always passed as true and during planned D46810 it would no longer make sense. llvm-svn: 333287
* Fix format stringBenjamin Kramer2018-05-251-1/+1
| | | | | | | PRIx64 already has the x inside, so this was creating a nonsensical format string. llvm-svn: 333273
* ManualDWARFIndex: Fix misclassification of methods in unionsPavel Labath2018-05-254-8/+39
| | | | | | | Apple index was already treating them as methods. Not doing the same seems like an omission. llvm-svn: 333266
* 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
OpenPOWER on IntegriCloud