summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common
Commit message (Collapse)AuthorAgeFilesLines
...
* Move GetOptInc to the common namespacePavel Labath2015-09-041-0/+473
| | | | | | | | | | | | | | | | | | | Summary: GetOptInc provides getopt(), getopt_long() and getopt_long_only(). Windows (for defined(_MSC_VER)) doesn't ship with all of the getopt(3) family members and needs all of them. NetBSD requires only getopt_long_only(3). While there fix the code for clang diagnostics. Author: Kamil Rytarowski Reviewers: joerg Subscribers: labath, zturner, lldb-commits Differential Revision: http://reviews.llvm.org/D12582 llvm-svn: 246843
* NetBSD ships with paccept(2), a superset of accept4(2)Stephane Sezer2015-09-031-2/+4
| | | | | | | | | | | | | | Summary: accept4(2) and paccept(2) are nonstandard extensions. Reviewers: joerg, sas Subscribers: emaste, sas, lldb-commits Differential Revision: http://reviews.llvm.org/D12485 Change by Kamil Rytarowski <n54@gmx.com> llvm-svn: 246787
* Simplify find_first_of & find_last_of on single char.Bruce Mitchener2015-09-012-2/+2
| | | | | | | | | | | | | | | Summary: When calling find_first_of and find_last_of on a single character, we can instead just call find / rfind and make our intent more clear. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D12518 llvm-svn: 246609
* [LLDB][MIPS] Handle false positives for MIPS hardware watchpointsJaydeep Patil2015-08-131-0/+6
| | | | | | | | | | | | | | | | 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 for build errors on arm-linux-gnueabi-gccOmair Javaid2015-08-091-0/+4
| | | | | | http://reviews.llvm.org/D11256 llvm-svn: 244419
* Fix issues with separate symbolfile handlingTamas Berghammer2015-07-301-3/+7
| | | | | | Differential revision: http://reviews.llvm.org/D11595 llvm-svn: 243637
* Fix warnings detected by -Wpessimizing-movePavel Labath2015-07-282-4/+2
| | | | | | | | patch by Eugene Zelenko Differential Revision: http://reviews.llvm.org/D11429 llvm-svn: 243399
* Add some initial logging for when lldb is searching for binaries,Jason Molenda2015-07-251-0/+21
| | | | | | | | | dSYMs, or reading binaries out of memory to the 'Host' log channel. There's more to be done here, both for Mac and for other platforms, but the initial set of new loggings are useful enough to check in at this point. llvm-svn: 243200
* Log socket communications to LIBLLDB_LOG_COMMUNICATION instead ofJason Molenda2015-07-241-3/+3
| | | | | | | | the Host channel. http://reviews.llvm.org/D11497 llvm-svn: 243175
* Bind to the loopback when we are expecting a connection from 127.0.0.1 so we ↵Greg Clayton2015-07-241-9/+18
| | | | | | | | don't set off firewall protections. <rdar://problem/17897318> llvm-svn: 243118
* Disable mutex error checking so it doesn't create problems with the ↵Greg Clayton2015-07-231-1/+1
| | | | | | multi-threaded test case. The error would cause an assertion that could cause lldb to crash when unlocking a mutex returned an error because it was in use. llvm-svn: 243067
* Fix typos.Bruce Mitchener2015-07-221-1/+1
| | | | | | | | | | | | Summary: Fix a bunch of typos. Reviewers: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11386 llvm-svn: 242856
* [NativeProcessLinux] Integrate MainLoopPavel Labath2015-07-211-6/+2
| | | | | | | | | | | | | | | | | | | Summary: This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been reduced by about 40%). It also makes the code simpler, IMHO. Reviewers: ovyalov, clayborg, tberghammer, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11150 This is a resubmission of r242305 after it was reverted due to bad interactions with the stdio thread. llvm-svn: 242783
* Revert "Add Pipe::WriteWithTimeout method"Pavel Labath2015-07-211-9/+2
| | | | | | | | I have observed an increased flakyness in the buildbots. I suspect something was relying on the fact that Pipe::Write had an implicit timeout of 1s, which this commit has removed. Reverting while I investigate. llvm-svn: 242767
* Add Pipe::WriteWithTimeout methodPavel Labath2015-07-211-2/+9
| | | | | | | | | | | | | | | | | | Summary: This commit adds a WriteWithTimeout method to time Pipe class, analogous to the existing ReadWithTimeout(). It also changes the meaning of passing zero as a timeout value. Previously, zero was used as an infinite timeout value. Now, the meaning of zero timeout to return the data avaiable without sleeping (basically, a non-blocking operation). This makes the behaviour of Pipe consistent with the Communication/Connection classes. For blocking operatios with infinite timeout, I introduce a special constant for this purpose. Reviewers: ovyalov, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11358 llvm-svn: 242764
* Fix FileSpec::IsSymlink implementation.Oleksiy Vyalov2015-07-211-0/+22
| | | | | | http://reviews.llvm.org/D11356 llvm-svn: 242753
* freeaddrinfo(NULL) segfaults on Android.Chaoren Lin2015-07-171-2/+4
| | | | | | | | | | Reviewers: tberghammer Subscribers: tberghammer, danalbert, lldb-commits Differential Revision: http://reviews.llvm.org/D11285 llvm-svn: 242560
* Add missing include for android-arm buildTamas Berghammer2015-07-161-0/+1
| | | | llvm-svn: 242396
* Revert "[NativeProcessLinux] Integrate MainLoop"Pavel Labath2015-07-161-2/+6
| | | | | | This seems to be causing major slowdows on the android buildbot. Reverting while I investigate. llvm-svn: 242391
* Use accept instead of accept4 for Android.Chaoren Lin2015-07-151-2/+19
| | | | | | | | | | | | | | | Summary: The accept4 syscall is missing on older ARM Android kernels, and the accept() call is implemented with the accept4 syscall, so we'll need to call the accept syscall directly. Reviewers: vharron, tberghammer, labath Subscribers: ovyalov, chaoren, labath, tberghammer, aemerson, lldb-commits Differential Revision: http://reviews.llvm.org/D10887 llvm-svn: 242319
* [NativeProcessLinux] Integrate MainLoopPavel Labath2015-07-151-6/+2
| | | | | | | | | | | | | | | | Summary: This commit integrates MainLoop into NativeProcessLinux. By registering a SIGCHLD handler with the llgs main loop, we can get rid of the special monitor thread in NPL, which saves as a lot of thread ping-pong when responding to client requests (e.g. qThreadInfo processing time has been reduced by about 40%). It also makes the code simpler, IMHO. Reviewers: ovyalov, clayborg, tberghammer, chaoren Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D11150 llvm-svn: 242305
* [Makefiles] Align library names with CMake buildKeno Fischer2015-07-141-14/+0
| | | | | | | | | | | | Summary: This aligns the library names used by the Makefile build to be the same as those create by the CMake build to make switching between the two easier. The only major difficulty was lldbHost which was one library in the CMake system and several in the Makefile system. Most of the other changes are trivial renames. Reviewers: labath Subscribers: emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11154 llvm-svn: 242196
* Refactor Unix signals.Chaoren Lin2015-07-141-7/+3
| | | | | | | | | | | | | | | | | | Summary: - Consolidate Unix signals selection in UnixSignals. - Make Unix signals available from platform. - Add jSignalsInfo packet to retrieve Unix signals from remote platform. - Get a copy of the platform signal for each remote process. - Update SB API for signals. - Update signal utility in test suite. Reviewers: ovyalov, clayborg Subscribers: chaoren, jingham, labath, emaste, tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D11094 llvm-svn: 242101
* Avoid going through Platform when creating a NativeProcessProtocol instancePavel Labath2015-07-091-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This commit avoids the Platform instance when spawning or attaching to a process in lldb-server. Instead, I have the server call a (static) method of NativeProcessProtocol directly. The reason for this is that I believe that NativeProcessProtocol should be decoupled from the Platform (after all, it always knows which platform it is running on, unlike the rest of lldb). Additionally, the kind of platform actions a NativeProcessProtocol instance is likely to differ greatly from the platform actions of the lldb client, so I think the separation makes sense. After this, the only dependency NativeProcessLinux has on PlatformLinux is the ResolveExecutable method, which needs additional refactoring. This is a resubmit of r241672, after it was reverted due to build failueres on non-linux platforms. Reviewers: ovyalov, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10996 llvm-svn: 241796
* Make the "lldb/Utility/JSON.h" able to parse JSON into tokens with the new ↵Greg Clayton2015-07-061-59/+83
| | | | | | | | | | JSONParser class. Change over existing code to use this new parser so StructuredData can use the tokenizer to parse JSON instead of doing it manually. This allowed us to easily parse JSON into JSON* objects as well as into StructuredData. llvm-svn: 241522
* Fix windows build.Ewan Crawford2015-06-301-34/+28
| | | | | | Windows build was broken in either r240983 or r240978 in the changes to FileSpec.cpp llvm-svn: 241071
* Rewrite FileSpec::EnumerateDirectory to avoid code duplication.Chaoren Lin2015-06-291-197/+16
| | | | | | | | | | | | Reviewers: clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10811 llvm-svn: 240983
* Avoid a recursive function call that could run LLDB out of file descriptors ↵Greg Clayton2015-06-291-0/+192
| | | | | | | | | | | | | | | | | in FileSystem::DeleteDirectory(...). Fixes include: - use FileSystem::Unlink() instead of a direct call to ::unlink(...) when deleting files when iterating through the current directory - save directories from current directory in a list and iterate through those _after_ the current directory has been iterated - Use new FileSpec::ForEachItemInDirectory() instead of manually iterating across directories with opendir()/readdir()/closedir() We should switch all code over to using FileSpec::ForEachItemInDirectory(...) in the near future and get rid of FileSpec::EnumerateDirectory(). This is a follow up patch to: http://reviews.llvm.org/D10787 llvm-svn: 240978
* [LLDB][MIPS] MIPS32 branch emulation and single-steppingJaydeep Patil2015-06-231-0/+6
| | | | | | | | | | | | | | | SUMMARY: This patch implements 1. Emulation of MIPS32 branch instructions 2. Enable single-stepping for MIPS32 instructions 3. Correction in emulation of MIPS64 branch instructions with delay slot 4. Adjust breakpoint address when breakpoint is hit in a forbidden slot of compact branch instruction Reviewers: clayborg Subscribers: mohit.bhakkad, sagar, bhushan, lldb-commits, emaste, nitesh.jain Differential Revision: http://reviews.llvm.org/D10596 llvm-svn: 240373
* Fix a variety of typos.Bruce Mitchener2015-06-181-1/+1
| | | | | | No functional change. llvm-svn: 239995
* Rename `FileSpec::IsRelativeToCurrentWorkingDirectory` to `IsRelative`.Chaoren Lin2015-06-091-1/+7
| | | | | | | | | | | | | | | | | Summary: `IsRelativeToCurrentWorkingDirectory` was misleading, because relative paths are sometimes appended to other directories, not just the cwd. Plus, the new name is shorter. Also added `IsAbsolute` for completeness. Reviewers: clayborg, ovyalov Reviewed By: ovyalov Subscribers: tberghammer, lldb-commits Differential Revision: http://reviews.llvm.org/D10262 llvm-svn: 239419
* Delegate path operations to FileSpec.Chaoren Lin2015-06-051-5/+44
| | | | | | | | | | | | | | | | | Summary: - Added PrependPathComponent utility functions to FileSpec. - Delegate path operations in ParseCompileUnit to FileSpec. - Delegate path operations in ParseSupportFiles to FileSpec. Reviewers: clayborg, vharron, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10253 llvm-svn: 239127
* Fix LLDB so that it can correctly track down dependent shared libraries that ↵Greg Clayton2015-06-021-0/+8
| | | | | | | | use @rpath. <rdar://problem/8371885> llvm-svn: 238886
* Change use of keyword 'or' to '||' as keyword not supported by visual ↵Aidan Dodds2015-06-021-2/+2
| | | | | | studio 2013. llvm-svn: 238819
* Fix TestPaths.Chaoren Lin2015-06-011-2/+2
| | | | | | | | | | | | Reviewers: vharron, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10164 llvm-svn: 238767
* Working directory FileSpec should use remote path syntax to display correctly.Chaoren Lin2015-05-291-0/+15
| | | | | | | | | | | | | | Summary: Depends on D9728. Reviewers: ovyalov, zturner, clayborg Reviewed By: clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9806 llvm-svn: 238605
* Refactor many file functions to use FileSpec over strings.Chaoren Lin2015-05-296-53/+78
| | | | | | | | | | | | | | | | | Summary: This should solve the issue of sending denormalized paths over gdb-remote if we stick to GetPath(false) in GDBRemoteCommunicationClient, and let the server handle any denormalization. Reviewers: ovyalov, zturner, vharron, clayborg Reviewed By: clayborg Subscribers: tberghammer, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D9728 llvm-svn: 238604
* Make FileSpec::Dump use FileSpec::GetPath(), not the other way around.Chaoren Lin2015-05-281-44/+62
| | | | | | | | | | | | | | | | | Summary: Fix FileSpec::Dump() to output denormalized path. See D9942 for previous discussions. Reviewers: zturner Reviewed By: zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D10077 llvm-svn: 238440
* Improve LLDB prompt handlingPavel Labath2015-05-271-38/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | Summary: There is an issue in lldb where the command prompt can appear at the wrong time. The partial fix we have in for this is not working all the time and is introducing unnecessary delays. This change does: - Change Process:SyncIOHandler to use integer start id's for synchronization to avoid it being confused by quick start-stop cycles. I picked this up from a suggested patch by Greg to lldb-dev. - coordinates printing of asynchronous text with the iohandlers. This is also based on a (different) Greg's patch, but I have added stronger synchronization to it to avoid races. Together, these changes solve the prompt problem for me on linux (both with and without libedit). I think they should behave similarly on Mac and FreeBSD and I think they will not make matters worse for windows. Test Plan: Prompt comes out alright. All tests still pass on linux. Reviewers: clayborg, emaste, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9823 llvm-svn: 238313
* Allow clients to get parsing errors and also fix the ApplePropertyList so it ↵Greg Clayton2015-05-271-2/+21
| | | | | | parses the structured data correctly. llvm-svn: 238280
* Modify the ApplePropertyList to be able to create StructuredData objects ↵Greg Clayton2015-05-261-0/+126
| | | | | | from the plist XML. llvm-svn: 238260
* Added XML to the host layer.Greg Clayton2015-05-261-0/+548
| | | | | | | | | | | | We know have on API we should use for all XML within LLDB in XML.h. This API will be easy back the XML parsing by different libraries in case libxml2 doesn't work on all platforms. It also allows the only place for #ifdef ...XML... to be in XML.h and XML.cpp. The API is designed so it will still compile with or without XML support and there is a static function "bool XMLDocument::XMLEnabled()" that can be called to see if XML is currently supported. All APIs will return errors, false, or nothing when XML isn't enabled. Converted all locations that used XML over to using the host XML implementation. Added target.xml support to debugserver. Extended the XML register format to work for LLDB by including extra attributes and elements where needed. This allows the target.xml to replace the qRegisterInfo packets and allows us to fetch all register info in a single packet. <rdar://problem/21090173> llvm-svn: 238224
* Fix compiler warnings regarding size_t not always being 64 bit in the printf.Greg Clayton2015-05-251-8/+8
| | | | llvm-svn: 238127
* Implement PlatformWindows::GetEnvironment.Zachary Turner2015-05-221-11/+0
| | | | | | | This fixes a couple of tests that rely on being able to get the host's environment or spawn an inferior with specific arguments. llvm-svn: 238042
* Only check for matching arch and UUID when looking for dsym in vincinity of ↵Robert Flack2015-05-211-4/+22
| | | | | | | | | | | | | | | | | executable. ModuleSpecs::FindMatchingModuleSpec looks for matching filenames but when looking for the dSYM we should only be looking for a matching architecture and and UUID. Jason pointed out this mistake in http://reviews.llvm.org/D9174 when this function was incorrectly converted to not be Mac specific. Test Plan: Running LLDB on test/lang/c/shared_lib_stripped_symbols/a.out in a debugger I've verified LocateDSYMInVincinityOfExecutable correctly locates the matching dSYM. Differential Revision: http://reviews.llvm.org/D9896 llvm-svn: 237907
* Remove trailing slash from dumping directory FileSpec.Chaoren Lin2015-05-191-3/+4
| | | | | | | | | | | | Reviewers: domipheus, ovyalov Reviewed By: ovyalov Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9862 llvm-svn: 237741
* This patch adds support for setting/clearing hardware watchpoints and ↵Omair Javaid2015-05-151-1/+1
| | | | | | | | breakpoints on AArch64 (Arm v8) 64-bit hardware. http://reviews.llvm.org/D9706 llvm-svn: 237419
* Fixed a ton of gcc compile warningsVince Harron2015-05-132-6/+6
| | | | | | | | | | 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
* Set path syntax for remote executable FileSpec.Chaoren Lin2015-05-091-6/+10
| | | | | | | | | | Reviewers: ovyalov, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D9579 llvm-svn: 236925
* Use /data/local/tmp as temp directory on androidTamas Berghammer2015-05-081-5/+17
| | | | | | | | | | | If no temp directory specified by the user on android then fall back to /data/local/tmp what is always present on the device. It removes the dependency of specifying TMPDIR for executing platform commands on android. Differential revision: http://reviews.llvm.org/D9569 llvm-svn: 236843
OpenPOWER on IntegriCloud