summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
* Add --move-to-nearest-code / target.move-to-nearest-code optionsIlia K2015-05-156-24/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: This option forces to only set a source line breakpoint when there is an exact-match This patch includes the following commits: # Add the -m/--exact-match option in "breakpoint set" command ## Add exact_match arg in BreakpointResolverFileLine ctor ## Add m_exact_match field in BreakpointResolverFileLine ## Add exact_match arg in BreakpointResolverFileRegex ctor ## Add m_exact_match field in BreakpointResolverFileRegex ## Add exact_match arg in Target::CreateSourceRegexBreakpoint ## Add exact_match arg in Target::CreateBreakpoint ## Add -m/--exact-match option in "breakpoint set" command # Add target.exact-match option to skip BP if source line doesn't match ## Add target.exact-match global option ## Add Target::GetExactMatch ## Refactor Target::CreateSourceRegexBreakpoint to accept LazyBool exact_match (was bool) ## Refactor Target::CreateBreakpoint to accept LazyBool exact_match (was bool) # Add target.exact-match test in SettingsCommandTestCase # Add BreakpointOptionsTestCase tests to test --skip-prologue/--exact-match options # Fix a few typos in lldbutil.check_breakpoint_result func # Rename --exact-match/m_exact_match/exact_match/GetExactMatch to --move-to-nearest-code/m_move_to_nearest_code/move_to_nearest_code/GetMoveToNearestCode # Add exact_match field in BreakpointResolverFileLine::GetDescription and BreakpointResolverFileRegex::GetDescription, for example: was: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` now: ``` 1: file = '/Users/IliaK/p/llvm/tools/lldb/test/functionalities/breakpoint/breakpoint_command/main.c', line = 12, exact_match = 0, locations = 1, resolved = 1, hit count = 2 1.1: where = a.out`main + 20 at main.c:12, address = 0x0000000100000eb4, resolved, hit count = 2 ``` Test Plan: ./dotest.py -v --executable $BUILDDIR/bin/lldb functionalities/breakpoint/ ./dotest.py -v --executable $BUILDDIR/bin/lldb settings/ ./dotest.py -v --executable $BUILDDIR/bin/lldb tools/lldb-mi/breakpoint/ Reviewers: jingham, clayborg Reviewed By: clayborg Subscribers: lldb-commits, clayborg, jingham Differential Revision: http://reviews.llvm.org/D9273 llvm-svn: 237460
* [NativeProcessLinux] Fix removal of temporary breakpointsPavel Labath2015-05-152-19/+21
| | | | | | | | | | | | | | | | | | | | | | Summary: There was an issue in NPL, where we attempted removal of temporary breakpoints (used to implement software single stepping), while some threads of the process were running. This is a problem since we currently always use the main thread's ID in the removal ptrace call. Therefore, if the main thread was still running, the ptrace call would fail, and the software breakpoint would remain, causing all kinds of problems. This change removes the breakpoints after all threads have stopped. This fixes TestExitDuringStep on Android arm and can also potentially help in other situations, as previously the breakpoint would not get removed if the thread stopped for another reason. Test Plan: TestExitDuringStep passes, other tests remain unchanged. Reviewers: tberghammer Subscribers: tberghammer, aemerson, lldb-commits Differential Revision: http://reviews.llvm.org/D9792 llvm-svn: 237448
* [NativeProcessLinux] Fix potential race during thread exitPavel Labath2015-05-151-31/+7
| | | | | | | | | | | | | | | | | | | Summary: This is the same issue as we had in D9145 for thread creation. Going through the full ThreadDidStop/RequestResume cycle can cause a deferred notification to fire, which is not correct when we are ignoring an event and resuming the thread. In this case it doesn't matter much since the thread will die after that anyway, but for correctness, we should do the same thing here. Also treating the SIGTRAP case the same way. Test Plan: Tests continue to pass. Reviewers: chaoren, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9696 llvm-svn: 237445
* Fix StopInfoWatchpoint handling after r237411Pavel Labath2015-05-151-1/+3
| | | | | | | | | | | | r237411 exposed the following issue: ProcessGDBRemote used the description field in the stop-reply to set the description of the StopInfo. In the case of watchpoints, the packet description contains the raw address that got hit, which is not exactly the information we want to display to the user as the stop info. Therefore, I have changed the code to use the packet description only if the StopInfo does not already have a description. This makes the behavior equivalent to the pre-r237411 behavior as then the SetDecription call got ignored for watchpoints. llvm-svn: 237436
* Fix virtual step handling in ThreadPlanStepInRangeTamas Berghammer2015-05-151-0/+1
| | | | | | Differential revision: http://reviews.llvm.org/D9773 llvm-svn: 237435
* Fix a reason of *stopped notifications due to SIGINT/SIGSTOP signals (MI)Ilia K2015-05-151-0/+6
| | | | | | | | | | | | | # Add SBProcess::GetInterruptedFromEvent # Add vrEvent arg in CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStateStopped and CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal # Refactor CMICmnLLDBDebuggerHandleEvents::HandleProcessEventStopSignal ## Clean up and fix typos ## Remove vwrbShouldBrk arg # Fix MiSignalTestCase.test_lldbmi_stopped_when_stopatentry_{local,remote} to expect SIGSTOP instead of SIGINT llvm-svn: 237426
* Fix a few compile warningsIlia K2015-05-152-3/+3
| | | | llvm-svn: 237425
* LLDB build broke after applying patch http://reviews.llvm.org/D9706Omair Javaid2015-05-152-12/+9
| | | | | | This patch fixes the issue. llvm-svn: 237421
* Assembly profiler for mips32Bhushan D. Attarde2015-05-159-1/+767
| | | | | | | | | | | Summary: Implementation of assembly profiler for MIPS32 using EmulateInstruction which currently scans only prologue/epilogue assembly instructions. It uses llvm::MCDisassembler to decode assembly instructions. Reviewers: clayborg, jasonmolenda Differential Revision: http://reviews.llvm.org/D9769 llvm-svn: 237420
* This patch adds support for setting/clearing hardware watchpoints and ↵Omair Javaid2015-05-159-5/+663
| | | | | | | | breakpoints on AArch64 (Arm v8) 64-bit hardware. http://reviews.llvm.org/D9706 llvm-svn: 237419
* Reverting r237392 since it broke TestNumThreads on ubuntu builder.Oleksiy Vyalov2015-05-158-44/+28
| | | | llvm-svn: 237415
* The StopInfo base class has an m_description std::string.Jason Molenda2015-05-151-5/+1
| | | | | | | | | Remove the m_description ivar from the StopInfoBreakpoint and StopInfoWatchpoint subclasses of StopInfo. Also, initialize the m_description ivar in the StopInfo ctor. <rdar://problem/20902950> llvm-svn: 237411
* Don't bother dynamic loading the Windows Slim RW Lock API.Zachary Turner2015-05-141-215/+80
| | | | | | | | | | | | This API has been present since XP, and I think it's safe to drop support for XP (since other things have been introduced long ago which already don't work on XP anyway). With this patch, we can statically bind against the exports and not bother falling back to a CRITICAL_SECTION if we can't load the API. llvm-svn: 237402
* Enable multithreaded debugging on Windows.Adrian McCarthy2015-05-148-28/+44
| | | | llvm-svn: 237392
* Implement an objc tagged-pointer info command that will provide information ↵Enrico Granata2015-05-142-20/+142
| | | | | | about what LLDB thinks an ObjC tagged pointer represents llvm-svn: 237322
* Add mips64el trap opcode to PlatformFreeBSD as wellEd Maste2015-05-131-0/+7
| | | | llvm-svn: 237315
* Restore breaks lost in shuffling GetSoftwareBreakpointTrapOpcodeEd Maste2015-05-131-0/+3
| | | | llvm-svn: 237313
* Add AArch64 and MIPS breakpoint opcodes and sort casesEd Maste2015-05-131-6/+18
| | | | | | New opcodes from PlatformLinux.cpp llvm-svn: 237306
* Initial FreeBSD/arm live debugging supportEd Maste2015-05-132-0/+10
| | | | | | | Patch by Tom Rix, except using the RegisterContextFreeBSD_arm files added in r235305 instead. llvm-svn: 237303
* Rearrange PlatformFreeBSD to match PlatformLinuxEd Maste2015-05-131-134/+134
| | | | | | No functional change, but this simplifies diffs of the two. llvm-svn: 237302
* Fix an issue with finding python on Windows.Zachary Turner2015-05-131-2/+1
| | | | | | | | | | | | | Someone must have changed the behavior of FileSpec slightly relating to whether or not there is a trailing backslash when calling GetPath() and GetDirectory(). This caused ScriptInterpreterPython to find the wrong values when initializing sys.path, and as a result we couldn't find the lldb module. This patch fixes the issue, and also adds a test to make sure that GetDirectory() does not return a string containing a trailing slash. llvm-svn: 237282
* Remove DoAttachToProcessWithId(lldb::pid_t).Zachary Turner2015-05-136-32/+1
| | | | | | | | | | There were two versions of DoAttachToprocessWithId. One that takes a pid_t, and the other which takes a pid_t and a ProcessAttachInfo. There were no callers of the former version, and all of the implementations of this version were simply forwarding calls to one version or the other. llvm-svn: 237281
* Have Platform::KillProcess try to use the process plugin first.Zachary Turner2015-05-131-3/+21
| | | | llvm-svn: 237280
* Change Linux Platform to support non-host Linux architecturesTed Woodward2015-05-131-0/+24
| | | | | | | | | | | | | | | | | | | | | | Summary: This was originally http://reviews.llvm.org/D8709 , but I didn't commit it correctly. Since then GetSupportedArchitectureAtIndex() has been changed. That change, http://reviews.llvm.org/D9511 , breaks non-x86 linux implementations, so this change goes back to the old implementation and adds remote linux support from D8709. D8709 summary: The Linux Platform currently will only say the Host architecture is supported. This patch retains that behavior for the Host Platform, but adds a list of architectures for the Remote Platform. Reviewers: clayborg, flackr Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9683 llvm-svn: 237278
* Enable workaround for finding functions in global namespace on linux binaries onRobert Flack2015-05-131-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | all hosts. We require a workaround to be able to locate global and anonymous namespace functions in the dwarf symbols on linux binaries. This patch enables this code on all platforms so that we can still find these symbols when debugging from a different host platform. Test Plan: The following tests begin passing when running with a mac host to linux client: TestCallCPPFunction.py TestCallStopAndContinue.py TestExprs.py TestExprsChar.py TestNamespace.py TestOverloadedFunctions.py TestRvalueReferences.py TestThreadExit.py Differential Revision: http://reviews.llvm.org/D9754 llvm-svn: 237270
* Fix arm instruction emulation of add (imm) and sub (imm)Tamas Berghammer2015-05-131-35/+48
| | | | | | Differential revision: http://reviews.llvm.org/D9704 llvm-svn: 237240
* Remote Non-Stop SupportEwan Crawford2015-05-139-8/+125
| | | | | | | | | | | | | | | | | | | | Summary: This patch is the beginnings of support for Non-stop mode in the remote protocol. Letting a user examine stopped threads, while other threads execute freely. Non-stop mode is enabled using the setting target.non-stop-mode, which sends a QNonStop packet when establishing the remote connection. Changes are also made to treat the '?' stop reply packet differently in non-stop mode, according to spec https://sourceware.org/gdb/current/onlinedocs/gdb/Remote-Non_002dStop.html#Remote-Non_002dStop. A setting for querying the remote for default thread on setup is also included. Handling of '%' async notification packets will be added next. Reviewers: clayborg Subscribers: lldb-commits, ADodds, ted, deepak2427 Differential Revision: http://reviews.llvm.org/D9656 llvm-svn: 237239
* Fix a few compile warningsIlia K2015-05-132-2/+2
| | | | llvm-svn: 237238
* Don't change the selected platform when creating the dummy target.Robert Flack2015-05-131-2/+2
| | | | | | | | | | | | | | | | | | | A dummy target is used by TargetList::CreateTargetInternal to prime newly created targets. the first time this is done it creates the dummy target. The dummy target is created with the host platform (See TargetList::CreateDummyTarget) which results in switching the selected platform back to the host platform even when creating a target for a different platform. This change avoids changing the selected platform while creating the dummy target to prevent this side effect. Test Plan: ./dotest.py $DOTEST_OPTS -t -p TestCreateAfterAttach.py Tests using process attach (e.g. TestCreateAfterAttach.py, TestHelloWorld.py) now run successfully mac -> linux. Differential Revision: http://reviews.llvm.org/D9712 llvm-svn: 237221
* Fixed a ton of gcc compile warningsVince Harron2015-05-1330-109/+109
| | | | | | | | | | Removed some unused variables, added some consts, changed some casts to const_cast. I don't think any of these changes are very controversial. Differential Revision: http://reviews.llvm.org/D9674 llvm-svn: 237218
* Platform settings doesn't need permission options.Chaoren Lin2015-05-121-3/+0
| | | | | | | | | | | | | | | | Summary: Also removes conflict error message for '-w' between --user-write and --working-dir. Reviewers: flackr, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9711 llvm-svn: 237178
* Windows: fix bug in getcwd() and add chdir().Ted Woodward2015-05-123-13/+15
| | | | | | | | | | | | | | | | | Summary: GetCurrentDirectory() returns the number of characters copied; 0 is a failure, not a success. Add implementation for chdir(). Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9300 llvm-svn: 237162
* Call remote platform GetSupportedArchitectureAtIndex if connected to remote.Robert Flack2015-05-121-9/+27
| | | | | | | | | | | | | | | | | Updated PlatformLinux::GetSupportedArchitectureAtIndex to call the PlatformRemoteGdbServer::GetSupportedArchitectureAtIndex if connected remotely. This should return the correct thing for android (to fix those failing tests), and is also working for mac to linux. Test Plan: ./dotest.py $DOTEST_OPTS -t -p TestCallStdStringFunction.py The above still passes when running mac->linux indicating it successfully identified PlatformLinux as the target platform and converted the mmap options correctly. Differential Revision: http://reviews.llvm.org/D9672 llvm-svn: 237128
* Return the correct user register count for arm from NativeRegisterContextTamas Berghammer2015-05-122-0/+12
| | | | | | | | The defult implementation falls back to GetRegisterCount what includes the debug registers also what shouldn't be displayed to the user. llvm-svn: 237111
* Remove handling of eStateStopped from NativeProcessLinux::ResumePavel Labath2015-05-122-135/+8
| | | | | | | | | | | | | | | | | | | | | | | Summary: NPL::Resume attempted to handle eStateStopped as a resume action. However: - GDBRemoteCommunicationServerLLGS (the only user of NPL) never sets this action - it could set this action in response to a vCont:t packet, but LLDB never produces this packet - gdb-remote protocol documentation says vCont:t packet is used only in non-stop mode, but LLDB does not support non-stop mode - even if LLDB supported non-stop mode, this implementation of eStateStopped does something different from what the spec says it should (according to spec, it should stop the specified thread, but this seems to want to stop all threads). Given the facts above, I believe we should remove this unused and untested code, as it probably doesn't even work and removing it makes the rest of the code noticably simpler. Reviewers: ovyalov, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9657 llvm-svn: 237103
* [NativeProcessLinux] Remove event mutex and clean functions using itPavel Labath2015-05-122-242/+72
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Since the former-TSC events are now processed synchronously, there is no need for to protect them with a separate mutex - all the actions are now guarded by the big m_threads_mutex. With the mutex gone, the following functions, no longer have any purpose and were removed: NotifyThreadCreate: replaced by direct calls to ThreadWasCreated NotifyThreadStop: replaced by direct calls to ThreadDidStop NotifyThreadDeath: folded into StopTrackingThread ResetForExec: inlined as it consisted of a single line of code RequestThreadResume(AsNeeded): replaced by direct calls to ResumeThread StopThreads: removed, as it was never called Test Plan: tests continue to pass Reviewers: ovyalov, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9603 llvm-svn: 237101
* Get lldb-server building on android-9Vince Harron2015-05-1211-83/+103
| | | | | | Build lldb-server with an android-9 sysroot. llvm-svn: 237078
* Remove Triple Vendor check when creating FreeBSD PlatformEd Maste2015-05-121-27/+5
| | | | | | This is equivalent to r237052 in PlatformLinux.cpp. llvm-svn: 237075
* Fix selecting the Platform in TargetList::CreateTargetInternal()Ted Woodward2015-05-111-22/+17
| | | | | | | | | | | | | | | | | Summary: TargetList::CreateTargetInternal() will only select the current Platform. A previous patch always sets platform_sp to the current Platform, so a check later to see if platform_sp was not defined always failed, and the current Platform was used. This patch removes that check, so if the current Platform is not compatible with the target architecture, CreateTargetInternal() will call Platform::GetPlatformForArchitecture() to select a compatible Platform. Vince, remote linux tests (Ubuntu -> remote Ubuntu) pass the same with and without this patch. Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: jingham, lldb-commits Differential Revision: http://reviews.llvm.org/D8749 llvm-svn: 237053
* Remove Triple Vendor check when creating Linux PlatformTed Woodward2015-05-111-27/+6
| | | | | | | | | | | | | | Summary: The Linux Platform shouldn't care about the Vendor field in the Triple. Currently it allows a value of "PC", or "unknown" if LLDB was built on Linux. This patch removes that check, so the Vendor field isn't touched. This will allow the Linux Platform to be created when using a Triple of *-*-Linux. Reviewers: vharron, clayborg, sas, tberghammer Reviewed By: clayborg, sas, tberghammer Subscribers: tberghammer, sas, lldb-commits Differential Revision: http://reviews.llvm.org/D8742 llvm-svn: 237052
* Add Hexagon packet support to ThreadPlanStepRangeTed Woodward2015-05-112-3/+51
| | | | | | | | | | | | | | | | | Summary: Hexagon is a VLIW processor. It can execute multiple instructions at once, called a packet. Breakpoints need to be alone in a packet. This patch will make sure that temporary breakpoints used for stepping are set at the start of a packet, which will put the breakpoint in a packet by itself. Patch by Deepak Panickal of CodePlay and Ted Woodward of Qualcomm. Reviewers: deepak2427, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9437 llvm-svn: 237047
* Fix thumb condition extraction in ARM instrcution emulatorTamas Berghammer2015-05-111-2/+2
| | | | llvm-svn: 236988
* [NativeProcessLinux] Remove double thread state accountingPavel Labath2015-05-114-167/+112
| | | | | | | | | | | | | | | | | | Summary: Now that all thread events are processed synchronously, there is no need to have separate records of whether a thread is running. This changes the (ever-dwindling) remains of the TSC to use NativeThreadLinux as the authoritative source of the state of threads. The rest of the ThreadContext we need has been moved to a member of NTL. Test Plan: ninja check-lldb continues to pass Reviewers: chaoren, ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9562 llvm-svn: 236983
* Add support for ./dotest.py --channel and --log-successVince Harron2015-05-101-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: New dotest options that allow arbitrary log channels and categories to be enabled. Also enables logging for locally run debug servers. Log messages are separated into separate files per test case. (this makes it possible to log in dosep runs) These new log files are stored side-by-side with trace files in the session directory. These files are deleted by default if the test run is successful. If --log-success is specified, even successful logs are retained. --log-success is useful for creating reference log files. Test Plan: add '--channel "lldb all" --channel "gdb-remote packets" --log-success' to your dotest options Tested on OSX and Linux Differential Revision: http://reviews.llvm.org/D9594 llvm-svn: 236956
* Fixed minor compile warningsVince Harron2015-05-101-2/+1
| | | | llvm-svn: 236945
* Convert mmap options for target in InferiorCallMmap.Robert Flack2015-05-095-28/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | Converts the MAP_PRIVATE and MAP_ANON options to the target platform constants (on which the call runs) rather than using those of the compiled host. Test Plan: Run test suite, the following tests requiring memory allocation / JIT support begin passing when running mac -> linux: Test11588.py TestAnonymous.py TestBreakpointConditions.py TestCPPStaticMethods.py TestCStrings.py TestCallStdStringFunction.py TestDataFormatterCpp.py TestDataFormatterStdList.py TestExprDoesntBlock.py TestExprHelpExamples.py TestFunctionTypes.py TestPrintfAfterUp.py TestSBValuePersist.py TestSetValues.py Differential Revision: http://reviews.llvm.org/D9511 llvm-svn: 236933
* Set path syntax for remote executable FileSpec.Chaoren Lin2015-05-093-11/+16
| | | | | | | | | | Reviewers: ovyalov, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9579 llvm-svn: 236925
* Use hard links to link sysroot files within ModuleCache.Oleksiy Vyalov2015-05-084-42/+49
| | | | | | http://reviews.llvm.org/D9587 llvm-svn: 236917
* Enable thread-safe logging.Zachary Turner2015-05-081-8/+16
| | | | | | | | | | | | | Thread-safe logging had been disabled because of a deadlock, possibly due to a lock acquired during a signal handler. This patch turns thread safe logging back on and also greatly reduces the scope of the lock, confining it only to the code that affects the underlying output stream, instead of all the code that builds up the formatted log message. this should resolve the issue surrounding the deadlock. llvm-svn: 236892
* Remove check for object file type from DynamicLoaderPOSIXDYLD::DidAttachTamas Berghammer2015-05-081-4/+0
| | | | | | | | For PIE executables the type of the main executable is shared object so we can't force that the main executable should have the type of executable. llvm-svn: 236870
OpenPOWER on IntegriCloud