summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* Clean up register naming conventions inside lldb. Jason Molenda2015-09-1525-2140/+1413
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "gcc" register numbers are now correctly referred to as "ehframe" register numbers. In almost all cases, ehframe and dwarf register numbers are identical (the one exception is i386 darwin where ehframe regnums were incorrect). The old "gdb" register numbers, which I incorrectly thought were stabs register numbers, are now referred to as "Process Plugin" register numbers. This is the register numbering scheme that the remote process controller stub (lldb-server, gdbserver, core file support, kdp server, remote jtag devices, etc) uses to refer to the registers. The process plugin register numbers may not be contiguous - there are remote jtag devices that have gaps in their register numbering schemes. I removed all of the enums for "gdb" register numbers that we had in lldb - these were meaningless - and I put LLDB_INVALID_REGNUM in all of the register tables for the Process Plugin regnum slot. This change is almost entirely mechnical; the one actual change in here is to ProcessGDBRemote.cpp's ParseRegisters() which parses the qXfer:features:read:target.xml response. As it parses register definitions from the xml, it will assign sequential numbers as the eRegisterKindLLDB numbers (the lldb register numberings must be sequential, without any gaps) and if the xml file specifies register numbers, those will be used as the eRegisterKindProcessPlugin register numbers (and those may have gaps). A J-Link jtag device's target.xml does contain a gap in register numbers, and it only specifies the register numbers for the registers after that gap. The device supports many different ARM boards and probably selects different part of its register file as appropriate. http://reviews.llvm.org/D12791 <rdar://problem/22623262> llvm-svn: 247741
* Use SI_KERNEL on platforms defining itStephane Sezer2015-09-141-2/+3
| | | | | | | | | | | | | | | | | Summary: Linux and FreeBSD occasionally send SI_KERNEL codes, nonexistent on other platforms. Problem caught on NetBSD. Reviewers: joerg, sas Subscribers: sas, lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D12659 Change by Kamil Rytarowski <n54@gmx.com> llvm-svn: 247579
* Move RegisterContextPOSIX.h to FreeBSD subdirEd Maste2015-09-142-1/+1
| | | | | | It is now used only by the FreeBSD in-process ptrace implementation. llvm-svn: 247561
* Limit scope of RegisterContextPOSIX.h headerEd Maste2015-09-1425-21/+23
| | | | | | | | | | | | | | | RegisterContextPOSIX.h is poorly named and contains only the declaration of POSIXBreakpointProtocol, which is used for in-process live kernel debugging. It is now relevant only to FreeBSD. In source/Plugins/Process/Utility/RegisterContext*.h (after assorted rework and refactoring) it only served the purpose of #including other necessary headers as a side-effect. Remove it from them and just include the required headers directly. Differential Revision: http://reviews.llvm.org/D12830 llvm-svn: 247558
* Switch default disposition of realtime signalsPavel Labath2015-09-143-130/+130
| | | | | | | | | | | | | | | | | | | | | Summary: Realtime signals generally do not represent an error condition in an application but are more like a regular means of IPC. As such, we shouldn't interrupt an application whenever it recieves one. If any application will use these signals, it will probably use them a lot, rendering it's debugging tiresome if we stopped at every signal. Furthermore, these signals are likely to be used in a low level library, and the programmer may not even be aware of their presence. For these reasons, I am switching the default disposition of realtime signals on all supported platforms (i.e. Linux and Freebsd) to no-stop, no-notify. Any user still wishing to receive these signals can always change the default to suit his needs. Reviewers: ovyalov, emaste Subscribers: lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D12795 llvm-svn: 247537
* Fix a small comment typo in Windows Process code.Stephane Sezer2015-09-091-3/+3
| | | | llvm-svn: 247206
* Change the looping stack detection codeTamas Berghammer2015-09-091-14/+16
| | | | | | | | | | | In some special case (e.g. signal handlers, hand written assembly) it is valid to have 2 stack frame with the same CFA value. This CL change the looping stack detection code to report a loop only if at least 3 consecutive frames have the same CFA. Differential revision: http://reviews.llvm.org/D12699 llvm-svn: 247133
* When lldb gets the register definitions from the response of aJason Molenda2015-09-091-4/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qXfer:features:read:target.xml packet, or via the plugin.process.gdb-remote.target-definition-file setting, if the register definition doesn't give us eh_frame or DWARF register numbers for that register, try to get that information from the ABI plugin. The DWARF/eh_frame register numbers are defined in the ABI standardization documents - so getting this from the ABI plugin is reasonable. There's little value in having the remote stub inform us of this generic information, as long as we can all agree on the names of the registers. There's some additional information we could get from the ABI. For instance, on ABIs where function arguments are passed in registers, lldb defines alternate names like "arg1", "arg2", "arg3" for these registers so they can be referred to that way by the user. We could get this from the ABI if the remote stub doesn't provide that. That may be something worth doing in the future - but for now, I'm keeping this a little more minimal. Thinking about this, what we want/need from the remote stub at a minimum are: 1. The names of the register 2. The number that the stub will use to refer to the register with the p/P packets and in the ? response packets (T/S) where expedited register values are provided 3. The size of the register in bytes (nice to have, to remove any doubt) 4. The offset of the register in the g/G packet if we're going to use that for reading/writing registers. debugserver traditionally provides a lot more information in addition to this via the qRegisterInfo packet, and debugserver augments its response to the qXfer:features:read:target.xml query to include this information. Including: DWARF regnum, eh_frame regnum, stabs regnum, encoding (ieee754, Uint, Vector, Sint), format (hex, unsigned, pointer, vectorof*, float), registers that should be marked as invalid if this register is modified, and registers that contain this register. We might want to get all of this from the ABI - I'm not convinced that it makes sense for the remote stub to provide any of these details, as long as the ABI and remote stub can agree on register names. Anyway, start with eh_frame and DWARF coming from the ABI if they're not provided by the remote stub. We can look at doing more in the future. <rdar://problem/22566585> llvm-svn: 247121
* A change I'm open to reverting if there is disagreement:Jason Molenda2015-09-091-1/+3
| | | | | | | | | | | | | | | | | | | When lldb receives a gdb-remote protocol packet that has nonprintable characters, it will print the packet in gdb-remote logging with binary-hex encoding so we don't dump random 8-bit characters into the packet log. I'm changing this check to allow whitespace characters (newlines, linefeeds, tabs) to be printed if those are the only non-printable characters in the packet. This is primarily to get the response to the qXfer:features:read:target.xml packet to show up in the packet logs in human readable form. Right now we just get a dozen kilobytes of hex-ascii and it's hard to figure out what register number scheme is being used. llvm-svn: 247120
* Fix the handling of FPR offsets in Linux arm/aarch64 register contextsTamas Berghammer2015-09-075-9/+32
| | | | | | Differential revision: http://reviews.llvm.org/D12636 llvm-svn: 246959
* Bug 24457 - X87 FPU Special Purpose RegistersAbhishek Aggarwal2015-09-072-4/+25
| | | | | | | | | | | | | | | | | | | | Summary: - For 'register read --all' command on x86_64-Linux Platform: -- Provide correct values of X87 FPU Special Purpose Registers -- Both 32-bit & 64-bit inferiors give correct values on this Platform - Added a Test Vector: -- To verify the expected behaviour of the command Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: ashok.thirumurthi, granata.enrico, tfiala, clayborg Differential Revision: http://reviews.llvm.org/D12592 llvm-svn: 246955
* Fix deadlock while attaching to inferiorsPavel Labath2015-09-032-148/+159
| | | | | | | | | | | | | | | | | | | | Summary: There was a race condition in the AsyncThread, where we would end up sending a vAttach notification to the thread before it got a chance set up its listener (this can be reproduced by adding a sleep() at the very beginning of ProcessGDBRemote::AsyncThread()). This event would then get lost and we LLDB would deadlock. I fix this by setting up the listener early on, in the ProcessGDBRemote constructor. This should improve the stability of all attach tests. For now, I am removing XTIMEOUT from TestAttachResume, and will watch the buildbots for signs of trouble. Reviewers: clayborg, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12552 llvm-svn: 246756
* [cmake] Remove LLVM_NO_RTTI.Bruce Mitchener2015-09-039-19/+1
| | | | | | | | | | | | | | Summary: This doesn't exist in other LLVM projects any longer and doesn't do anything. Reviewers: chaoren, labath Subscribers: emaste, tberghammer, lldb-commits, danalbert Differential Revision: http://reviews.llvm.org/D12586 llvm-svn: 246749
* Try to fix FreeBSD build.Zachary Turner2015-09-022-15/+15
| | | | llvm-svn: 246672
* Fix ProcessKDP.cpp for the change in r246578.Jim Ingham2015-09-012-16/+18
| | | | llvm-svn: 246601
* Make ProcessWindows not create a strong reference to itself.Zachary Turner2015-09-014-12/+55
| | | | llvm-svn: 246579
* Have the Process hold a weak_ptr to the Target.Zachary Turner2015-09-0110-92/+96
| | | | llvm-svn: 246578
* 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
OpenPOWER on IntegriCloud