summaryrefslogtreecommitdiffstats
path: root/lldb
Commit message (Collapse)AuthorAgeFilesLines
...
* gdb-remote: Fix checksum verification for messages with escape charsPavel Labath2018-03-284-7/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: We've had a mismatch in the checksum computation between the sender and receiver. The sender computed the payload checksum using the wire encoding of the packet, while the receiver did this after expanding un-escaping and expanding run-length-encoded sequences. This resulted in communication breakdown if packets using these feature were sent in the ack mode. Normally, this did not cause any issues since the only packet we send in the ack-mode is the QStartNoAckMode packet, but I ran into this when debugging the lldb-server tests which (for better or worse) don't use this mode. According to the gdb-remote documentation "The two-digit checksum is computed as the modulo 256 sum of all characters between the leading ‘$’ and the trailing ‘#’", it seems that our sender is doing the right thing here. Therefore, I fix the receiver the match the sender behavior and add a test. With this bug fixed, we can see that lldb-server is sending a stop-reply after receiving the "k" in the same way as debugserver does (but we weren't detecting this because at that point the connection was dead already). I fix that expectation as well. Reviewers: clayborg, jasonmolenda Subscribers: mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D44922 llvm-svn: 328693
* Use the DWARF linkage name when importing C++ methods.Davide Italiano2018-03-277-8/+78
| | | | | | | | | | | | | | | | | | | | When importing C++ methods into clang AST nodes from the DWARF symbol table, preserve the DW_AT_linkage_name and use it as the linker ("asm") name for the symbol. Concretely, this enables `expression` to call into names that use the GNU `abi_tag` extension, and enables lldb to call into code using std::string or std::list from recent versions of libstdc++. See https://bugs.llvm.org/show_bug.cgi?id=35310 . It also seems broadly more robust than relying on the DWARF->clang->codegen pipeline to roundtrip properly, but I'm not immediately aware of any other cases in which it makes a difference. Patch by Nelson Elhage! Differential Revision: https://reviews.llvm.org/D40283 llvm-svn: 328658
* [Core] Correctly handle float division in Scalar.Davide Italiano2018-03-272-1/+9
| | | | | | | | Patch by Tom Tromey! Differential Revision: https://reviews.llvm.org/D44693 llvm-svn: 328649
* Add the same new entitlement from r326399 to Jason Molenda2018-03-261-0/+2
| | | | | | | the macos entitlement list. <rdar://problem/38887712> llvm-svn: 328591
* Fix check for verbose logging.Adrian Prantl2018-03-261-3/+2
| | | | | | Thanks to Pavel for pointing this out! llvm-svn: 328557
* Fix TestDisassembleBreakpoint broken by r328488Pavel Labath2018-03-262-33/+22
| | | | | | | | | | | | | | | | | The first issue was that the test was capturing the "before" disassembly before launching, and the "after" after. This is a problem because some of the disassembly will change after we know the load address (e.g. PCs in call instructions). I fix this by capturing both disassemblies with the process running. The second issue was that the refactor in r328488 accidentaly changed the meaning of the test, as it was no longer disassembling the function which contained the breakpoint. While inside, I also modernize the test to use lldbutil.run_to_source_breakpoint and prevent debug-info replication. llvm-svn: 328504
* Make @skipUnlessSupportedTypeAttribute windows-compatiblePavel Labath2018-03-261-5/+4
| | | | | | | | | - close_fds is not compatible with stdin/out redirection on windows. I just remove it, as this is not required for correct operation. - the command string was assuming a posix shell. I rewrite the Popen invocation to avoid the need for passing the arguments through a shell. llvm-svn: 328489
* Add and fix some tests for PPC64Pavel Labath2018-03-266-35/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: TestExprsChar.py Char is unsigned char by default in PowerPC. TestDisassembleBreakpoint.py Modify disassemble testcase to consider multiple architectures. TestThreadJump.py Jumping directly to the return line on PowerPC architecture dos not means returning the value that is seen on the code. The last test fails, because it needs the execution of some assembly in the beginning of the function. Avoiding this test for this architecture. TestEhFrameUnwind.py Implement func for ppc64le test case. TestWatchLocation.py TestStepOverWatchpoint.py PowerPC currently supports only one H/W watchpoint. TestDisassembleRawData.py Add PowerPC opcode and instruction for disassemble testcase. Reviewers: labath Reviewed By: labath Subscribers: davide, labath, alexandreyy, lldb-commits, luporl, lbianc Differential Revision: https://reviews.llvm.org/D44472 Patch by Alexandre Yukio Yamashita <alexandre.yamashita@eldorado.org.br>. llvm-svn: 328488
* [LLDB][PPC64] Fix TestGdbRemoteAuxvSupportPavel Labath2018-03-261-0/+15
| | | | | | | | | | | | | | | Summary: PPC64's auxvec has a special key that must be ignored. Reviewers: clayborg, labath Reviewed By: clayborg, labath Subscribers: alexandreyy, lbianc Differential Revision: https://reviews.llvm.org/D43771 Patch by Leandro Lupori <leandro.lupori@gmail.com>. llvm-svn: 328486
* Add a test for setting the load address of a module with differing ↵Pavel Labath2018-03-261-0/+19
| | | | | | | | | | | | | | | | | | | | | | | | | physical/virtual addresses Summary: First attempt at landing D42145 was reverted because it caused test failures on some android devices. It turned out this was because these devices had vdso modules with differing physical and virtual addresses. This was not caught earlier because all of the modules in our tests either lack physical addresses or have them identical to virtual ones. In the discussion on the patch, we came to the conclusion that in the scenario where we are merely setting a load address of a module (for example from a dynamic loader plugin), we should always use virtual addresses (i.e., preserve status quo). This patch adds a test to make sure we don't regress in that direction. Reviewers: owenpshaw Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D44738 llvm-svn: 328485
* Add support for __attribute__(trivial_abi).Jim Ingham2018-03-235-2/+150
| | | | | | <rdar://problem/36035075>, <rdar://problem/36035039> llvm-svn: 328389
* Remove CommandObjectStats.cpp & CleanUpTest.cpp fromJason Molenda2018-03-231-2/+0
| | | | | | installing in the man page directory. llvm-svn: 328383
* Put CommandObjectStats.cpp in lldb-core target, remove CommandObjectStats.h ↵Jason Molenda2018-03-231-4/+4
| | | | | | from targets. llvm-svn: 328382
* [Commands] Add a (currently empty) `stats` command.Davide Italiano2018-03-235-0/+66
| | | | | | | | | | | | | This one will be used to print statistics about lldb sessions (including, e.g. number of expression evaluation succeeded or failed). I decided to commit the skeleton first so that we have a clean reference on how a command should be implemented. My future commits are going to populate this command and test it. <rdar://problem/36555975> llvm-svn: 328378
* Change the darwin-debug target to build the standardJason Molenda2018-03-231-23/+8
| | | | | | archs. llvm-svn: 328374
* [CMakeLists] Update file list after recent changes.Davide Italiano2018-03-231-1/+0
| | | | llvm-svn: 328373
* [Commands] Remove dead code for unused `args` command.Davide Italiano2018-03-234-293/+0
| | | | | | | | | | It wasn't even registered. (lldb) apropos args No commands found pertaining to 'args'. Try 'help' to see a complete list of debugger commands. llvm-svn: 328370
* [Command] Remove dead code for the syntax command.Davide Italiano2018-03-235-148/+0
| | | | | | | I'm going to add a new commend so I figured I could do some spring cleaning. llvm-svn: 328368
* Log ObjC Runtime messages only in verbose modeAdrian Prantl2018-03-231-2/+2
| | | | llvm-svn: 328365
* [CommandObjectFrame] Remove dead code.Davide Italiano2018-03-231-3/+0
| | | | llvm-svn: 328278
* [SymbolFilePDB] Use section contributions as another way to determine the ↵Aaron Smith2018-03-221-16/+19
| | | | | | | | | compiland Some PDB Symbols don't have line information. Use the section contributions to determine their compiland. This is useful to determine the parent compiland for PDBSymbolTypeData, i.e. variables. llvm-svn: 328232
* [SymbolFilePDB] Ignore compiler generated functions when creating the LLDB ↵Aaron Smith2018-03-222-4/+7
| | | | | | type from a PDB llvm-svn: 328230
* [SymbolFilePDB] Run clang-format; NFCAaron Smith2018-03-224-120/+107
| | | | llvm-svn: 328176
* Last batch of test-tree cleaning changesPavel Labath2018-03-215-118/+80
| | | | | | | | | | | | | | | - postmortem tests: make sure the core files are created in the build folder - TestSourceManager: copy the .c file into the build dir before modifying it - TestLogging: create log files in the build folder After these changes I get a clean test run (on linux) even if I set the source tree to be read only. It's possible some of the skipped/xfailed tests are still creating files in the source tree, but at the moment, I don't have plans to go hunting for those. llvm-svn: 328106
* [dotest] Use subprocess.call to forward arguments in wrapperJonas Devlieghere2018-03-212-14/+11
| | | | | | | | | | | As suggested by Pavel on lldb-commits. Originally I picked os.system because it was so much more simple than the subprocess module, but that no longer holds true after yesterday's hack in r328020. This is what it should've been in the first place. Differential revision: https://reviews.llvm.org/D44728 llvm-svn: 328089
* Fix crash exposed by r328025Pavel Labath2018-03-211-2/+3
| | | | | | | | | | | | | | | | The issue was that the ASTDumper was being passed a null pointer (because we did not create any declaration for the operator==). The crash was in logging code, so it only manifested it self if you ran the tests with logging enabled (like our bots do). Given that this is logging code and the rest of the debugger is fine with the declaration being null, I just make sure the logging code can handle it as well. Right now I just do the null check in ClangExpressionDeclMap, but if the ASTDumper class is meant to be a debugging/logging aid, then it might be a good idea move the check inside the class itself. llvm-svn: 328088
* Fix TestOperatorOverload for 32-bit buildsPavel Labath2018-03-212-14/+4
| | | | | | | | | | | | - use more goodies from Makefile.rules to correctly build a 32-bit binary. - avoid hardcoding typeof(nil) in the test. This should partially fix the linux bot. There is still one assertion failure remaining, which I'll have to investigate separately, as I am not experiencing it locally. llvm-svn: 328083
* [Testsuite] Modernize this test to be run out-of-tree.Davide Italiano2018-03-201-5/+3
| | | | | | | | New tests should run the make syntax voodoo $@ and $< instead of hardcoding the names. We should also document how to write one, it's on my list. llvm-svn: 328062
* [ExpressionParser] Re-implement r327356 in a less disruptive way.Davide Italiano2018-03-2010-29/+78
| | | | | | | | | | | | Instead of applying the sledgehammer of refusing to insert any C++ symbol in the ASTContext, try to validate the decl if what we have is an operator. There was other code in lldb which was responsible for this, just not really exposed (or used) in this codepath. Also, add a better/more comprehensive test. <rdar://problem/35645893> llvm-svn: 328025
* [lldb-dotest] Wrap arguments in single quotesJonas Devlieghere2018-03-201-2/+6
| | | | | | | | If we don't wrap arguments to the wrapper in single quotes, combined arguments, for example for -E, don't reach dotest.py as a unit but as separate arguments, causing the latter to fail. llvm-svn: 328020
* [TestExpr] Fix a typo in a test, unbreaking the lldb Mac OS X bot.Davide Italiano2018-03-201-1/+1
| | | | llvm-svn: 328013
* Move StringExtractorGDBRemote.h to the include folderPavel Labath2018-03-2012-14/+14
| | | | | | | | While trying to use this header I noticed that it is not in the include folder. Move it to there and update all #includes to reference that file correctly. llvm-svn: 327996
* [LLDB] Fix TestTargetXMLArch's expected archPavel Labath2018-03-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Summary: When running on an architecture other than x86_64, the target.ConnectRemote() part of the test may add platform information to the target triple. It was observed that this happens at Process::CompleteAttach() method, after the platform_sp->IsCompatibleArchitecture() check fails. This method then calls platform_sp->GetPlatformForArchitecture(), that on a Linux machine ends up returning a generic Linux platform, that then ends up getting added to the original target architecture. Reviewers: clayborg, labath, jasonmolenda Reviewed By: labath Subscribers: alexandreyy, lbianc Differential Revision: https://reviews.llvm.org/D44022 Patch by Leandro Lupori <leandro.lupori@gmail.com>. llvm-svn: 327981
* Fix some tests for PPC64le architecturePavel Labath2018-03-204-15/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - Fix test jump for powerpc64le Jumping directly to the return line on power architecture dos not means returning the value that is seen on the code. The last test fails, because it needs the execution of some assembly in the beginning of the function. Avoiding this test for this architecture. - Avoid evaluate environ variable name on Linux On Linux the Symbol environ conflicts with another variable, then in order to avoid it, this test was moved into a specific test, which is not supported if the OS is Linux. - Added PPC64le as MIPS behavior Checking the disassembler output, on PPC64le machines behaves as MPIS. Added method to identify PPC64le architecture and checking it when disassembling instructions in the test case. Reviewers: labath Reviewed By: labath Subscribers: clayborg, labath, luporl, alexandreyy, sdardis, ki.stfu, arichardson Differential Revision: https://reviews.llvm.org/D44101 Patch by Leonardo Bianconi <leonardo.bianconi@eldorado.org.br>. llvm-svn: 327977
* Re-land: [lldb] Use vFlash commands when writing to target's flash memory ↵Pavel Labath2018-03-2018-62/+534
| | | | | | | | | | | | | | | | | | | | | | | | | | | | regions The difference between this and the previous patch is that now we use ELF physical addresses only for loading objects into the target (and the rest of the module load address logic still uses virtual addresses). Summary: When writing an object file over gdb-remote, use the vFlashErase, vFlashWrite, and vFlashDone commands if the write address is in a flash memory region. A bare metal target may have this kind of setup. - Update ObjectFileELF to set load addresses using physical addresses. A typical case may be a data section with a physical address in ROM and a virtual address in RAM, which should be loaded to the ROM address. - Add support for querying the target's qXfer:memory-map, which contains information about flash memory regions, leveraging MemoryRegionInfo data structures with minor modifications - Update ProcessGDBRemote to use vFlash commands in DoWriteMemory when the target address is in a flash region Original discussion at http://lists.llvm.org/pipermail/lldb-dev/2018-January/013093.html Reviewers: clayborg, labath Reviewed By: labath Subscribers: llvm-commits, arichardson, emaste, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D42145 Patch by Owen Shaw <llvm@owenpshaw.net>. llvm-svn: 327970
* Add a suggestion to convert dotest tests to use run_to_source_breakpoint.Jim Ingham2018-03-201-0/+14
| | | | llvm-svn: 327941
* [SymbolFilePDB] Simplify code with newer methodsAaron Smith2018-03-202-16/+4
| | | | llvm-svn: 327927
* [SymbolFilePDB] Simplify getting the source file pathAaron Smith2018-03-202-66/+2
| | | | | | | | | | | | Summary: Replace SymbolFilePDB::GetSourceFileNameForPDBCompiland() with PDBSymbolCompiland::getSourceFileFullPath(). Reviewers: zturner, rnk, lldb-commits Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44456 llvm-svn: 327925
* Modernize a test.Jim Ingham2018-03-191-29/+2
| | | | llvm-svn: 327924
* Rename remotectl_com.apple.internal.xpc.remote.debugserver.plistJason Molenda2018-03-193-8/+8
| | | | | | | | | to com.apple.internal.xpc.remote.debugserver.plist, not sure where that remotectl_ prefix came from. <rdar://problem/36751222> llvm-svn: 327922
* I didn't see that SocketAddress.cpp was already being pulledJason Molenda2018-03-191-6/+2
| | | | | | | | in to debugserver; my re-addition resulted in duplicated symbols. Remove my added SocketAddress.cpp, and change the original one to also be included for the debugserver-mini target. llvm-svn: 327918
* Add the ios-mini target to the top-level xcodeproj, which buildsJason Molenda2018-03-193-0/+124
| | | | | | | | the debugserver-mini target in debugserver. Add a new plist which needs to be installed for debugserver-mini. <rdar://problem/36751222> llvm-svn: 327915
* Add DWARFUnit.cpp to the correct target.Jason Molenda2018-03-191-6/+4
| | | | llvm-svn: 327913
* [SymbolFilePDB] Remove a few null pointer checks by passing refAaron Smith2018-03-193-63/+46
| | | | | | | | | | | | Reviewers: zturner, rnk, lldb-commits Reviewed By: zturner Subscribers: llvm-commits Differential Revision: https://reviews.llvm.org/D44455 llvm-svn: 327908
* [test] Skip flaky tests in TestMiSyntax on DarwinVedant Kumar2018-03-191-0/+3
| | | | | | These tests tend to time out locally and on our bots. llvm-svn: 327906
* [test] Skip flaky TestThreadStates tests on DarwinVedant Kumar2018-03-191-3/+3
| | | | | | | | These tests do not pass/fail consistently, so just skip them. This is llvm.org/pr15824 & rdar://problem/28557237. llvm-svn: 327905
* [ClangASTContext] Remove dead code. NFCI.Davide Italiano2018-03-191-45/+0
| | | | llvm-svn: 327893
* Xcode: Include DWARFUnit.{h,cpp} in the buildVedant Kumar2018-03-191-0/+8
| | | | | | This should address a bot failure due to r327809. llvm-svn: 327865
* Move the codebase to use: DWARFCompileUnit -> DWARFUnitJan Kratochvil2018-03-1827-222/+222
| | | | | | | | | | | | Now the codebase can use the DWARFUnit superclass. It will make it later seamlessly work also with DWARFPartialUnit for DWZ. This patch is only a search-and-replace easily undone, nothing interesting in it. Differential revision: https://reviews.llvm.org/D42892 llvm-svn: 327810
* DWARFUnit split out of DWARFCompileUnitJan Kratochvil2018-03-185-561/+796
| | | | | | | | | DW_TAG_partial_unit for DWZ can be then presented by DWARFPartialUnit also inherited from DWARFUnit. Differential revision: https://reviews.llvm.org/D40466 llvm-svn: 327809
OpenPOWER on IntegriCloud