summaryrefslogtreecommitdiffstats
path: root/lldb/source/Plugins/Process
Commit message (Collapse)AuthorAgeFilesLines
...
* Unicode support on Win32.Zachary Turner2016-03-223-10/+23
| | | | | | | | | | | | | Win32 API calls that are Unicode aware require wide character strings, but LLDB uses UTF8 everywhere. This patch does conversions wherever necessary when passing strings into and out of Win32 API calls. Patch by Cameron Differential Revision: http://reviews.llvm.org/D17107 Reviewed By: zturner, amccarth llvm-svn: 264074
* Add a DiagnosticManager replace error streams in the expression parser.Sean Callanan2016-03-191-37/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We want to do a better job presenting errors that occur when evaluating expressions. Key to this effort is getting away from a model where all errors are spat out onto a stream where the client has to take or leave all of them. To this end, this patch adds a new class, DiagnosticManager, which contains errors produced by the compiler or by LLDB as an expression is created. The DiagnosticManager can dump itself to a log as well as to a string. Clients will (in the future) be able to filter out the errors they're interested in by ID or present subsets of these errors to the user. This patch is not intended to change the *users* of errors - only to thread DiagnosticManagers to all the places where streams are used. I also attempt to standardize our use of errors a bit, removing trailing newlines and making clients omit 'error:', 'warning:' etc. and instead pass the Severity flag. The patch is testsuite-neutral, with modifications to one part of the MI tests because it relied on "error: error:" being erroneously printed. This patch fixes the MI variable handling and the testcase. <rdar://problem/22864976> llvm-svn: 263859
* Fix thread/process ID reading from linux core filesPavel Labath2016-03-161-2/+2
| | | | | | | | | | | | | | | | | Summary: This also adds a basic smoke test for linux core file reading. I'm checking in the core files as well, so that the tests can run on all platforms. With some tricks I was able to produce reasonably-sized core files (~40K). This fixes the first part of pr26322. Reviewers: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D18176 llvm-svn: 263628
* This change introduces a "ExpressionExecutionThread" to the ThreadList. Jim Ingham2016-03-121-3/+3
| | | | | | | | | | | | | | | | | | | Turns out that most of the code that runs expressions (e.g. the ObjC runtime grubber) on behalf of the expression parser was using the currently selected thread. But sometimes, e.g. when we are evaluating breakpoint conditions/commands, we don't select the thread we're running on, we instead set the context for the interpreter, and explicitly pass that to other callers. That wasn't getting communicated to these utility expressions, so they would run on some other thread instead, and that could cause a variety of subtle and hard to reproduce problems. I also went through the commands and cleaned up the use of GetSelectedThread. All those uses should have been trying the thread in the m_exe_ctx belonging to the command object first. It would actually have been pretty hard to get misbehavior in these cases, but for correctness sake it is good to make this usage consistent. <rdar://problem/24978569> llvm-svn: 263326
* Try to fix windows build after rL262863Tamas Berghammer2016-03-081-1/+1
| | | | llvm-svn: 262923
* Change over the broadcaster/listener process to hold shared or weak pointersJim Ingham2016-03-0717-60/+60
| | | | | | | | | | | | | | to each other. This should remove some infrequent teardown crashes when the listener is not the debugger's listener. Processes now need to take a ListenerSP, not a Listener&. This required changing over the Process plugin class constructors to take a ListenerSP, instead of a Listener&. Other than that there should be no functional change. <rdar://problem/24580184> CrashTracer: [USER] Xcode at …ework: lldb_private::Listener::BroadcasterWillDestruct + 39 llvm-svn: 262863
* NFC: Refactor ProcessWinMiniDump to use a more traditional pimpl idiom.Adrian McCarthy2016-02-292-274/+309
| | | | | | | | This is a mechanical refactor. There should be no functional changes in this commit. Instead of encapsulating just the Windows-specific data, ProcessWinMiniDump now uses a private implementation class. This reduces indirections (in the source). It makes it easier to add private helper methods without touching the header and allows them to have platform-specific types as parameters. The only trick was that the pimpl class needed a back pointer in order to call a couple methods. llvm-svn: 262256
* Add support for DW_OP_push_object_address in dwarf expressionsTamas Berghammer2016-02-261-2/+2
| | | | | | | | | Additionally fix the type of some dwarf expression where we had a confusion between scalar and load address types after a dereference. Differential revision: http://reviews.llvm.org/D17604 llvm-svn: 262014
* Fix all of the unannotated switch cases to annotate the fall through or do ↵Greg Clayton2016-02-261-27/+25
| | | | | | the right thing and break. llvm-svn: 261950
* Get register context for the 32-bit process in a WoW64 process minidumpAdrian McCarthy2016-02-252-8/+93
| | | | | | | | | | | | 32-bit processes on 64-bit Windows run in a layer called WoW64 (Windows-on-Windows64). If you capture a mini dump of such a process from a 32-bit debugger, you end up with a register context for the 64-bit WoW64 process rather than the 32-bit one you probably care about. This detects WoW64 by looking to see if there's a module named wow64.dll loaded. For such processes, it then looks in the 64-bit Thread Environment Block (TEB) to locate a copy of the 32-bit CONTEXT record that the plugin needs for the register context. Added some rudimentary tests. I'd like to improve these later once we figure out how to get the exception information from these mini dumps. Differential Revision: http://reviews.llvm.org/D17465 llvm-svn: 261808
* Work around a stepping bug in arm64 android MPavel Labath2016-02-237-95/+354
| | | | | | | | | | | | | | | | | | | | | Summary: On arm64, linux<=4.4 and Android<=M there is a bug, which prevents single-stepping from working when the system comes back from suspend, because of incorrectly initialized CPUs. This did not really affect Android<M, because it did not use software suspend, but it is a problem for M, which uses suspend (doze) quite extensively. Fortunately, it seems that the first CPU is not affected by this bug, so this commit implements a workaround by forcing the inferior to execute on the first cpu whenever we are doing single stepping. While inside, I have moved the implementations of Resume() and SingleStep() to the thread class (instead of process). Reviewers: tberghammer, ovyalov Subscribers: aemerson, rengolin, tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D17509 llvm-svn: 261636
* [linux] Remove all traces of signalfd(2)Pavel Labath2016-02-231-1/+0
| | | | | | | | | | | | | | | Summary: Signalfd is not used in the code anymore, and given that the same functionality can be achieved with the new MainLoop class, it's unlikely we will need it in the future. Remove all traces of it. Reviewers: tberghammer, ovyalov Subscribers: tberghammer, danalbert, srhines, lldb-commits Differential Revision: http://reviews.llvm.org/D17510 llvm-svn: 261631
* Make sure code that is in the middle of figuring out the correct architectureJim Ingham2016-02-182-21/+32
| | | | | | | | | on attach uses the architecture it has figured out, rather than the Target's architecture, which may not have been updated to the correct value yet. <rdar://problem/24632895> llvm-svn: 261279
* Revert "Use BKPT instead of UDF for arm/thumb breakpoints"Tamas Berghammer2016-02-161-6/+6
| | | | | | | | | | | This reverts commit 293c18e067d663e0fe93e6f3d800c2a4bfada2b0. The BKPT instruction generates SIGBUS instead of SIGTRAP in the Linux kernel on Nexus 6 - 5.1.1 (kernel version 3.10.40). Revert the CL until we can figure out how can we hanble the SIGBUS or how to get back a SIGTRAP using the BKPT instruction. llvm-svn: 260969
* Add -Wimplicit-fallthrough command line option to clang inJason Molenda2016-02-164-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | the xcode project file to catch switch statements that have a case that falls through unintentionally. Define LLVM_FALLTHROUGH to indicate instances where a case has code and intends to fall through. This should be in llvm/Support/Compiler.h; Peter Collingbourne originally checked in there (r237766), then reverted (r237941) because he didn't have time to mark up all the 'case' statements that were intended to fall through. I put together a patch to get this back in llvm http://reviews.llvm.org/D17063 but it hasn't been approved in the past week. I added a new lldb-private-defines.h to hold the definition for now. Every place in lldb where there is a comment that the fall-through is intentional, I added LLVM_FALLTHROUGH to silence the warning. I haven't tried to identify whether the fallthrough is a bug or not in the other places. I haven't tried to add this to the cmake option build flags. This warning will only work for clang. This build cleanly (with some new warnings) on macosx with clang under xcodebuild, but if this causes problems for people on other configurations, I'll back it out. llvm-svn: 260930
* Additional fix to my change in r259983 to handle theJason Molenda2016-02-131-5/+11
| | | | | | | | | | | case where a core file has a kernel binary and a user process dyld in the same one. Without this, we were always picking the dyld and trying to process it as a kernel. <rdar://problem/24446112> llvm-svn: 260803
* Improve ReadRegister for RegisterContextWindowsx86Adrian McCarthy2016-02-112-30/+27
| | | | | | | | | | | | | | | | | In some circumstances (notably, certain minidumps), the thread CONTEXT does not have values for the control registers (EIP, ESP, EBP, EFLAGS). There are flags in the CONTEXT which indicate which portions are valid, but those flags weren't checked. The old code would not detect this and give a garbage value for the register. The new code will log the problem and return an error. I consolidated the error checking and logging into a helper function, which makes the big switch statement easier to read and verify. Ran tests to ensure this doesn't break anything. Manually verified that a minidump without info on the control registers now indicates the problem instead of giving bad information. Differential Review: http://reviews.llvm.org/D17152 llvm-svn: 260559
* Use BKPT instead of UDF for arm/thumb breakpointsTamas Berghammer2016-02-101-6/+6
| | | | | | | | | The UDF instruction is deprecated in armv7 and in case of thumb2 instructions set it don't work well together with the IT instruction. Differential revision: http://reviews.llvm.org/D16853 llvm-svn: 260367
* ProcessMachCore scans through the core file pages looking for aJason Molenda2016-02-061-0/+32
| | | | | | | | | | | | | | | | | | | | user process dyld binary and/or a mach kernel binary image. By default, it prefers the kernel if it finds both. But if it finds two kernel binary images (which can happen when random things are mapped into memory), it may pick the wrong kernel image. DynamicLoaderDarwinKernel has heuristics to find a kernel in memory; once we've established that there is a kernel binary in memory, call over to that class to see if it can find a kernel address via its search methods. If it does, use that. Some minor cleanups to DynamicLoaderDarwinKernel while I was at it. <rdar://problem/24446112> llvm-svn: 259983
* Add a little logging to ProcessMachCore so it is easier to tell when a user ↵Jason Molenda2016-02-041-3/+16
| | | | | | | | | | process dyld or mach kernel binary are found, and if there are multiples of them found within a single corefile. <rdar://problem/24446112> llvm-svn: 259850
* Provide arguments for all the format string placeholders!Adrian McCarthy2016-02-041-1/+1
| | | | | | Log message was wrong because an argument was missing. llvm-svn: 259793
* Pass socket scheme as part of debug server listen URL.Oleksiy Vyalov2016-02-031-0/+1
| | | | | | http://reviews.llvm.org/D16861 llvm-svn: 259714
* [NetBSD] Remove dead code.Davide Italiano2016-02-031-7/+0
| | | | | PR: http://reviews.llvm.org/D16818 llvm-svn: 259686
* The SetStopInfo from a Mach Exception was setting the stopJim Ingham2016-02-031-0/+2
| | | | | | | | | | reason to None when we stop due to a trace, then noticed that we were on a breakpoint that was not valid for the current thread. That should actually have set it back to trace. This was pr26441 (<rdar://problem/24470203>) llvm-svn: 259684
* Set correct thread stop info when single-step lands on a breakpoint [Windows]Adrian McCarthy2016-02-021-5/+19
| | | | | | | | I don't understand how this worked before, but this fixes the recent test regressions on Windows in TestConsecutiveBreakpoints.py. Differential Revision: http://reviews.llvm.org/D16825 llvm-svn: 259605
* Fix single-stepping onto a breakpointPavel Labath2016-02-022-26/+8
| | | | | | | | | | | | | | | Summary: r259344 introduced a bug, where we fail to perform a single step, when the instruction we are stepping onto contains a breakpoint which is not valid for this thread. This fixes the problem and add a test case. Reviewers: tberghammer, emaste Subscribers: abhishek.aggarwal, lldb-commits, emaste Differential Revision: http://reviews.llvm.org/D16767 llvm-svn: 259488
* NetBSD: Define initial RegisterContextNetBSD_x86_64Kamil Rytarowski2016-02-023-0/+400
| | | | | | | | | | | | Summary: Add basic support, i386 version will be added later. Reviewers: emaste, joerg, clayborg, tfiala Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16508 llvm-svn: 259462
* Set correct ThreadStopInfo in case of trace eventAbhishek Aggarwal2016-02-012-11/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: - The patch solves Bug 23478 and Bug 19311. Resolving Bug 23478 also resolves Bug 23039. Correct ThreadStopInfo is set for Linux and FreeBSD platforms. - Summary: When a trace event is reported, we need to check whether the trace event lands at a breakpoint site. If it lands at a breakpoint site then set the thread's StopInfo with the reason 'breakpoint'. Else, set the reason to be 'Trace'. Change-Id: I0af9765e782fd74bc0cead41548486009f8abb87 Signed-off-by: Abhishek Aggarwal <abhishek.a.aggarwal@intel.com> Reviewers: jingham, emaste, lldb-commits, clayborg, ovyalov Subscribers: emaste Differential Revision: http://reviews.llvm.org/D16720 llvm-svn: 259344
* Remove autoconf support from source directories.Eugene Zelenko2016-01-288-136/+0
| | | | | | Differential revision: http://reviews.llvm.org/D16662 llvm-svn: 259098
* A while back in revison 244716 we added support for getting the host OS ↵Greg Clayton2016-01-281-1/+2
| | | | | | | | version info from debugserver. We added keys to "qHostInfo" that were "osmajor", "osminor" and "ospatch", but no one ever parsed those, so I am removing them from debugserver. We accidentally also added a "version" key to qHostInfo instead of "os_version". So now we need to support both "version" and "os_version" in qHostInfo since we have debugserver binaries out in the wild that support this old packet type. I have updated debugserver ot use the correct "os_version" for future compatability or correctness. <rdar://problem/24378699> llvm-svn: 259003
* Some 32-bit arm corefiles on darwin may have their general purposeJason Molenda2016-01-202-4/+7
| | | | | | | | | | register set indicated by ARM_THREAD_STATE32 (value 9) instead of the old ARM_THREAD_STATE (value 1); this patch changes lldb to accept either register set flavor code. <rdar://problem/24246257> llvm-svn: 258289
* Update for llvm change. NFC.Rafael Espindola2016-01-181-1/+1
| | | | llvm-svn: 258080
* Add a small refinement to the qSymbol:: support in lldb.Jason Molenda2016-01-132-1/+48
| | | | | | | | | | | | | | | This is a packet which allows the remote gdb stub to ask for the address of a symbol in the process. lldb sends the packet (offering to provide addresses for symbol names) after every solib loaded. I changed lldb so that once the stub has indicated that it doesn't need any more symbol addresses, lldb will stop sending the qSymbol:: packet on new solib loads. This can yield a performance benefit over slower communication links when there are many solibs involved. <rdar://problem/23310049> llvm-svn: 257569
* Increase use of svr4 packets to improve performance on POSIX remotesStephane Sezer2016-01-122-122/+19
| | | | | | | | | | | | | | | | | | | | Summary: Allows the remote to enumerate the link map when adding and removing shared libraries, so that lldb doesn't need to read it manually from the remote's memory. This provides very large speedups (on the order of 50%) in total startup time when using the ds2 remote on android or Tizen devices. Reviewers: ADodds, tberghammer, tfiala Subscribers: tberghammer, sas, danalbert, llvm-commits, srhines Differential Revision: http://reviews.llvm.org/D16004 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 257502
* Try to fix the mips64 build after rL257447Tamas Berghammer2016-01-121-1/+1
| | | | llvm-svn: 257469
* Fix for TestNoreturnUnwind.py on i386Ravitheja Addepally2016-01-121-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: The testcase TestNoreturnUnwind.py was failing because the unwind from the vdso library was not successful for clang compiler while it was passing for gcc. It was passing for gcc since the unwind plan used was the assembly plan and the ebp register was set by the main function in case of gcc and was not used by the functions in the call flow to the vdso, whereas clang did not emit assembly prologue for main and so the assembly unwind was failing. Normally in case of failure of assembly unwind, lldb switches to EH CFI frame based unwinding, but this was not happening for the first frame. This patch tries to fix this behaviour by falling to EH CFI frame based unwinding in case of assembly unwind failure even for the first frame. The test is still marked as XFAIL since it relys on the fix of another bug. Reviewers: lldb-commits, jingham, zturner, tberghammer, jasonmolenda Subscribers: jasonmolenda Differential Revision: http://reviews.llvm.org/D15046 llvm-svn: 257465
* Changes to lldb and debugserver to reduce extraneous memory readsJason Molenda2016-01-124-19/+152
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | at each public stop to improve performance a bit. Most of the information lldb needed was already in the jThreadsInfo response; complete that information and catch a few cases where we could still fall back to getting the information via discrete memory reads. debugserver adds 'associated_with_dispatch_queue' and 'dispatch_queue_t keys to the jThreadsInfo response for all the threads. lldb needs the dispatch_queue_t value. And associated_with_dispatch_queue helps to identify which threads definitively don't have any queue information so lldb doesn't try to do memory reads to get that information just because it was absent in the jThreadsInfo response. Remove the queue information from the questionmark (T) packet. We'll get the information for all threads via the jThreadsInfo response - sending the information for the stopping thread (on all the private stops, plus the less frequent public stop) was unnecessary information being sent over the wire. SystemRuntimeMacOSX will try to get information about queues by asking the Threads for them, instead of reading memory. ProcessGDBRemote changes to recognize the new keys being sent in the jThreadsInfo response. Changes to ThreadGDBRemote to track the new information. Also, when a thread is marked as definitively not associated with a libdispatch queue, don't fall back to the system runtime to try memory reads to find the queue name / kind / ID etc. <rdar://problem/23309359> llvm-svn: 257453
* [LLDB][MIPS] Fix ReadRegisterValue for registers with constant 32 bit size ↵Mohit K. Bhakkad2016-01-121-1/+9
| | | | | | | | | | regardless of ABI Reviewers: clayborg, tberghammer. Subscribers: jaydeep, bhushan, sagar, nitesh.jain, lldb-commits. Differential Revision: http://reviews.llvm.org/D16060 llvm-svn: 257447
* Replace accidental DOS (and mixed) line endings in a few text filesDimitry Andric2016-01-111-46/+46
| | | | | | | | | | | | | | Summary: Similar to rL256704 and rL256707, fix a few text files which were accidentally checked in with DOS line endings, or mixed line endings. Reviewers: jingham, emaste Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D16027 llvm-svn: 257361
* Make the aarch64 lldb-server capable of debugging arm32 applicationsTamas Berghammer2016-01-113-10/+110
| | | | | | Differential revision: http://reviews.llvm.org/D15533 llvm-svn: 257322
* Prevent infinite recursive loop in AppleObjCTrampolineHandler constructorStephane Sezer2016-01-082-2/+7
| | | | | | | | | | | | | | | | | | | | | | | Summary: When we construct AppleObjCTrampolineHandler, if m_impl_fn_addr is invalid, we call CanJIT(). If the gdb remote process does not support allocating and deallocating memory, this call stack will include a call to the AppleObjCRuntime constructor. The AppleObjCRuntime constructor will then call the AppleObjCTrampolineHandler constructor, creating a recursive call loop that eventually overflows the stack and segfaults. Avoid this call loop by not constructing the AppleObjCTrampolineHandler within AppleObjCRuntime until we actually need to use it. Reviewers: clayborg, jingham Subscribers: sas, lldb-commits Differential Revision: http://reviews.llvm.org/D15978 Change by Francis Ricci <fjricci@fb.com> llvm-svn: 257204
* Treat an embedded int3/__debugbreak() as a breakpoint on Windows, includes a ↵Adrian McCarthy2016-01-081-39/+57
| | | | | | cross-platform test. llvm-svn: 257186
* Change the key name for the libdispatch queue serial number fromJason Molenda2016-01-081-12/+12
| | | | | | | | | "qserial" to "qserialnum" because "qserial" looks a lot like the queue type (either 'serial' or 'concurrent') and can be confusing to read through. debugserver passes these up either in the questionmark ("T") packet, or in the response to the jThreadsInfo packet. llvm-svn: 257121
* Make sure we don't send qModuleInfo packets unnecessarily.Stephane Sezer2016-01-082-1/+13
| | | | | | | | | | | | | | Summary: Some debug servers don't support it so there's no point in spamming this. Reviewers: clayborg Subscribers: fjricci, lldb-commits Differential Revision: http://reviews.llvm.org/D15972 llvm-svn: 257116
* Fix for undefined behavior while updating PC value on arm-linuxOmair Javaid2016-01-051-1/+18
| | | | | | Differential revision: http://reviews.llvm.org/D15877 llvm-svn: 256847
* [LLDB][MIPS] Make register read/write to set/get the size of register ↵Sagar Thakur2016-01-051-3/+9
| | | | | | | | | | | | | | according to abi. Summary: For O32 abi register size should be 4 bytes. For N32 and N64 abi register size should be 8 bytes. This patch will make register read/write to set/get the size of register according to abi. Reviewers: clayborg, tberghammer Subscribers: lldb-commits, nitesh.jain, mohit.bhakkad, bhushan, jaydeep Differential: http://reviews.llvm.org/D15884 llvm-svn: 256834
* [FreeBSD] Use a cast sledgehammer to placate newer versions of clang.Davide Italiano2016-01-041-2/+2
| | | | | | Now lldb can build on FreeBSD with -Werror again. llvm-svn: 256771
* Remove unused variableEd Maste2016-01-041-3/+1
| | | | | | Obtained from FreeBSD r292611 llvm-svn: 256724
* Strip trailing whitespaceEd Maste2016-01-042-146/+146
| | | | | | | | (There are changes in the copies of these four files in the FreeBSD base system, and I've changed these ones to reduce gratuitous diffs in future imports.) llvm-svn: 256723
* [LLDB] Fix Read/Write memory to be compatible with both endiansMohit K. Bhakkad2015-12-231-4/+2
| | | | | | | | Reviewers: tberghammer. Subscribers: jaydeep, bhushan, sagar, nitesh.jain,lldb-commits. Differential Revision: http://reviews.llvm.org/D15738 llvm-svn: 256331
OpenPOWER on IntegriCloud