summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement DoReadMemory for Windows mini dumps.Adrian McCarthy2015-09-012-5/+93
| | | | | | Differential Revision: http://reviews.llvm.org/D12507 llvm-svn: 246558
* Make ProcessGDBRemote get a //copy// of platform Unix signals.Chaoren Lin2015-09-013-2/+10
| | | | | | | | | | | | Summary: Update to http://reviews.llvm.org/rL243618. Reviewers: jaydeep, clayborg Subscribers: labath, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D12420 llvm-svn: 246557
* [NativeProcessLinux] Fix detach of multithreaded inferiorsPavel Labath2015-09-011-5/+11
| | | | | | | When detaching, we need to detach from all threads of the inferior and not just the main one. Without this, a multi-threaded inferior would usually crash once the server exits. llvm-svn: 246549
* [NativeProcessLinux] Fix assertion failure when killing a processPavel Labath2015-09-011-1/+10
| | | | | | | | | Linux sometimes sends us a PTRACE_EVENT_EXIT when an inferior process gets a SIGKILL. This can be confusing, since normally we don't expect any events when the inferior is stopped. This commit adds code to handle this situation (resume the thread and let it exit normally) and avoid an assertion failure in ResumeThread(). llvm-svn: 246539
* A few small comment fixups with terminology "gcc" -> "eh_frame", "gdb" -> ↵Jason Molenda2015-09-011-6/+6
| | | | | | | | "stabs". Just noticed these while reading through some code. llvm-svn: 246530
* Differential Review: http://reviews.llvm.org/D12363Adrian McCarthy2015-08-282-2/+60
| | | | llvm-svn: 246302
* Avoid usage of F_DUPFD_CLOEXEC where not available (e.g. kfreebsd*)Sylvestre Ledru2015-08-281-0/+14
| | | | | | | | | | | | | | | | | Summary: kfreebsd doesn't have F_DUPFD_CLOEXEC, so use it conditionally. Author: Emilio Pozuelo Monfort <pochu@debian.org> Author: Petr Salinger <Petr.Salinger@seznam.cz> Author: Gianfranco Costamagna Reviewers: emaste Subscribers: emaste Differential Revision: http://reviews.llvm.org/D12429 llvm-svn: 246294
* [LLDB][MIPS] Aligning code with rL245831Mohit K. Bhakkad2015-08-281-1/+1
| | | | | | | | Reviewers: jaydeep Subscribers: lldb-commits. Differential Revision: http://reviews.llvm.org/D12427 llvm-svn: 246293
* Error checking correction in AArch64 hardware watchpoint codeOmair Javaid2015-08-261-13/+68
| | | | | | Differential Revision: http://reviews.llvm.org/D12328 llvm-svn: 246045
* In SendContinuePacketAndWaitForResponse there is a special bit ofJason Molenda2015-08-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | code that looks for a second stop-reply packet in response to an interrupt (control-c). This is to handle the case where where a stop packet is making its way up to lldb right as lldb decides to interrupt the inferior. If the inferior is running and we interrupt it, we'd expect a T11 type response meaning that the inferior halted because of the interrupt. But if the interrupt gets a T05 type response instead, meaning that we stopped execution by hitting a breakpoint or whatever, then the interrupt was received while the inferior was already paused and so it is treated as a "?" packet -- the remote stub will send the stop message a second time. There's a timeout where we wait to get this second stop reply packet in SendContinuePacketAndWaitForResponse, currently 1ms. For a slow remote target, it may take longer than that to send the second stop reply packet. If that happens, then lldb will use that second stop reply packet as the response for the next packet request it makes to the remote stub. The two will be out of sync by one packet for the rest of the debug session and it's going to go badly from then on. I've seen times as slow as 46ms, and given the severity of missing that second stop reply packet, I'm increasing the timeout to 100ms, or 0.1sec. <rdar://problem/21990791> llvm-svn: 246004
* Adds support for hardware watchpoints on Arm targets.Omair Javaid2015-08-253-0/+548
| | | | | | | | | | | | | | http://reviews.llvm.org/D9703 This updated patches correct problems in arm hardware watchpoint support patch posted earlier. This patch has been tested on samsung chromebook (ARM - Linux) and PandaBoard using basic watchpoint test application. Also it was tested on Nexus 7 Android device. On chromebook linux we are able to set and clear all types of watchpoints but on android we end up getting a watchpoint packet error because we are not able to call hardware watchpoint ptrace functions successfully. llvm-svn: 245961
* Handle DW_OP_GNU_addr_index in DWARF expressionsTamas Berghammer2015-08-251-2/+10
| | | | | | Differential revision: http://reviews.llvm.org/D12290 llvm-svn: 245932
* Fix build on mipsSagar Thakur2015-08-251-10/+3
| | | | | | | | | | Setting and getting register values as bytes instead of depending on the 128 bit integer support in register value. This patch will fix the build failure in the release branch. Reviewers: tberghammer, clayborg, hans Subscribers: bhushan, nitesh.jain, jaydeep, lldb-commits Differential: http://reviews.llvm.org/D12275 llvm-svn: 245927
* Reorg code to allow Windows Process Plugins to share some common code.Adrian McCarthy2015-08-2428-1406/+1406
| | | | | | Differential Revision: http://reviews.llvm.org/D12252 llvm-svn: 245850
* Simplify NativeThreadLinux includesPavel Labath2015-08-241-4/+1
| | | | | | | there is no need to include architecture-specific register contexts when the generic one will suffice. llvm-svn: 245839
* [NativeProcessLinux] Pass around threads by referencePavel Labath2015-08-242-249/+185
| | | | | | | | | | | | | | | | Summary: Most NPL private functions took (shared) pointers to threads as arguments. This meant that the callee could not be sure if the pointer was valid and so most functions were peppered with null-checks. Now, I move the check closer to the source, and pass around the threads as references (which are then assumed to be valid). Reviewers: tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12237 llvm-svn: 245831
* Implement handling of `library:` keys in thread stop replies.Stephane Sezer2015-08-211-0/+4
| | | | | | | | | | | | | | | | | | | | Summary: When a windows remote stops because of a DLL load/unload, the debug server sends a stop reply packet that contains a `library` key with any value (usually just `library:1`). This indicates to the debugger that a library has been loaded or unloaded and that the list of libraries should be refreshed (usually with `qXfer:libraries:read`). This change just triggers a call to `LoadModules()` which in turns will send a remote library read command when a stop reply that requests it is received. Reviewers: clayborg, zturner, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12218 llvm-svn: 245708
* [NativeProcessLinux] Reduce the number of castsPavel Labath2015-08-212-68/+61
| | | | | | | | | | | | | | | Summary: NPL used to be peppered with casts of the NativeThreadProtocol objects into NativeThreadLinux. I move these closer to the source where we obtain these objects. This way, the rest of the code can assume we are working with the correct type of objects. Reviewers: ovyalov, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12187 llvm-svn: 245681
* The llvm Triple for an armv6m now comes back as llvm::Triple::thumb.Jason Molenda2015-08-213-4/+10
| | | | | | | | | | | | | | This was breaking disassembly for arm machines that we force to be thumb mode all the time because we were only checking for llvm::Triple::arm. i.e. armv6m (ARM Cortex-M0) armv7m (ARM Cortex-M3) armv7em (ARM Cortex-M4) <rdar://problem/22334522> llvm-svn: 245645
* [ProcessWindows] Fix rare crash on shutdown.Zachary Turner2015-08-201-0/+3
| | | | | | | | There might be an underlying race condition here that should be figured out, but this at least prevents the crash for the time being and doesn't appear to have any adverse effects. llvm-svn: 245626
* Understand absolute base addresses in ProcessGDBRemote::GetLoadedModuleList.Stephane Sezer2015-08-202-8/+28
| | | | | | | | | | | | | | | | Summary: This is useful when dealing with Windows remote that use only the qXfer:libraries command which returns absolute base addresses, as opposed to qXfer:libraries-svr4 which returns relative offsets for module bases. Reviewers: clayborg, zturner, ADodds Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12204 llvm-svn: 245625
* Fix some format strings in ProcessGDBRemote.cpp.Stephane Sezer2015-08-201-2/+2
| | | | | | | | | | | | Summary: Size specifier should come after `%` not before. Reviewers: clayborg, ADodds Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12203 llvm-svn: 245608
* [NativeProcessLinux] Fix a bug in instruction-stepping over thread creationPavel Labath2015-08-204-257/+107
| | | | | | | | | | | | | | | | | | | | | | | Summary: There was a bug in NativeProcessLinux, where doing an instruction-level single-step over the thread-creation syscall resulted in loss of control over the inferior. This happened because after the inferior entered the thread-creation maintenance stop, we unconditionally performed a PTRACE_CONT, even though the original intention was to do a PTRACE_SINGLESTEP. This is fixed by storing the original state of the thread before the stop (stepping or running) and then performing the appropriate action when resuming. I also get rid of the callback in the ThreadContext structure, which stored the lambda used to resume the thread, but which was not used consistently. A test verifying the correctness of the new behavior is included. Reviewers: ovyalov, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12104 llvm-svn: 245545
* If the filename specified by plugin.process.gdb-remote.target-definition-file,Jason Molenda2015-08-201-0/+5
| | | | | | doesn't exist, see if it needs tilde expansion before we ignore it completely. llvm-svn: 245537
* When the target definition is unparseable, print an error messageJason Molenda2015-08-201-0/+7
| | | | | | | | | to the user. e.g. specified via the plugin.process.gdb-remote.target-definition-file setting. Currently we silently ignore the target definition if there is a parse error. llvm-svn: 245536
* Read exception records from Windows mini dumpAdrian McCarthy2015-08-193-25/+86
| | | | | | Differential Revision: http://reviews.llvm.org/D12126 llvm-svn: 245495
* On Linux, clear the signal mask of the launched inferiorPavel Labath2015-08-191-1/+11
| | | | | | | | | | | | | | | | | | | Summary: Due to fork()/execve(), the launched inferior inherits the signal mask of its parent (lldb-server). But because lldb-server modifies its signal mask (It blocks SIGCHLD, for example), the inferior starts with some signals being initially blocked. One consequence is that TestCallThatRestarts.ExprCommandThatRestartsTestCase (test/expression_command/call-restarts) fails because sigchld_handler() in lotta-signals.c is not called, due to the SIGCHLD signal being blocked. To prevent the signal masking done by lldb-server from affecting the created inferior, the signal mask of the inferior is now cleared before the execve(). Patch by: Yacine Belkadi Reviewers: ovyalov, labath Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12138 llvm-svn: 245436
* Fix lldb-server arm-linux-g++ buildOmair Javaid2015-08-191-1/+1
| | | | llvm-svn: 245428
* Fix AArch64 watchpoint exception handlingOmair Javaid2015-08-181-1/+3
| | | | | | http://reviews.llvm.org/D11987 llvm-svn: 245273
* [LLGS] Avoid misrepresenting log lines as inferior outputPavel Labath2015-08-181-1/+4
| | | | | | | | | | | | | | | | Summary: in case we are logging to stdout, any log lines from the forked child can be misconstrued to be inferior output. To avoid this, we disable all logging immediately after forking. I also fix the implementatoion of DisableAllLogChannels, which was a no-op before this commit. Reviewers: clayborg, ovyalov Subscribers: dean, lldb-commits Differential Revision: http://reviews.llvm.org/D12083 llvm-svn: 245272
* Remove unintentional ;'s.Jason Molenda2015-08-181-2/+2
| | | | llvm-svn: 245261
* [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 ↵Sagar Thakur2015-08-1714-279/+1106
| | | | | | | | | | | | | | | | mode support This patch : - Fixes offsets of all register sets for Mips. - Adds MSA register set and FRE=1 mode support for FP register set. - Separates lldb register numbers and register infos of freebsd/mips64 from linux/mips64. - Re-orders the register numbers of all kinds for mips to be consistent with freebsd order of register numbers. Reviewers: jaydeep, clayborg, jasonmolenda, ovyalov, emaste Subscribers: tberghammer, ovyalov, emaste, mohit.bhakkad, nitesh.jain, bhushan Differential: http://reviews.llvm.org/D10919 llvm-svn: 245217
* Update DynamicRegisterInfo::SetRegisterInfo to accept eh_frame registerJason Molenda2015-08-151-1/+7
| | | | | | | | numbers in the key name "ehframe" or "eh_frame" in addition to the deprecated "gcc" name (e.g. from a plugin.process.gdb-remote.target-definition-file python file). llvm-svn: 245151
* A messy bit of cleanup: Move towards more descriptive namesJason Molenda2015-08-1522-52/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | for eh_frame and stabs register numberings. This is not complete but it's a step in the right direction. It's almost entirely mechanical. lldb informally uses "gcc register numbering" to mean eh_frame. Why? Probably because there's a notorious bug with gcc on i386 darwin where the register numbers in eh_frame were incorrect. In all other cases, eh_frame register numbering is identical to dwarf. lldb informally uses "gdb register numbering" to mean stabs. There are no official definitions of stabs register numbers for different architectures, so the implementations of gdb and gcc are the de facto reference source. There were some incorrect uses of these register number types in lldb already. I fixed the ones that I saw as I made this change. This commit changes all references to "gcc" and "gdb" register numbers in lldb to "eh_frame" and "stabs" to make it clear what is actually being represented. lldb cannot parse the stabs debug format, and given that no one is using stabs any more, it is unlikely that it ever will. A more comprehensive cleanup would remove the stabs register numbers altogether - it's unnecessary cruft / complication to all of our register structures. In ProcessGDBRemote, when we get register definitions from the gdb-remote stub, we expect to see "gcc:" (qRegisterInfo) or "gcc_regnum" (qXfer:features:read: packet to get xml payload). This patch changes ProcessGDBRemote to also accept "ehframe:" and "ehframe_regnum" from these remotes. I did not change GDBRemoteCommunicationServerLLGS or debugserver to send these new packets. I don't know what kind of interoperability constraints we might be working under. At some point in the future we should transition to using the more descriptive names. Throughout lldb we're still using enum names like "gcc_r0" and "gdb_r0", for eh_frame and stabs register numberings. These should be cleaned up eventually too. The sources link cleanly on macosx native with xcode build. I don't think we'll see problems on other platforms but please let me know if I broke anyone. llvm-svn: 245141
* Removing redundant check from r244875Ravitheja Addepally2015-08-131-12/+6
| | | | llvm-svn: 244886
* Add missing include to RegisterInfoInterface.hTamas Berghammer2015-08-131-0/+2
| | | | llvm-svn: 244881
* Fix Linux build after r244875Tamas Berghammer2015-08-131-10/+2
| | | | llvm-svn: 244877
* Set orig_eax to -1 for Linux x86 platformsRavitheja Addepally2015-08-136-2/+79
| | | | | | | | | | | | | | | | | Summary: For Linux x86 based environments the orig_eax/orig_rax register should be set to -1 to prevent the instruction pointer to be decremented, which was the cause for the SIGILL exception. Fix for Bug 23659 Reviewers: zturner, ashok.thirumurthi, mikesart, jingham, clayborg Subscribers: clayborg, labath Differential Revision: http://reviews.llvm.org/D11411 llvm-svn: 244875
* [LLDB][MIPS] Use qfThreadID if qC packet is not supported by targetJaydeep Patil2015-08-131-0/+15
| | | | | | | | | | | SUMMARY: The patch uses qfThreadID to get the thread IDs if qC packet is not supported by target. Reviewers: jingham, clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D11519 llvm-svn: 244866
* [LLDB][MIPS] Support standard GDB remote stop reply packet for watchpointJaydeep Patil2015-08-133-7/+41
| | | | | | | | | | | | SUMMARY: The patch supports TAAwatch:addr packet. The patch also sets m_watchpoints_trigger_after_instruction to eLazyBoolNo when qHostInfo or qWatchpointSupportInfo is not supported by the target. Reviewers: jingham, clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D11747 llvm-svn: 244865
* [LLDB][MIPS] Handle false positives for MIPS hardware watchpointsJaydeep Patil2015-08-134-2/+118
| | | | | | | | | | | | | | | | SUMMARY: Last 3bits of the watchpoint address are masked by the kernel. For example, n is at 0x120010d00 and m is 0x120010d04. When a watchpoint is set at m, then watch exception is generated even when n is read/written. To handle this case, instruction at PC is emulated to find the base address of the load/store instruction. This address is then appended to the description of the stop-info packet. Client then reads this information to check whether the user has set a watchpoint on this address. Reviewers: jingham, clayborg Subscribers: nitesh.jain, mohit.bhakkad, sagar, bhushan and lldb-commits Differential Revision: http://reviews.llvm.org/D11672 llvm-svn: 244864
* Fix AArch64 watchpoint handlers in NativeRegisterContextLinux_arm64Omair Javaid2015-08-122-60/+81
| | | | | | http://reviews.llvm.org/D11899 llvm-svn: 244750
* Fix read only watchpoints on x86_64Tamas Berghammer2015-08-121-1/+3
| | | | | | | | | | On x86/x86_64 read only watchpoints aren't supported. Fall back to read/write watchpoints in that case. Note: Logic should be added to ignore the watchpoint hit when occurred because of a write. llvm-svn: 244742
* Fix LLGS to enable read type watchpointsOmair Javaid2015-08-122-5/+7
| | | | | | http://reviews.llvm.org/D11902 llvm-svn: 244741
* ClangASTType is now CompilerType.Greg Clayton2015-08-111-3/+3
| | | | | | This is more preparation for multiple different kinds of types from different compilers (clang, Pascal, Go, RenderScript, Swift, etc). llvm-svn: 244689
* Fix a infinite loop when killing a process that is in the middle of loading ↵Greg Clayton2015-08-111-79/+76
| | | | | | | | | | shared libraries. The issue was we were sending a "qSymbol::" packet and it we were already disconnected were weren't exiting the while loop if we didn't successfully send the qSymbol packet. <rdar://problem/22098746> llvm-svn: 244683
* Revert r244308 since it's introducing test regressions on Linux:Oleksiy Vyalov2015-08-1014-1109/+281
| | | | | | | | - TestLldbGdbServer.py both clang & gcc, i386 and x86_64 - TestConstVariables.py gcc, i386 and x86_64 - 112 failures clang, i386 llvm-svn: 244514
* Fix for build errors on arm-linux-gnueabi-gccOmair Javaid2015-08-092-2/+2
| | | | | | http://reviews.llvm.org/D11256 llvm-svn: 244419
* [LLDB][MIPS] Fix offsets of all register sets and add MSA regset and FRE=1 ↵Sagar Thakur2015-08-0714-281/+1109
| | | | | | | | | | | | | | | | | | mode support This change : - Fixes offsets of all register sets for Mips. - Adds MSA register set and FRE=1 mode support for FP register set. - Separates lldb register numbers and register infos of freebsd/mips64 from linux/mips64. - Re-orders the register numbers of all kinds for mips to be consistent with freebsd order of register numbers. - Eliminates ENABLE_128_BIT_SUPPORT and union ValueData from Scalar.cpp and uses llvm::APInt and llvm::APFloat for all integer and floating point types. Reviewers : emaste, jaydeep, clayborg Subscribers : emaste, mohit.bhakkad, nitesh.jain, bhushan Differential : http://reviews.llvm.org/D10919 llvm-svn: 244308
* Fix cmake build on non-Windows platforms.Bruce Mitchener2015-08-041-1/+1
| | | | | | | r243914 introduced a change which mistakenly tried to build the Windows minidump code on all platforms rather than only on Windows. llvm-svn: 243941
OpenPOWER on IntegriCloud