summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix misc -Wcast-qual warnings, NFCVedant Kumar2017-12-067-22/+29
| | | | llvm-svn: 319937
* Remove no-op function pointer null checks, NFCVedant Kumar2017-12-064-50/+29
| | | | | | | | | | | | | | Null-checking functions which aren't marked weak_import is a no-op (the compiler rewrites the check to 'true'), regardless of whether a library providing its definition is weak-linked. If the deployment target is greater than the minimum requirement, the availability markup on APIs does not lower to weak_import. Remove no-op null checks to clean up the code and silence warnings. Differential Revision: https://reviews.llvm.org/D40812 llvm-svn: 319936
* Use a static_cast instead of a C cast, NFCVedant Kumar2017-12-061-1/+1
| | | | | | Pointed out by Davide Italiano in post-commit review. llvm-svn: 319935
* [MappedHash] Fix alignment violationsVedant Kumar2017-12-061-6/+9
| | | | | | | This fixes a few alignment problems pointed out by UBSan, and is otherwise NFC. llvm-svn: 319934
* Do not use default arguments of DataLayout::getPointer*. NFCFangrui Song2017-12-061-5/+0
| | | | | | | | | | | | | | Summary: There are "FIXME"s in include/llvm/IR/DataLayout.h to remove the default arguments. Reviewers: zturner, clayborg Reviewed By: zturner Subscribers: bjope Differential Revision: https://reviews.llvm.org/D40064 llvm-svn: 319869
* [CMake] Use PRIVATE in target_link_libraries for executablesShoaib Meenai2017-12-053-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently use target_link_libraries without an explicit scope specifier (INTERFACE, PRIVATE or PUBLIC) when linking executables. Dependencies added in this way apply to both the target and its dependencies, i.e. they become part of the executable's link interface and are transitive. Transitive dependencies generally don't make sense for executables, since you wouldn't normally be linking against an executable. This also causes issues for generating install export files when using LLVM_DISTRIBUTION_COMPONENTS. For example, clang has a lot of LLVM library dependencies, which are currently added as interface dependencies. If clang is in the distribution components but the LLVM libraries it depends on aren't (which is a perfectly legitimate use case if the LLVM libraries are being built static and there are therefore no run-time dependencies on them), CMake will complain about the LLVM libraries not being in export set when attempting to generate the install export file for clang. This is reasonable behavior on CMake's part, and the right thing is for LLVM's build system to explicitly use PRIVATE dependencies for executables. Unfortunately, CMake doesn't allow you to mix and match the keyword and non-keyword target_link_libraries signatures for a single target; i.e., if a single call to target_link_libraries for a particular target uses one of the INTERFACE, PRIVATE, or PUBLIC keywords, all other calls must also be updated to use those keywords. This means we must do this change in a single shot. I also fully expect to have missed some instances; I tested by enabling all the projects in the monorepo (except dragonegg), and configuring both with and without shared libraries, on both Darwin and Linux, but I'm planning to rely on the buildbots for other configurations (since it should be pretty easy to fix those). Even after this change, we still have a lot of target_link_libraries calls that don't specify a scope keyword, mostly for shared libraries. I'm thinking about addressing those in a follow-up, but that's a separate change IMO. Differential Revision: https://reviews.llvm.org/D40823 llvm-svn: 319840
* [Darwin] Delete dead code. NFCI.Davide Italiano2017-12-051-28/+0
| | | | llvm-svn: 319832
* Add target.process.stop-on-exec setting, and obey it.Jim Ingham2017-12-054-13/+56
| | | | | | | | | | Also add a test. There should also be control for this in ProcessLaunchInfo and a "target launch" flag, but at least this will allow you to control it somehow. <rdar://problem/35842137> llvm-svn: 319731
* Clean up stop hook output in case a hook restarts.Jim Ingham2017-12-051-3/+10
| | | | | | | | | I was warning about the fact that this will abort further stop hooks, but didn't check that there WAS a further stop hook. Also the warning was missing a newline. llvm-svn: 319730
* Switch from C++1z to C++17; corresponds to r319688 in Clang.Aaron Ballman2017-12-041-1/+1
| | | | llvm-svn: 319694
* Makefile.rules: compile all tests with -fno-limit-debug-infoPavel Labath2017-12-0423-132/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This flag is on by default for darwin and freebsd, but off for linux. Without it, clang will sometimes not emit debug info for types like std::string. Whether it does this, and which tests will fail because of that depends on the linux distro and c++ library version. A bunch of tests were already setting these flags manually, but here instead I take a whole sale approach and enable this flag for all tests. Any test which does not want to have this flag (right now we have one such test) can turn it off explicitly via CFLAGS_EXTRAS+=$(LIMIT_DEBUG_INFO_FLAGS) This fixes a bunch of data formatter tests on red-hat. Reviewers: davide, jankratochvil Subscribers: emaste, aprantl, krytarowski, JDevlieghere, lldb-commits Differential Revision: https://reviews.llvm.org/D40717 llvm-svn: 319653
* Add a symbols subcommand to lldb-test.Zachary Turner2017-12-022-1/+36
| | | | | | Differential Revision: https://reviews.llvm.org/D40745 llvm-svn: 319599
* Don't use llvm::EnablePrettyStackTrace on macOS.Jim Ingham2017-12-021-0/+2
| | | | | | | | | | | | | | | | | LLDB.framework gets loaded into Xcode and other frameworks, and this is inserting a signal handler into the process even when lldb isn't used. I have a bunch of reports of this SignalHandler blowing out the stack, which renders crash reports for the crash useless. And in any case libraries really shouldn't be installing signal handlers. I only turned this off for APPLE platforms, I'll let the maintainers of other platforms decide what policy they want to have w.r.t. this. llvm-svn: 319598
* Fix warning in DynamicLoaderDarwinKernel.cpp, NFCVedant Kumar2017-12-011-1/+1
| | | | llvm-svn: 319597
* Fix warnings in JSON.cpp, NFCVedant Kumar2017-12-011-3/+0
| | | | | | These asserts are no-ops, and are supplanted by -Wcovered-switch. llvm-svn: 319596
* Fix warnings in DNBDataRef.cpp, NFCVedant Kumar2017-12-011-6/+6
| | | | llvm-svn: 319595
* Prevent vain lldb::user_id_t 0xffffffff lookupsJan Kratochvil2017-12-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | I have found LLDB commonly looks up lldb::user_id_t 0xffffffff failing to find its DIE. One would rather expect LLDB_INVALID_UID == 0xffffffffffffffff in such case. DWARFASTParserClang.cpp:495 492 type_sp.reset( 493 new Type(die.GetID(), dwarf, type_name_const_str, byte_size, NULL, 494 DIERef(encoding_uid).GetUID(dwarf), encoding_data_type, 495 &decl, clang_type, resolve_state)); encoding_uid = (DWARFFormValue) {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}} -> DIERef::DIERef(const DWARFFormValue &form_value = {m_cu = 0x0, m_form = 0, m_value = {value = {uval = 0, sval = 0, cstr = 0x0}, data = 0x0}}) -> (DIERef) {cu_offset = 0xffffffff, die_offset = 0xffffffff} -> lldb::user_id_t DIERef::GetUID(SymbolFileDWARF *dwarf = 0x61d00000b480) const -> Type::Type(lldb::user_id_t encoding_uid = 0xffffffff) But 0xffffffff != #define LLDB_INVALID_UID UINT64_MAX Differential revision: https://reviews.llvm.org/D37492 llvm-svn: 319580
* Kill struct IOVECPavel Labath2017-12-019-24/+10
| | | | | | | | | | | struct iovec is used as an interface to system (posix) api's. As such, we shouldn't be using it in os-independent code, and we shouldn't be defining our own iovec replacements. Fortunately, its usage was not very widespread, so the removal was very easy -- I simply moved a couple declarations into os-specific code. llvm-svn: 319536
* ClangASTContext::ParseClassTemplateDecl doesn't always succeed.Jim Ingham2017-12-011-1/+11
| | | | | | | | | When it does, it returns a NULL ClassTemplateDecl. Don't use it if it is NULL... <rdar://problem/35672107> llvm-svn: 319516
* Add lldb-test.Zachary Turner2017-12-017-0/+650
| | | | | | | | | | | | | | | | | | | | | This is basically a proof-of-concept and starting point for having a testing-centric tool in LLDB. I'm sure this leaves a lot of room to be desired, but this at least allows us to have something to build on. Right now there is only one command, the `module-sections` command, and I created this command not because it was particularly special, but because it addressed an immediate use case and was extremely simple. Run the tool as `lldb-test module-sections <path-to-object>`. Feel free to add testing related stuff to your heart's content after this goes in. Implementing the commands themselves takes some work, but once they're there they can be reused without writing any code and result in very easy to use and maintain tests. Differential Revision: https://reviews.llvm.org/D40636 llvm-svn: 319504
* We had a situation where a kext was inlined into the kernel,Jason Molenda2017-11-301-0/+10
| | | | | | | | | | | | but still listed in the kernel's kext table with the kernel binary UUID. This resulted in the kernel text section being loaded at the kext address and problems ensuing. Instead, if there is a kext with the same UUID as the kernel, lldb should skip over it. <rdar://problem/35757689> llvm-svn: 319500
* [lldb] A few minor fixes in TaskPoolAlexander Shaposhnikov2017-11-303-6/+25
| | | | | | | | | | | | | 1. Move TaskPool into the namespace lldb_private. 2. Add missing std::move in TaskPoolImpl::Worker. 3. std::thread::hardware_concurrency may return 0, handle this case correctly. Differential revision: https://reviews.llvm.org/D40587 Test plan: make check-all llvm-svn: 319492
* Fix this test so that the breakpoints you set areJim Ingham2017-11-302-2/+6
| | | | | | | | unambiguously on one bit of code. On macOS these lines mapped to two distinct locations, and that was artificially throwing off the test. llvm-svn: 319472
* Remove a long out-of-date comment.Jim Ingham2017-11-301-1/+0
| | | | llvm-svn: 319454
* Add a test case for open bug 35480Pavel Labath2017-11-305-0/+82
| | | | | | | The test is about failing to hit breakpoints in global constructors in shared libraries. llvm-svn: 319443
* Fix assertion in ClangASTContextPavel Labath2017-11-309-31/+36
| | | | | | | | | | | | | | | | | | | | | | Summary: llvm::APSInt(0) asserts because it creates an int with bit-width 0 and not (as I thought) a value 0. Theoretically it should be sufficient to change this to APSInt(1), as the intention there was that the value of the first argument should be ignored if the type is invalid, but that would look dodgy. Instead, I use llvm::Optional to denote an invalid value and use a special struct instead of a std::pair, to reduce typing and increase clarity. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40615 llvm-svn: 319414
* refactor: Simplify loop with DWARFCompileUnit::ExtractJan Kratochvil2017-11-301-6/+2
| | | | | | | | Forgotten small simplification in D40212. Differential revision: https://reviews.llvm.org/D40635 llvm-svn: 319402
* Fix the gtest target for the move of ArchSpecTest.cpp from Core to Utility.Jim Ingham2017-11-301-1/+1
| | | | | | <rdar://problem/35562389> llvm-svn: 319389
* refactor: Unify+simplify DWARFCompileUnit ctor+Clear() into in-class ↵Jan Kratochvil2017-11-294-80/+47
| | | | | | | | | | | | | | initializers + Extract() It has no functionality effect. I was concerned about the worse performance of DWARFDebugInfo::Parse this way of allocating+destroying a CU for each iteration but I see it is now used only by DWARFDebugInfo::Dump so that is no longer a problem. Differential revision: https://reviews.llvm.org/D40212 llvm-svn: 319359
* Add elf-core/RegisterUtilities.{cpp,h} to the project file.Jim Ingham2017-11-281-0/+6
| | | | llvm-svn: 319226
* Update remote debugging page with many more details.Greg Clayton2017-11-281-8/+132
| | | | llvm-svn: 319213
* Simplify UUID constructorsStephane Sezer2017-11-281-3/+2
| | | | | | | | | | | | Summary: This remove a small amount of duplicated code. Reviewers: clayborg, zturner, davide Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40536 llvm-svn: 319191
* elf-core: Convert remaining register context to use register set mapsPavel Labath2017-11-2823-195/+226
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In https://reviews.llvm.org/D39681, we started using a map instead passing a long list of register sets to the ppc64le register context. However, existing register contexts were still using the old method. This converts the remaining register contexts to use this approach. While doing that, I've had to modify the approach a bit: - the general purpose register set is still kept as a separate field, because this one is always present, and it's parsing is somewhat different than that of other register sets. - since the same register sets have different IDs on different operating systems, but we use the same register context class to represent different register sets, I've needed to add a layer of indirection to translate os-specific constants (e.g. NETBSD::NT_AMD64_FPREGS) into more generic terms (e.g. floating point register set). While slightly more complicated, this setup allows for better separation of concerns. The parsing code in ProcessElfCore can focus on parsing OS-specific core file notes, and can completely ignore architecture-specific register sets (by just storing any unrecognised notes in a map). These notes will then be passed on to the architecture-specific register context, which can just deal with architecture specifics, because the OS-specific note types are hidden in a register set description map. This way, adding an register set, which is already supported on other OSes, to a new OS, should in most cases be as simple as adding a new entry into the register set description map. Differential Revision: https://reviews.llvm.org/D40133 llvm-svn: 319162
* Fix floating point register write on new x86 linux kernelsPavel Labath2017-11-285-12/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: New linux kernels (on systems that support the XSAVES instruction) will not update the inferior registers unless the corresponding flag in the XSAVE header is set. Normally this flag will be set in our image of the XSAVE area (since we obtained it from the kernel), but if the inferior has never used the corresponding register set, the respective flag can be clear. This fixes the issue by making sure we explicitly set the flags corresponding to the registers we modify. I don't try to precisely match the flags to set on each write, as the rules could get quite complicated -- I use a simpler over-approximation instead. This was already caught by test_fp_register_write, but that was only because the code that ran before main() did not use some of the register sets. Since nothing in this test relies on being stopped in main(), I modify the test to stop at the entry point instead, so we can be sure the inferior did not have a chance to access these registers. Reviewers: clayborg, valentinagiusti Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40434 llvm-svn: 319161
* Remove some duplicated code in UUID.cppStephane Sezer2017-11-281-8/+1
| | | | | | | | | | | | | | Summary: Formatting needs to be done only once. Ran check-lldb and nothing changes. Reviewers: clayborg, davide Reviewed By: clayborg, davide Subscribers: zturner, davide, lldb-commits Differential Revision: https://reviews.llvm.org/D40519 llvm-svn: 319132
* Mark UUID::GetByteSize() constStephane Sezer2017-11-272-2/+2
| | | | | | | | | | | | | | | | Summary: This method doesn't modify anything in the object it's called on so we can mark it const to make it usable in a const context. Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40517 llvm-svn: 319095
* Remove custom TimePoint-formatting codePavel Labath2017-11-271-20/+3
| | | | | | | | This was a temporary thing, until llvm has proper support for formatting time. That time has come, so we can remove the relevant code. There should be no change in the format of the time. llvm-svn: 319048
* dotest: Mark more android targets as chattyPavel Labath2017-11-271-1/+1
| | | | | | | | | | New android ndk linker started adding more flags to the produced binaries, which causes older dynamic linkers display warnings to stderr about unsupported flags. This interferes with our stderr tests. Extend the hasChattyStderr function to catch these targets as well. llvm-svn: 319028
* Due to changes for DWZ I would need to update those such as renaming it toJan Kratochvil2017-11-252-27/+0
| | | | | | | | SetFileOffset. Differential revision: https://reviews.llvm.org/D40458 llvm-svn: 318981
* elf-core: Split up parsing code into os-specific functionsPavel Labath2017-11-235-226/+311
| | | | | | | | | | | | | | | | | | Summary: We've had a single function responsible for splitting a core segment into notes, and parsing the notes themselves, bearing in mind variations between 4 supported OS types. This commit splits that code into 5 pieces: - (os-independent) code for splitting a segment into individual notes - per-os function for parsing the notes into thread information Reviewers: clayborg, krytarowski, emaste, alexandreyy, kettenis Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D40311 llvm-svn: 318903
* Run clang-format on source/Host/common/Symbols.cppStephane Sezer2017-11-221-21/+22
| | | | | | I saw a bunch of style errors so this fixes them. llvm-svn: 318886
* Remove extra minuses from command optionTatyana Krasnukha2017-11-221-1/+1
| | | | | | | | | | | | Reviewers: labath, abidh, clayborg, ki.stfu Reviewed By: labath, abidh, clayborg, ki.stfu Subscribers: clayborg, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D40022 llvm-svn: 318846
* Remove unused variable.Tatyana Krasnukha2017-11-221-1/+1
| | | | llvm-svn: 318833
* Test commit. Fix typo in comment.Tatyana Krasnukha2017-11-221-1/+1
| | | | llvm-svn: 318832
* [Expression parser] Remove logging of field that is no longer in clang's ↵Craig Topper2017-11-201-1/+0
| | | | | | | | TargetOptions struct. The Reciprocals field was moved to CodeGenOptions. I don't think lldb was really using this field so I'm just removing the mention. llvm-svn: 318664
* Remove 2 unused methods DWARFDebugInfo::Find and their FindCallbackStringJan Kratochvil2017-11-192-81/+0
| | | | | | Differential revision: https://reviews.llvm.org/D40216 llvm-svn: 318631
* Add comments to DWARFCompileUnit length fields/methodsJan Kratochvil2017-11-191-9/+8
| | | | | | Differential revision: https://reviews.llvm.org/D40211 llvm-svn: 318626
* [ABI] Remove dead code that was copy-pasted all around. NFCI.Davide Italiano2017-11-182-82/+0
| | | | llvm-svn: 318580
* [Module] Throw away some more commented code. NFCI.Davide Italiano2017-11-181-37/+0
| | | | llvm-svn: 318579
* [ABI/SysV] Remove more dead code. NFCI.Davide Italiano2017-11-181-42/+0
| | | | llvm-svn: 318577
OpenPOWER on IntegriCloud