summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* Xcode: support gtests that use the Inputs dirTodd Fiala2016-09-192-79/+125
| | | | | | | | | | | | | | | | This change adds support for the gtests that require input data in the Inputs files. This is done through a new Xcode script phase that runs the scripts/Xcode/prepare-gtest-run-dir.sh script. That script simply copies the contents of all unittests/**/Inputs dirs into ${TARGET_BUILD_DIR}/Inputs before running the test. This change also renames the Xcode 'gtest-for-debugging' to 'gtest-build', and makes the gtest "build and run" target depend on gtest-build. This reduces replication within the targets. gtest .c/.cpp files now should only be added to the gtest-build target. llvm-svn: 281913
* Fix boolean logic error in BreakpointID.Zachary Turner2016-09-171-1/+1
| | | | llvm-svn: 281804
* Convert many functions to use StringRefs.Zachary Turner2016-09-1725-99/+207
| | | | | | | | | | | | | Where possible, remove the const char* version. To keep the risk and impact here minimal, I've only done the simplest functions. In the process, I found a few opportunities for adding some unit tests, so I added those as well. Tested on Windows, Linux, and OSX. llvm-svn: 281799
* Fix compiler warnings where two values weren't being initialized.Greg Clayton2016-09-161-2/+2
| | | | llvm-svn: 281770
* Set the correct triple when creating an ArchSpec for Windows.Zachary Turner2016-09-161-0/+3
| | | | | | | Patch by Walter Erquinigo Differential Revision: https://reviews.llvm.org/D24283 llvm-svn: 281765
* Add unit tests for a few string conversion functions in Args.Zachary Turner2016-09-1610-48/+133
| | | | | | | Also provided a StringRef overload for these functions and have the const char* overloads delegate to the StringRef overload. llvm-svn: 281764
* [RenderScript] Support tracking and dumping reduction kernelsLuke Drummond2016-09-162-59/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initial implementation of support for tracking [RenderScript Reductions](https://developer.android.com/guide/topics/renderscript/compute.html#reduction-in-depth) With this patch, `language renderscript module dump` properly lists reductions that are part of loaded RenderScript modules as well the the consituent functions and their roles, within the reduction. This support required new tracking mechanisms for the `#pragma(reduce)` mechanism, and extension of `RSModuleDescriptor::ParseRSInfo` to support the metadata output by `bcc`. This work was also an opportunity to refactor/improve parse code: - `RSModuleDescriptor::ParseExportReduceCount` now has a complete implementation and the debugger can correctly track reductions on receipt of a module hook. - `RSModuleDescriptor::Dump` now dumps Reductions as well as `ForEach` kernels. Also, fixed indentation of the output, and made indentation groupings in the source clearer. - `RSModuleDescriptor::ParseRSInfo` now returns true if the `".rs.info"` packet has nonzero linecount, rather than rejecting RenderScripts that don't contain kernels (an unlikely situation, but possibly valid). This was changed because scripts that only contained reductions were not being tracked in `RenderScriptRuntime::LoadModule`. - Refactor `RSModuleInfo::ParseRSInfo` and add reduction spec parser stub - Prepared ParseRSInfo to more easily be able to add new parser types - Use llvm::StringRef and llvm::StringMap helpers to make the parsing code cleaner - factor out forEachCount, globalVarCount, and pragmaCount parsing block to their own methods - Add ExportReduceCount Parser - Use `llvm::StringRef` in `RSKernelDescriptor` constructor - removed now superfluous `MAXLINE` macros as we've switched from `const char *` to `llvm::StringRef` llvm-svn: 281717
* add availability check to DarwinLog event testsTodd Fiala2016-09-161-0/+13
| | | | | | | | | | The pexpect-based tests properly checked for the stub reporting DarwinLog support. The event-based ones did not. This is fixed here. Swift CI bots are not currently building debugserver on macOS, so they don't have the DarwinLog support even when they pass the macOS 10.12 check. llvm-svn: 281696
* First tests for serializing breakpoints.Jim Ingham2016-09-168-36/+276
| | | | | | Plus a few bug fixes I found along the way. llvm-svn: 281690
* Allow ArchSpec to take a StringRef.Zachary Turner2016-09-153-108/+152
| | | | llvm-svn: 281662
* [cmake] Don't depend on lldb-server unless it's built.Zachary Turner2016-09-151-1/+6
| | | | llvm-svn: 281661
* Fixing bot failuresChris Bieneman2016-09-151-1/+3
| | | | | | Need to only add debugserver as a test dependency on Darwin. llvm-svn: 281652
* [LIT] First pass of LLDB LIT supportChris Bieneman2016-09-1512-2/+255
| | | | | | | | | | | | | | | | | | | | | Summary: This patch supplies basic infrastructure for LLDB to use LIT, and ports a few basic test cases from the LLDB test suite into LIT. With this patch the LLDB lit system is not capable or intended to fully replace the existing LLDB test suite, but this first patch enables people to write lit tests for LLDB. The lit substitution for %cc and %cxx default to the host compiler unless the CMake option LLDB_TEST_CLANG is On, in which case the in-tree clang will be used. The target check-lldb-lit will run all lit tests including the lit-based executor for the unit tests. Alternatively there is a target generated for each subdirectory under the lit directory, so check-lldb-unit and check-lldb-expr will run just the tests under their respective directories. The ported tests are not removed from the existing suite, and should not be until such a time when the lit runner is mature and in use by bots and workflows. Reviewers: zturner, labath, jingham, tfiala Subscribers: beanz, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D24591 llvm-svn: 281651
* Convert ArchSpec::ParseMachOCPUDashSubtypeTriple to use StringRef.Zachary Turner2016-09-153-48/+37
| | | | | | | | | | | | | This makes the code easier to grok, and since this is a very low level function it also is very helpful to have this take a StringRef since it means anyone higher up the chain who has a StringRef would have to first convert it to a null-terminated string. This way it can work equally well with StringRefs or const char*'s, which will enable the conversion of higher up functions to StringRef. Tested on Windows, Linux, and OSX and saw no regressions. llvm-svn: 281642
* added LLDB_PYTHON_TESTSUITE_ARCH Xcode variableTodd Fiala2016-09-151-2/+6
| | | | | | | | | | | This Xcode build variable defaults to x86_64. It can be set to i386 to cause the lldb-python-test-suite target run the tests in the specified architecture. This flag is being added for the zorg build script so that Green Dragon can run the test suite against both x86_64 and i386 macOS targets. llvm-svn: 281639
* Reformat x86_64 register infos defines tableDimitar Vlahovski2016-09-151-72/+41
| | | | | | | Fix the table format of the register defines after clang-format. Added guards to prevent future reformatting again from clang-format. llvm-svn: 281606
* Fix TestSymbolContextTwoFiles on Android after rL281595Tamas Berghammer2016-09-151-1/+1
| | | | llvm-svn: 281601
* Add support for DW_AT_ranges_base attributeTamas Berghammer2016-09-1510-33/+95
| | | | | | | | | | | | | It is a new attribute emitted by clang as a GNU extension and will be part of Dwarf5. The purpose of the attribute is to specify a compile unit level base value for all DW_AT_ranges to reduce the number of relocations have to be done by the linker. Fixes (at least partially): https://llvm.org/pr28826 Differential revision: https://reviews.llvm.org/D24514 llvm-svn: 281595
* Try to fix windows build after rL281569Tamas Berghammer2016-09-152-2/+2
| | | | llvm-svn: 281594
* Make the keys enumerations for options and resolvers enum classes.Jim Ingham2016-09-154-13/+16
| | | | | | | This keeps them from conflicting with other symbols names, so it's worth their being less convenient to use for indexing. llvm-svn: 281569
* More cleanup in `frame diagnose,` eliminating a bunch of messy cases.Sean Callanan2016-09-143-60/+33
| | | | llvm-svn: 281545
* Replaced two instances of std::function with auto.Sean Callanan2016-09-142-8/+6
| | | | | | | | Thanks to Zachary Turner for the suggestion. It's distasteful that the actual type of the lambda can't be spelled out, but it should be evident from the definition of the lambda body. llvm-svn: 281536
* Cleaned up a little bit of redundant code in 'frame diagnose.`Sean Callanan2016-09-141-11/+19
| | | | llvm-svn: 281534
* Use 'enum class' instead of 'enum' in NativeRegisterContextLinux_x86_x64.Valentina Giusti2016-09-142-36/+36
| | | | | | | | | | Reviewers: labath, clayborg, zturner Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24578 llvm-svn: 281528
* Add SB API's for writing breakpoints to & creating the from a file.Jim Ingham2016-09-1411-115/+407
| | | | | | | | | | | Moved the guts of the code from CommandObjectBreakpoint to Target (should have done it that way in the first place.) Added an SBBreakpointList class so there's a way to specify which breakpoints to serialize and to report the deserialized breakpoints. <rdar://problem/12611863> llvm-svn: 281520
* Fix some const-ness issues with BreakpointID & BreakpointIDList.Jim Ingham2016-09-143-10/+12
| | | | llvm-svn: 281519
* Use Intel CPU flags to determine target supported features.Valentina Giusti2016-09-143-117/+183
| | | | | | | | | | | | | Summary: This patch uses the instruction CPUID to verify that FXSAVE, XSAVE, AVX and MPX are supported by the target hardware. In case the HW supports XSAVE, and at least one of the extended register sets, it further checks if the target software has the kernel support for such features, by verifying that their XSAVE part is correctly managed. Differential Revision: https://reviews.llvm.org/D24559 llvm-svn: 281507
* Cleaned up the code that handles function return addresses in "frame diagnose."Sean Callanan2016-09-141-18/+33
| | | | llvm-svn: 281428
* Force c++14 when running tests on Windows.Zachary Turner2016-09-131-0/+1
| | | | | | | | | VS 2015 and higher begin making use of c++14 in their standard library headers. As such, -std=c++11 makes it so you can't compile trivial programs. Bump this to -std=c++14 when this situation is detected. llvm-svn: 281420
* TestQueues could error out because the one second sleep main.c wasJason Molenda2016-09-132-3/+6
| | | | | | | | using to enqueue all the jobs wasn't enough time on a slow/overloaded system. Instead use a global to indicate when all the work has been enqueued, let's see if this makes the CIs work more reliably. llvm-svn: 281418
* Cleaned up some of the "frame diagnose" code to use Operands as currency.Sean Callanan2016-09-135-80/+210
| | | | | | | Also added some utility functions around Operands to make code easier and more compact to write. llvm-svn: 281398
* Add some unit tests for ArchSpec.Zachary Turner2016-09-134-2/+108
| | | | | | | | | | | | I'm was trying to do some cleanup and code modernization and in doing so I needed to change ParseMachCPUDashSubtypeTriple to take a StringRef. To ensure I don't break anything, I'm adding some unit tests for this function. As a side benefit, this also expands test coverage of this function to all platforms, since in general this code would rarely be exercised on non Mac platforms, and never in the test suite. llvm-svn: 281387
* Some more pointer safety in Breakpoint.Zachary Turner2016-09-1313-108/+123
| | | | | | | | | | | Plumb unique_ptrs<> all the way through the baton interface. NFC, this is a minor improvement to remove the possibility of an accidental pointer ownership issue. Reviewed By: jingham Differential Revision: https://reviews.llvm.org/D24495 llvm-svn: 281360
* fixup Xcode build for removal of MIUtilParse.*Todd Fiala2016-09-131-6/+0
| | | | llvm-svn: 281352
* Fix a merge mishap in rL281348Dimitar Vlahovski2016-09-131-2/+0
| | | | llvm-svn: 281349
* MinidumpParsing: pid, modules, exceptions, stringsDimitar Vlahovski2016-09-137-69/+412
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: Added parsing of the MiscInfo data stream. The main member of it that we care about is the process_id On Linux generated Minidump (from breakpad) we don't have the MiscInfo, we have the /proc/$pid/status from where we can get the pid. Also parsing the module list - the list of all of the loaded modules/shared libraries. Parsing the exception stream. Parsing MinidumpStrings. I have unit tests for all of that. Also added some tests using a Minidump generated from Windows tools (not from breakpad) Reviewers: labath, zturner Subscribers: beanz, lldb-commits Differential Revision: https://reviews.llvm.org/D24385 llvm-svn: 281348
* Remove MIUtilParse (no longer used)Pavel Labath2016-09-133-152/+0
| | | | | | | | | | | | | Summary: follow-up to https://reviews.llvm.org/D23882 Reviewers: dawn, krytarowski, labath, ki.stfu Subscribers: beanz, mgorny, labath, ki.stfu, lldb-commits Differential Revision: https://reviews.llvm.org/D23883 Author: Michał Górny <mgorny@gentoo.org> llvm-svn: 281317
* Fix linux build after rL281273Tamas Berghammer2016-09-131-1/+1
| | | | llvm-svn: 281309
* Reduce the number of simultaneous debug sessions to 10 and removeJason Molenda2016-09-132-2/+1
| | | | | | | | | | | | | the expectedFlakeyDarwin annotation. I've been running this test in isolation on my macOS Sierra system and haven't seen a failure in 20-30 runs. The number of simultaneous debug sessions that it spins up could be a problem when the testbots are running under load, so I'm reducing this from 20 simultaneous debug sessions to see if we can get enough stability to leave this enabled. llvm-svn: 281291
* Add a few const's (thanks Zachary) and return shared or unique pointersJim Ingham2016-09-1317-78/+98
| | | | | | in places where they help prevent leaks. llvm-svn: 281288
* Fix an issue where LLDB was not masking enough bits off of objc classes ↵Enrico Granata2016-09-131-1/+14
| | | | | | | | data() pointers, effectively rendering us unable to generate descriptors for some classes Fixes rdar://27758358 llvm-svn: 281282
* This is the main part of a change to add breakpoint save and restore to lldb.Jim Ingham2016-09-1223-255/+1859
| | | | | | | | | | | | | | | Still to come: 1) SB API's 2) Testcases 3) Loose ends: a) serialize Thread options b) serialize Exception resolvers 4) "break list --file" should list breakpoints contained in a file and "break read -f 1 3 5" should then read in only those breakpoints. <rdar://problem/12611863> llvm-svn: 281273
* xfail TestQueues.py and TestDarwinLogFilterMatchMessage.pyTodd Fiala2016-09-122-0/+9
| | | | | | | | | | | | | | It looks like the message-content-retrieval aspect of DarwinLog support is flaky, not just the regex match against it. Slightly less frequently than the regex matching, I am seeing the direct string-match variant of log-message-content matching also fail. Tracked by: llvm.org/pr30299 rdar://28237450 llvm-svn: 281251
* fix Xcode build after r281226Todd Fiala2016-09-121-1/+1
| | | | llvm-svn: 281243
* Move StdStringExtractor to tools/debugserverPavel Labath2016-09-126-7/+4
| | | | | | | | The class is only used in the debugserver. The rest of lldb has the StringExtractor class. Xcode project will need to be updated after this. llvm-svn: 281226
* Add MiSyntaxTestCase.test_lldbmi_output_grammar test (MI)Ilia K2016-09-122-3/+101
| | | | | | | | | | | | Summary: This patch adds a new test and fixes extra new-line before exit Reviewers: abidh Subscribers: ki.stfu, dawn, lldb-commits, abidh Differential Revision: https://reviews.llvm.org/D9740 llvm-svn: 281199
* Fix about a dozen compile warningsIlia K2016-09-128-23/+25
| | | | | | | | | | | | | | | | | | | | | | Summary: It fixes the following compile warnings: 1. '0' flag ignored with precision and ‘%d’ gnu_printf format 2. enumeral and non-enumeral type in conditional expression 3. format ‘%d’ expects argument of type ‘int’, but argument 4 has type ... 4. enumeration value ‘...’ not handled in switch 5. cast from type ‘const uint64_t* {aka ...}’ to type ‘int64_t* {aka ...}’ casts away qualifiers 6. extra ‘;’ 7. comparison between signed and unsigned integer expressions 8. variable ‘register_operand’ set but not used 9. control reaches end of non-void function Reviewers: jingham, emaste, zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D24331 llvm-svn: 281191
* async structured data packet handling improvementsTodd Fiala2016-09-105-46/+87
| | | | | | | | | | | | | | | | | | | | | | | This change does the following: * Changes the signature for the continuation delegate method that handles async structured data from accepting an already-parsed structured data element to taking just the packet contents. * Moves the conversion of the JSON-async: packet contents from GDBRemoteClientBase to the continuation delegate method. * Adds a new unit test for verifying that the $JSON-asyc: packets get decoded and that the decoded packets get forwarded on to the delegate for further processing. Thanks to Pavel for making that whole section of code easily unit testable! * Tightens up the packet verification on reception of a $JSON-async: packet contents. The code prior to this change is susceptible to a segfault if a packet is carefully crafted that starts with $J but has a total length shorter than the length of "$JSON-async:". Reviewers: labath, clayborg, zturner Differential Revision: https://reviews.llvm.org/D23884 llvm-svn: 281121
* xfail DarwinLog "filter message by regex" testsTodd Fiala2016-09-091-0/+10
| | | | | | | | | | These tests are not working reliably. I'm marking them xfail until I resolve the issue. Tracked by: llvm.org/pr30299 llvm-svn: 281058
* [LLDB][MIPS] Fix Emulation for JALR64 InstructionNitesh Jain2016-09-091-0/+1
| | | | | Subscribers: jaydeep, bhushan, slthakur, sdardis, lldb-commits llvm-svn: 281032
OpenPOWER on IntegriCloud