summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* Remove trap code from disassembly.Chaoren Lin2015-04-293-37/+45
| | | | | | | | | | | | | | | | | | | | Summary: NativeProcessProtocol uses ReadMemory internally for setting/checking breakpoints but also for generic memory reads (Handle_m), this change adds a ReadMemoryWithoutTrap for that purpose. Also fixes a bunch of misuses of addr_t as size/length. Test Plan: `disassemble` no longer shows the trap code. Reviewers: jingham, vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9330 llvm-svn: 236132
* This patch adds support aarch64-linux-gnu (SysV) abi in lldb.Omair Javaid2015-04-291-0/+4
| | | | | | | | | This code is also an import from MacOSx implementation as SysV abi is similar to what has been implemented for MacOS but may require a few tweaks. http://reviews.llvm.org/D8538 llvm-svn: 236098
* Fix bug in gdb-remote xml parser which failed to parse xml split over ↵Aidan Dodds2015-04-291-1/+2
| | | | | | multiple rsp packets. llvm-svn: 236095
* [NativeProcessLinux] Add back synchronisation of thread create eventsPavel Labath2015-04-282-15/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Without the synchronisation between the two thread creation events the following case could happen: - threads A and B are running. A hits a breakpoint. We note that we want to stop B. - before we could stop it, B creates a new thread C, we get the stop notification for B, but we don't record C's existence yet. - we resume B - before we get the C notification, B stops again (e.g. hits a breakpoint, gets our SIGSTOP, etc.) - we see all known threads have stopped, and we notify LLDB - C notification comes, we note it's existence and resume it => we have an inconsistent state (LLDB thinks we've stopped, but C is running) I resolve this by doing a blocking wait for for the C notification when we get the creation notification on the parent (B) thread. This way the two events are synchronised, but we don't need to introduce the intermediate "launching" state which would complicate handling of thread states as all code would need to be aware of the third possible state. Test Plan: This is an obscure corner case, which I had not observed in practise, so I have no test for it. I have tested that this commit does not regress in existing tests though. Reviewers: chaoren, vharron Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9217 llvm-svn: 235969
* Add an unnamed pipe fail-safe to launching lldb-gdbserver.Chaoren Lin2015-04-271-38/+67
| | | | | | | | | | | | | | | | | | Summary: Currently, launching lldb-gdbserver from platform on Android requires root for mkfifo() and an explicit TMPDIR variable. This should remove both requirements. Test Plan: Successfully launched lldb-gdbserver on a non-rooted Android device. Reviewers: tberghammer, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9307 llvm-svn: 235940
* [Windows] Add a RegisterContextWindows_x64.Zachary Turner2015-04-278-161/+605
| | | | | | | With this patch, LLDB can debug x64 executables on Windows with the same level of functionality as for x86 executables. llvm-svn: 235935
* Fix register read callback in linux-arm single steppingPavel Labath2015-04-271-21/+33
| | | | | | | | | | | | | | | | | | | | | The previous read callback always read the value of the register what caused problems when the emulator wrote some value into a register and then expected to read the same value back. This CL add a register value cache into the callbacks to return the correct value after a register write also. Test Plan: Stepping over BL/BLX instruction works on android-arm if the instruction set isn't change (other, unrelated patch will come for the case when we move to an other instruction set) Reviewers: omjavaid, sas, clayborg Reviewed By: clayborg Subscribers: labath, tberghammer, rengolin, aemerson, lldb-commits Differential Revision: http://reviews.llvm.org/D9187 From: Tamas Berghammer <tberghammer@google.com> llvm-svn: 235852
* Fix TestFdLeak on Linux.Chaoren Lin2015-04-231-0/+6
| | | | | | | | | | | | | | | | Summary: LLGS leaks pipes (when launched by lldb), sockets (when launched by platform), and/or log file to the inferior. This should prevent all possible leaks. Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9211 llvm-svn: 235615
* [NativeProcessLinux] Fix race condition during inferior thread creationPavel Labath2015-04-234-134/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The following situation occured if we were stopping a process (due to breakpoint, watchpoint, ... hit) while a new thread was being created. - process has two threads: A and B. - thread A hits a breakpoint: we send a STOP signal to thread B and register a callback with ThreadStateCoordinator to send a stop notification after the thread stops. - thread B stops, but not due to the SIGSTOP, but on a thread creation event (of a new thread C). We are unaware of our desire to stop, so we queue ThreadStopped and RequestResume operations with TSC, so the thread can continue running. - TSC receives the ThreadStopped event, sees that all threads are stopped and fires the delayed stop notification. - immediately after that TSC gets the RequestResume operation, so it resumes the thread. At this point the state is inconsistent because LLDB thinks the process is stopped and will start issuing commands to it, but one of the threads is in fact running. Things eventually break. I address this problem by omitting the two TSC events altogether and Resuming the thread B directly. This way the short stop is invisible to the TSC and the delayed notification will not fire. We will fire the notification when we actually process the SIGSTOP on thread B. When we get the initial SIGSTOP for thread C, we also resume the thread and send a ThreadWasCreated message (is_stopped = false) to the TSC. This way, the TSC can stop the thread on its own and handle the stop event later. This way the state of the new thread is correctly handled as well (thanks Chaoren for the idea). This patch also removes the synchronisation between the thread creation notifications on threads B and C. The need for this synchronisation is unclear (the comments seem to hint that the new thread is "fully created" only after we process both events, but I have noticed no regressions in treating it as "created" even after just processing the initial C event), but it is a source for many kinds of obscure races, since it introduces a new thread state "Launching" and the rest of the code does not handle this state at all (what happens if we get a resume request from LLDB while this thread is launching? what happens if we get a stop request? etc.). This fixes the "spurious $O packet" problem in TestPrintStackTraces.py. However, the test remains disabled on i386 due to the VDSO issue. Test Plan: TestPrintStackTraces works on x86_64. No regressions in the rest of the test suite. Reviewers: vharron, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9145 llvm-svn: 235579
* [LLDB][MIPS] Add MIPS32 and MIPS64 core revisionsMohit K. Bhakkad2015-04-231-0/+6
| | | | | | | | | | | | | | | Patch by Jaydeep Patil Added MIPS32 and MIPS64 core revisions. This would be followed by register context and emulate-instruction for MIPS32. DYLDRendezvous.cpp: On Linux link map struct does not contain extra load offset field. Reviewers: clayborg Subscribers: bhushan, mohit.bhakkad, sagar, lldb-commits. Differential Revision: http://reviews.llvm.org/D9190 llvm-svn: 235574
* Fix signle stepping on arm when multiple thread is involvedTamas Berghammer2015-04-222-168/+205
| | | | | | | | | | | | On linux-arm we use software single stepping where setting the new breakpoint is only possible while the process is in stopped state. This CL moves the setup code for single stepping form the SigneStep operation into the Resum method to avoid an error when the process already started when we want to step one of the thread. Differential revision: http://reviews.llvm.org/D9108 llvm-svn: 235494
* Same issue as in D8685 but for i386.Chaoren Lin2015-04-214-7/+19
| | | | llvm-svn: 235454
* FreeBSD/arm core file supportEd Maste2015-04-204-0/+168
| | | | | | | Patch by Andrew Turner, with minor edits. XCode changes are mine; please update if necessary. llvm-svn: 235305
* NativeProcessLinux: Merge operation and monitor threadsPavel Labath2015-04-202-412/+219
| | | | | | | | | | | | | | | | | Summary: This commit moves the functionality of the operation thread into the new monitor thread. This is required to avoid a kernel race between the two threads and I believe it actually makes the code cleaner. Test Plan: Ran the test suite a couple of times, no regressions. Reviewers: ovyalov, tberghammer, vharron Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D9080 llvm-svn: 235304
* Auto advance pc for signle stepping on arm when emulation failesTamas Berghammer2015-04-201-17/+37
| | | | | | | | | | | The arm instruction emulation handles only some of the opcode (including all of them modifying the PC). For the rest of the instructions we can advance the PC by the size of the instruction as they don't modify the PC on any other way. Differential revision: http://reviews.llvm.org/D9076 llvm-svn: 235292
* Fix LLDB ARM GCC4.7 broken buildOmair Javaid2015-04-191-1/+1
| | | | llvm-svn: 235280
* Correct machine type for 32-bit armEd Maste2015-04-191-1/+1
| | | | | | Reported by Andrew Turner. llvm-svn: 235275
* Whitespace-only tweaks to Colin's r235109 patch to match the lldbJason Molenda2015-04-171-128/+175
| | | | | | coding style a little more closely. llvm-svn: 235218
* Use non-blocking waitpid in NativeProcessLinuxPavel Labath2015-04-172-75/+296
| | | | | | | | | | | | | | | | | | Summary: This is the first phase of the merging of Monitor and Operation threads in NativeProcessLinux (which is necessary since the two threads race inside Linux kernel). Here, I reimplement the Monitor thread do use non-blocking waitpid calls, which enables later addition of code from the operation thread. Test Plan: Ran the test suite a couple of times, no regressions detected. Reviewers: vharron, ovyalov, tberghammer Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9048 llvm-svn: 235193
* Fix cmake build on osx after r235109Colin Riley2015-04-171-0/+4
| | | | llvm-svn: 235179
* Add a "force_kill" arg to Process::Destroy(). This is needed afterJason Molenda2015-04-171-1/+1
| | | | | | | | | | | | | | | | | | the changes in r233255/r233258. Normally if lldb attaches to a running process, when we call Process::Destroy, we want to detach from the process. If lldb launched the process itself, ::Destroy should kill it. However, if we attach to a process and the driver calls SBProcess::Kill() (which calls Destroy), we need to kill it even if we didn't launch it originally. The force_kill param allows for the SBProcess::Kill method to force the behavior of Destroy. <rdar://problem/20424439> llvm-svn: 235158
* Define LIBXML2_DEFINED in the Xcode project for Xcode builds so Darwin ↵Greg Clayton2015-04-161-1/+1
| | | | | | | | | | builds can take advantage of the new GDB register info from the target XML. Also add "#if defined( LIBXML2_DEFINED )" around code that already used libxml2 in SymbolVendorMacOSX.cpp. Cleaned up some warnings in ProcessGDBRemote.cpp. llvm-svn: 235144
* Fix warnings about construction ordering.Greg Clayton2015-04-161-1/+1
| | | | llvm-svn: 235143
* Surround assignments w/ parenthesis to avoid mistakes.Davide Italiano2015-04-161-5/+5
| | | | | | This also silences a warning. llvm-svn: 235131
* Use the correct type, and silence a warning.Davide Italiano2015-04-161-1/+1
| | | | llvm-svn: 235126
* Adds lldb support for querying the register mapping from gdbserver remote ↵Colin Riley2015-04-164-1/+577
| | | | | | | | targets using qXfer:features:read packet. Only enabled if libxml2 enabled in build. Differential Revision: http://reviews.llvm.org/D8999 llvm-svn: 235109
* Fix printing of the failure address in NativeThreadLinuxTamas Berghammer2015-04-161-1/+1
| | | | llvm-svn: 235097
* Pass normalized target file paths via GDB-remote to a target and denormalize ↵Oleksiy Vyalov2015-04-162-4/+6
| | | | | | | | them on the target. http://reviews.llvm.org/D8980 llvm-svn: 235077
* Fixed remote failures in TestCPP11EnumTypes, probably othersVince Harron2015-04-151-0/+5
| | | | | | | | | | | | | | | Typically, LLGS only sends stdout/stderr notifications when the inferior process is running. Because LLGS reads stdout from the process in a separate thread, sometimes these stdout notifications can be received after the server has sent a thread stop message. The host isn't expecting stdout to be generated by the target after a stop message and these messages interfere with the host's request/ response paradigm. Differential Revision: http://reviews.llvm.org/D9024 llvm-svn: 234995
* Add single stepping logic for linux armTamas Berghammer2015-04-152-0/+165
| | | | | | | | | | | Linux arm don't support hardware stepping (neither mismatch breakpoints). This patch implement signle stepping with doing a software emulation of the next instruction and then setting a temporary breakpoint at the address where the thread will stop next. Differential revision: http://reviews.llvm.org/D8976 llvm-svn: 234987
* Fix breakpoint trap opcode detection for arm linuxTamas Berghammer2015-04-152-6/+32
| | | | llvm-svn: 234986
* Fix printf warnings about a size mismatch on MacOSX.Greg Clayton2015-04-141-3/+3
| | | | llvm-svn: 234941
* Adds Register Context Linux/POSIX for ARM Architecture Omair Javaid2015-04-1420-0/+2302
| | | | | | | | This patch is major step towards supporting lldb on ARM. This adds all the required bits to support register manipulation on Linux Arm. Also adds utility enumerations, definitions and register context classes for arm. llvm-svn: 234870
* Add logging plugin for WindowsAdrian McCarthy2015-04-103-0/+278
| | | | llvm-svn: 234607
* [LLDB][MIPS] Add LinuxSignals for mips64 and change trap opcode for mips64el.Mohit K. Bhakkad2015-04-095-2/+111
| | | | | | | | | | | | | | | Patch by Sagar Thakur - Added LinuxSignals for MIPS64. - Changed software trap opcode for mips64el. Reviewers: clayborg, tberghammer. Subscribers: emaste, jaydeep, bhushan, mohit.bhakkad, llvm-commits. Differential Revision: http://reviews.llvm.org/D8856 llvm-svn: 234469
* Remove redundant virtual for member functions marked 'override'.David Blaikie2015-04-083-38/+25
| | | | llvm-svn: 234422
* Fix compilation failure caused by r234366.Chaoren Lin2015-04-071-1/+1
| | | | llvm-svn: 234373
* Make sure the OperatingSystem plug-ins will work on linux as well. This goes ↵Greg Clayton2015-04-071-1/+4
| | | | | | with my previous fix with revision 234364. llvm-svn: 234366
* Fix stepping a virtual thread when the python operating system was enabled.Greg Clayton2015-04-072-3/+6
| | | | | | | | | | | | The OperatingSystem plug-ins allow code to detect threads in memory and then say "memory thread 0x11111" is backed by the actual thread 1. You can then single step these virtual threads. A problem arose when thread specific breakpoints were used during thread plans where we would say "set a breakpoint on thread 0x11111" and we would hit the breakpoint on the real thread 1 and the thread IDs wouldn't match and we would get rid of the "stopped at breakpoint" stop info due to this mismatch. Code was added to ensure these events get forwarded and thus allow single stepping a memory thread to work correctly. Added a test case for this as well. <rdar://problem/19211770> llvm-svn: 234364
* Fix printing of function names during unwind logging.Zachary Turner2015-04-061-6/+15
| | | | llvm-svn: 234172
* Fix FreeBSD crash after r233837Ed Maste2015-04-033-4/+8
| | | | | | | | | | | | The FreeBSD debug register access is a little usual, but in any case different from Linux. As it stands it's not possible to share an implementation of DR_OFFSET, so revert that part of r233837 and provide a separate FreeBSD and Linux implementation. We'll still want a better fix, but this should restore basic functionality (and the buildbot). llvm-svn: 234048
* Add missing semicolon in the windows plugin.Benjamin Kramer2015-04-031-1/+1
| | | | llvm-svn: 234007
* Sprinkle some #include <mutex> in files that use std::call_once.Benjamin Kramer2015-04-037-0/+12
| | | | llvm-svn: 234005
* Fix typo, fix build.Bruce Mitchener2015-04-031-1/+1
| | | | | | This typo was introduced as part of http://reviews.llvm.org/D8760 llvm-svn: 234003
* [Plugin/Process] Use std::call_once() to initialize.Davide Italiano2015-04-037-37/+28
| | | | | | | | This replaces the home-grown initialization mechanism used before. Differential Revision: http://reviews.llvm.org/D8760 llvm-svn: 233999
* Fix warnings generated by clang-cl.Zachary Turner2015-04-025-9/+5
| | | | | | | | | | | | | | There were a couple of real bugs here regarding error checking and signed/unsigned comparisons, but mostly these were just noise. There was one class of bugs fixed here which is particularly annoying, dealing with MSVC's non-standard behavior regarding the underlying type of enums. See the comment in lldb-enumerations.h for details. In short, from now on please use FLAGS_ENUM and FLAGS_ANONYMOUS_ENUM when defining enums which contain values larger than can fit into a signed integer. llvm-svn: 233943
* Fix issue where GPR and FPR registers have overlapping byte offsets.Chaoren Lin2015-04-013-22/+34
| | | | | | | | | | | | | | | | | | | | Summary: The implementation of GDBRemoteRegisterContext relies on byte offsets to cache register values. GPR, FPR, etc. should start on different offsets. This is correctly done in debugserver (in DNBArchImplX86_64.cpp), but not on Linux or FreeBSD (in RegisterInfos_x86_64.h). Test Plan: `register read st0` no longer overwrites `rbp` on Linux with LLGS. Reviewers: sivachandra, jingham, emaste, ovyalov, clayborg Reviewed By: clayborg Subscribers: emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D8685 llvm-svn: 233837
* Remove dead code in ProcessPOSIX.Davide Italiano2015-04-011-33/+0
| | | | | | Differential Revision: http://reviews.llvm.org/D8761 llvm-svn: 233831
* Implement Handle_QEnvironmentHexEncoded.Chaoren Lin2015-03-312-1/+21
| | | | | | | | | | | | Reviewers: clayborg, ovyalov, chaoren Reviewed By: chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8689 llvm-svn: 233768
* [LLDB][MIPS] Read/Write register for MIPS64Mohit K. Bhakkad2015-03-313-6/+122
| | | | | | | | | | | | Patch by Sagar Thakur Reviewers: clayborg, tberghammer. Subscribers: jaydeep, bhushan, mohit.bhakkad, llvm-commits. Differential Revision: http://reviews.llvm.org/D8695 llvm-svn: 233685
OpenPOWER on IntegriCloud