summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-server
Commit message (Collapse)AuthorAgeFilesLines
* Add missing 'arch' key to valid qHostInfo keysFrancis Ricci2017-05-051-0/+1
| | | | | | | | | | | | | | Summary: 'arch' is a valid qHostInfo key, but the unit test for qHostInfo did not include it in the set of possible keys. Reviewers: tfiala, labath Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D32711 llvm-svn: 302260
* Remove HostThreadLinux/Free/NetBSDPavel Labath2017-03-173-0/+69
| | | | | | | | | | | | | | | | | | | | | | Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
* Fix flakyness in TestGdbRemoteHostInfoPavel Labath2017-03-022-10/+0
| | | | | | | | | this test was using the VPATH hack to avoid having a copy of the inferior source code. This makes the test fail if in happens to run concurrently with a test in the parent folder. Fix that by moving it up to the parent. llvm-svn: 296741
* Add a comment to describe purpose of signal-filtering testEugene Zemtsov2017-02-281-0/+2
| | | | llvm-svn: 296427
* Support NetBSD Thread ID in lldb-server testsKamil Rytarowski2017-02-272-0/+10
| | | | | | | | | | | | | | | | | | | | | Summary: Native Thread ID is retrieved with _lwp_self() on NetBSD. The returned value is of type int32_t, but for consistency with other Operating Systems cast it to uint64_t. Sponsored by <The NetBSD Foundation> Reviewers: joerg, labath, clayborg, emaste Reviewed By: labath, clayborg Subscribers: #lldb Tags: #lldb Differential Revision: https://reviews.llvm.org/D30374 llvm-svn: 296360
* Hardware breakpoints for Linux on Arm/AArch64 targetsOmair Javaid2017-02-242-14/+61
| | | | | | | | Please look at below differential link for upstream discussion. Differential revision: https://reviews.llvm.org/D29669 llvm-svn: 296119
* Implement QPassSignals GDB package in lldb-serverPavel Labath2017-02-244-1/+157
| | | | | | | | | | | | | | | Summary: QPassSignals package allows lldb client to tell lldb-server to ignore certain types of signals and re-inject them back to inferior without stopping execution. Reviewers: jmajors, labath Subscribers: danalbert, srhines, emaste, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30286 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 296101
* Finish the reformatting of the lldb-server test executablesPavel Labath2017-02-233-366/+316
| | | | | | This also reformats the executables in subfolders of lldb-server tests. llvm-svn: 295952
* Reformat inferior's main.cpp in lldb-server testPavel Labath2017-02-232-333/+302
| | | | | | | | | | | | | | | | | Summary: main.cpp is complete mess of tabs and spaces. This change brings it to compliance with LLVM coding style. Reviewers: jmajors, labath Reviewed By: jmajors, labath Subscribers: krytarowski, jingham, lldb-commits Tags: #lldb Differential Revision: https://reviews.llvm.org/D30234 Author: Eugene Zemtsov <ezemtsov@google.com> llvm-svn: 295950
* Prevent client from querying each thread's PC at each stop.Pavel Labath2017-01-201-3/+116
| | | | | | | | | | | | | | | | | | Summary: The server was no longer sending the thread PCs the way the client expected them. I changed the server to send them back as a threadstop info field, similar to the Apple version of the server. I also changed the client to look for them there, before querying the server. I added a test to ensure the server doesn't stop sending them. Reviewed By: labath Differential Revision: https://reviews.llvm.org/D28880 Author: Jason Majors llvm-svn: 292611
* [LLDB][MIPS] Fix TestLldbGdbServer failure for MIPSNitesh Jain2017-01-101-1/+9
| | | | | | | | | | Reviewers: labath, clayborg Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D27088 llvm-svn: 291554
* [LLDB][MIPS] Revert TestLldbGdbServer failure for MIPSNitesh Jain2017-01-101-9/+1
| | | | llvm-svn: 291553
* [LLDB][MIPS] Fix TestLldbGdbServer failure for MIPSNitesh Jain2017-01-101-1/+9
| | | | | | | | | | Reviewers: labath, clayborg Subscribers: jaydeep, bhushan, lldb-commits, slthakur Differential Revision: https://reviews.llvm.org/D27088 llvm-svn: 291549
* [LLDB][MIPS] Fix some test case failures due to elf_abi field of ↵Nitesh Jain2016-12-091-0/+1
| | | | | | | | | | | | qprocessInfo packet. Reviewers: jaydeep, bhushan, clayborg Subscribers: slthakur, lldb-commits Differential Revision: https://reviews.llvm.org/D26542 llvm-svn: 289209
* [LLDB][MIPS] Fix TestLldbGdbServer.py failureNitesh Jain2016-09-091-1/+3
| | | | | Subscribers: jaydeep, bhushan, slthakur, lldb-commits llvm-svn: 281026
* Fix test breakage in r280919Pavel Labath2016-09-081-1/+5
| | | | | | | | | | | It turns out that self.dbg.GetSelectedPlatform().GetTriple() is not a good way to get the triple of the process, as it returns the incorrect triple in case of a 32-bit process running on a 64-bit platform. Instead, go the long way round and ask the stub for the process triple. This fixes the test for i386. llvm-svn: 280922
* gdb-remote: Add jModulesInfo packetPavel Labath2016-09-081-0/+39
| | | | | | | | | | | | | | | | | | | | | Summary: This adds the jModulesInfo packet, which is the equivalent of qModulesInfo, but it enables us to query multiple modules at once. This makes a significant speed improvement in case the application has many (over a hundred) modules, and the communication link has a non-negligible latency. This functionality is accessed by ProcessGdbRemote::PrefetchModuleSpecs(), which does the caching. GetModuleSpecs() is modified to first consult the cache before asking the remote stub. PrefetchModuleSpecs is currently only called from POSIX-DYLD dynamic loader plugin, after it reads the list of modules from the inferior memory, but other uses are possible. This decreases the attach time to an android application by about 40%. Reviewers: clayborg Subscribers: tberghammer, lldb-commits, danalbert Differential Revision: https://reviews.llvm.org/D24236 llvm-svn: 280919
* *** This commit represents a complete reformatting of the LLDB source codeKate Stone2016-09-0620-626/+1236
| | | | | | | | | | | | | | | | | | | | | | | *** to conform to clang-format’s LLVM style. This kind of mass change has *** two obvious implications: Firstly, merging this particular commit into a downstream fork may be a huge effort. Alternatively, it may be worth merging all changes up to this commit, performing the same reformatting operation locally, and then discarding the merge for this particular commit. The commands used to accomplish this reformatting were as follows (with current working directory as the root of the repository): find . \( -iname "*.c" -or -iname "*.cpp" -or -iname "*.h" -or -iname "*.mm" \) -exec clang-format -i {} + find . -iname "*.py" -exec autopep8 --in-place --aggressive --aggressive {} + ; The version of clang-format used was 3.9.0, and autopep8 was 1.2.4. Secondly, “blame” style tools will generally point to this commit instead of a meaningful prior commit. There are alternatives available that will attempt to look through this change and find the appropriate prior commit. YMMV. llvm-svn: 280751
* remove dependence of TestGdbRemoteExitCode.py on parent directory sourceTodd Fiala2016-09-053-4/+391
| | | | | | | | | | | | As Pavel pointed out in a comment on llvm.org/pr30271, the VPATH I was using here to eliminate duplication of a .cpp file had a side effect of attempting to pull in a .o/.obj file from that same parent dir, where other tests can be running in parallel. This is no good. For now, I have removed the VPATH, which should address llvm.org/pr30271. I have also removed the XFAIL. llvm-svn: 280675
* Add default_packet_timeout key to the new TestGdbRemoteHostInfo testPavel Labath2016-09-051-1/+2
| | | | | | android targets use this key, so the test should recognize it. llvm-svn: 280652
* XFAIL TestGdbRemoteExitCode failing testsTodd Fiala2016-09-041-0/+2
| | | | | | | Tracked by: llvm.org/pr30271 llvm-svn: 280606
* [NFC] Darwin llgs support from Week of CodeTodd Fiala2016-09-047-96/+300
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This code represents the Week of Code work I did on bringing up lldb-server LLGS support for Darwin. It does not include the Xcode project changes needed, as we don't want to throw that switch until more support is implemented (i.e. this change is inert, no build systems use it yet. I've verified on Ubuntu 16.04, macOS Xcode and macOS cmake builds). This change does some minimal refactoring of code that is shared with the Linux LLGS portion, moving it from NativeProcessLinux into NativeProcessProtocol. That code is also used by NativeProcessDarwin. Current state on Darwin: * Process launching is implemented. (Attach is not). Launching on devices has not yet been tested (FBS/BKS might need a bit of work). * Inferior waitpid monitoring and communication of exit status via MainLoop callback is implemented. * Memory read/write, breakpoints, thread register context, etc. are not yet implemented. This impacts process stop/resume, as the initial launch suspended immediately starts the process up and running because it doesn't know it is supposed to remain stopped. * I implemented the equivalent of MachThreadList as NativeThreadListDarwin, in anticipation that we might want to factor out common parts into NativeThreadList{Protocol} and share some code here. After writing it, though, the fallout from merging Mach Task/Process into a single concept plus some other minor changes makes the whole NativeThreadListDarwin concept nothing more than dead weight. I am likely going to get rid of this class and just manage it directly in NativeProcessDarwin, much like I did for NativeProcessLinux. * There is a stub-out call for starting a STDIO thread. That will go away and adopt the MainLoop pselect-based IOObject reading. I am developing the fully-integrated changes in the following repo, which contains the necessary Xcode bits and the glue that enables lldb-debugserver on a macOS system: https://github.com/tfiala/lldb/tree/llgs-darwin This change also breaks out a few of the lldb-server tests into their own directory, and adds some $qHostInfo tests (not sure why I didn't write those tests back when I initially implemented that on the Linux side). llvm-svn: 280604
* Fix tests for the gdb-remote memory read packetsPavel Labath2016-08-182-47/+11
| | | | | | | | Part of TestGDBRemoteMemoryRead has been disabled since r259379 because it was incompatible with python3. This changes the test to use the lldb-server test framework, which is a more appropriate method of testing raw stub behaviour anyway (and should avoid the whole python 3 issue). llvm-svn: 279039
* Make sure LldbGdbServerTestCase is built in arm mode to avoid failures due ↵Omair Javaid2016-08-112-3/+11
| | | | | | | | thumb instructions Differential revision: https://reviews.llvm.org/D23395 llvm-svn: 278326
* Support loading files even when incorrect file name specified by the linkerTamas Berghammer2016-07-221-1/+1
| | | | | | | | | | | | | | | "Incorrect" file name seen on Android whene the main executable is called "app_process32" (or 64) but the linker specifies the package name (e.g. com.android.calculator2). Additionally it can be present in case of some linker bugs. This CL adds logic to try to fetch the correct file name from the proc file system based on the base address sepcified by the linker in case we are failed to load the module by name. Differential revision: http://reviews.llvm.org/D22219 llvm-svn: 276411
* Enable test log collection from remote debug servers (take 2)Pavel Labath2016-07-041-8/+0
| | | | | | | | | | | | | | | | | | Summary: This is a slightly reworked version of D16322, which I had reverted because it did not do what it advertised. Differences from the previous version are: - moved the code for cleaning up the remote working dir to a later point as it was removing the log file before we could get to it. - specialised log downloading code for gdb-remote tests is not needed, as this will cover that use case as well. Reviewers: tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D21898 llvm-svn: 274491
* Add missing qRegisterInfo option to gdbremote testcaseFrancis Ricci2016-04-251-0/+1
| | | | | | | | | | | | | | Summary: "gcc" is equivalent to "ehframe" in ProcessGDBRemote, but only "ehframe" was a valid response in the test suite. Reviewers: tfiala, jasonmolenda, clayborg Subscribers: lldb-commits, sas Differential Revision: http://reviews.llvm.org/D18807 llvm-svn: 267459
* [test] Relax stderr expectations on targets with chatty outputPavel Labath2016-04-145-10/+19
| | | | | | | | | | | | | | | Summary: On some android targets, a binary can produce additional garbage (e.g. warning messages from the dynamic linker) on the standard error, which confuses some tests. This relaxes the stderr expectations for targets known for their chattyness. Reviewers: tfiala, ovyalov Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D19114 llvm-svn: 266326
* Fix test cases for big-endian systemsUlrich Weigand2016-04-141-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A number of test cases were failing on big-endian systems simply due to byte order assumptions in the tests themselves, and no underlying bug in LLDB. These two test cases: tools/lldb-server/lldbgdbserverutils.py python_api/process/TestProcessAPI.py actually check for big-endian target byte order, but contain Python errors in the corresponding code paths. These test cases: functionalities/data-formatter/data-formatter-python-synth/TestDataFormatterPythonSynth.py functionalities/data-formatter/data-formatter-smart-array/TestDataFormatterSmartArray.py functionalities/data-formatter/synthcapping/TestSyntheticCapping.py lang/cpp/frame-var-anon-unions/TestFrameVariableAnonymousUnions.py python_api/sbdata/TestSBData.py (first change) could be fixed to check for big-endian target byte order and update the expected result strings accordingly. For the two synthetic tests, I've also updated the source to make sure the fake_a value is always nonzero on both big- and little-endian platforms. These test case: python_api/sbdata/TestSBData.py (second change) functionalities/memory/cache/TestMemoryCache.py simply accessed memory with the wrong size, which wasn't noticed on LE but fails on BE. Differential Revision: http://reviews.llvm.org/D18985 llvm-svn: 266315
* Support Linux on SystemZ as platformUlrich Weigand2016-04-141-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for Linux on SystemZ: - A new ArchSpec value of eCore_s390x_generic - A new directory Plugins/ABI/SysV-s390x providing an ABI implementation - Register context support - Native Linux support including watchpoint support - ELF core file support - Misc. support throughout the code base (e.g. breakpoint opcodes) - Test case updates to support the platform This should provide complete support for debugging the SystemZ platform. Not yet supported are optional features like transaction support (zEC12) or SIMD vector support (z13). There is no instruction emulation, since our ABI requires that all code provide correct DWARF CFI at all PC locations in .eh_frame to support unwinding (i.e. -fasynchronous-unwind-tables is on by default). The implementation follows existing platforms in a mostly straightforward manner. A couple of things that are different: - We do not use PTRACE_PEEKUSER / PTRACE_POKEUSER to access single registers, since some registers (access register) reside at offsets in the user area that are multiples of 4, but the PTRACE_PEEKUSER interface only allows accessing aligned 8-byte blocks in the user area. Instead, we use a s390 specific ptrace interface PTRACE_PEEKUSR_AREA / PTRACE_POKEUSR_AREA that allows accessing a whole block of the user area in one go, so in effect allowing to treat parts of the user area as register sets. - SystemZ hardware does not provide any means to implement read watchpoints, only write watchpoints. In fact, we can only support a *single* write watchpoint (but this can span a range of arbitrary size). In LLDB this means we support only a single watchpoint. I've set all test cases that require read watchpoints (or multiple watchpoints) to expected failure on the platform. [ Note that there were two test cases that install a read/write watchpoint even though they nowhere rely on the "read" property. I've changed those to simply use plain write watchpoints. ] Differential Revision: http://reviews.llvm.org/D18978 llvm-svn: 266308
* Bump up timeout in TestGdbRemoteProcessInfoPavel Labath2016-04-121-1/+1
| | | | | | | the process info packet is slow, and sometimes it does not arrive on time when run on the android emulator. llvm-svn: 266058
* [NFC] Cleanup the code used to run shell commands from testsTamas Berghammer2016-04-052-27/+9
| | | | | | | | | | | | Previously we had 3 different method to run shell commands on the target and 4 copy of code waiting until a given file appears on the target device (used for syncronization). This CL merges these methods to 1 run_platform_command and 1 wait_for_file_on_target functions located in some utility classes. Differential revision: http://reviews.llvm.org/D18789 llvm-svn: 265398
* Fix TestPlatformProcessConnect after rL265357Tamas Berghammer2016-04-051-1/+5
| | | | llvm-svn: 265392
* Don't vary debug info for lldb-server testsPavel Labath2016-03-311-0/+2
| | | | | | | | | | | | | | | | | | Summary: Debug info is used only by the client and lldb-server tests do not even have the client component running, as they communicate with the server directly. Therefore, running the tests for each debug info type is unnecessarry. This adds general ability to mark a test class as not dependent on debug info, and marks all lldb-server tests as such. Reviewers: tberghammer, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18598 llvm-svn: 265017
* Mark an LLGS test as flakyPavel Labath2016-03-161-0/+1
| | | | | cause: Async output arrival over pty llvm-svn: 263631
* [test] Persist packets between expect_gdbremote_sequence invocationsPavel Labath2016-03-163-30/+41
| | | | | | | | | | | | | | | | | | | | | | Summary: Some tests (Hc_then_Csignal_signals_correct_thread, at least) were sending a "continue" packet in one expect_gdbremote_sequence invocation, and "expecting" the stop-reply in another call. This posed a problem, because the were packets were not persisted between the two invocations, and if the stub was exceptionally fast to respond, the packet would be received in the first invocation (where it would be ignored) and then the second invocation would fail because it could not find the packet. Since doing matching in two invocations seems like a reasonable use of the packet pump, instead of fixing the test, I make sure the packet_pump supports this usage by making the list of captured packets persistent. Reviewers: tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18140 llvm-svn: 263629
* [test] Correctly retry connections on android targetsPavel Labath2016-03-141-5/+31
| | | | | | | | | | | | | | | | | Summary: Normally, when the remote stub is not ready, we will get ECONNREFUSED during the connect() attempt. However, due to the way how ADB forwarding works, on android targets the connect() will always be successful, but the connection will be immediately dropped if ADB could not connect on the remote side. This commit tries to detect this situation, and report it as "connection refused" so that the upper test layers attempt the connection again. Reviewers: tfiala, tberghammer Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D18146 llvm-svn: 263439
* Add a log statementPavel Labath2016-03-041-0/+1
| | | | llvm-svn: 262715
* Resumbit "Fetch remote log files from LLGS tests"Pavel Labath2016-03-041-5/+29
| | | | | | | | The problem with the original patch (and my first attempt to fix) was that the value debug monitor flags could persist from one test to another. Resetting the value in the setUp() function fixes the problem. llvm-svn: 262713
* Revert "Fetch remote log files from LLGS tests"Pavel Labath2016-03-031-29/+5
| | | | | | | Even after the last fixup, there still seems to be one failure left. Revert until I figure out what is going on. llvm-svn: 262622
* Fix OSX breakage caused by r262597Pavel Labath2016-03-031-0/+1
| | | | llvm-svn: 262602
* Fetch remote log files from LLGS testsPavel Labath2016-03-031-5/+28
| | | | | | | | | | | | | | | | | Summary: this enables download of remote log files for llgs and debugserver tests (previously we were just passing the host file name which obviously did not work). Note this also changes the debugserver logging to work only when logging has been requested on the command line, whereas previously it would log unconditionally. I can change it back if anyone is relying on this, but I thought I'd make this consistent. Reviewers: tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D17798 llvm-svn: 262597
* Slightly improve logging in LLGS testsPavel Labath2016-03-011-1/+1
| | | | | | we're sometimes getting an exception here, and I want to see why... llvm-svn: 262333
* Make TestPlatformProcessConnect to support abstract/domain sockets.Oleksiy Vyalov2016-02-261-4/+20
| | | | llvm-svn: 261974
* Remove expectedFailureFreeBSD decoratorEd Maste2016-02-191-1/+1
| | | | | | | | All invocations are updated to use the generic expectedFailureAll. Differential Revision: http://reviews.llvm.org/D17455 llvm-svn: 261355
* Mark TestLldbGdbServer.test_software_breakpoint_set_and_remove_work_llgs as ↵Pavel Labath2016-02-191-0/+1
| | | | | | | | flaky on linux The problem is the asynchronous arrival of inferior stdio (pr25652). llvm-svn: 261313
* Mark TestLldbGdbServer.test_written_M_content_reads_back_correctly as flaky ↵Pavel Labath2016-02-161-0/+1
| | | | | | | | on linux I believe the root cause is the asynchronous arrival of inferior stdio (pr25652). llvm-svn: 260950
* Remove expectedFailureLinux decorator.Zachary Turner2016-02-102-3/+3
| | | | llvm-svn: 260422
* Bump up the packet timeout for gdbremote testsPavel Labath2016-02-051-1/+1
| | | | | | | Log confirmed that the we are sometimes timing out on the receive, even though the server is sending the correct packets. llvm-svn: 259878
* Move the rest of the tests over to using the new decorator module.Zachary Turner2016-02-0416-11/+37
| | | | llvm-svn: 259838
OpenPOWER on IntegriCloud