summaryrefslogtreecommitdiffstats
path: root/lldb/source/Host/common
Commit message (Collapse)AuthorAgeFilesLines
...
* Use file locks to synchronize access to ModuleCache.Oleksiy Vyalov2015-05-071-0/+124
| | | | | | http://reviews.llvm.org/D9056 llvm-svn: 236736
* Make sure that the following paths say they are equal:Greg Clayton2015-05-051-0/+2
| | | | | | | | | | | /private/tmp/main.cpp /private/tmp/..//tmp/main.cpp We saw paths like this in makefile generate binaries when someone left an extra '/' on the end of a makefile variable. <rdar://problem/18945972> llvm-svn: 236541
* Fixed some compiler warnings because of bit-width mismatches.Chaoren Lin2015-05-011-3/+6
| | | | llvm-svn: 236323
* Fixed some compiler warnings because of bit-widthSean Callanan2015-05-011-3/+3
| | | | | | mismatches. llvm-svn: 236295
* Remove trap code from disassembly.Chaoren Lin2015-04-293-24/+50
| | | | | | | | | | | | | | | | | | | | 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
* Look for both .debug and dsym debugging symbol information for stripped ↵Robert Flack2015-04-241-89/+203
| | | | | | | | | | | | | | | | | executable. Currently Symbols::LocateExecutableSymbolFile on MacOSX only looks for external dsym debugging information, however if running on a stripped dwarf executable it should also check for a .debug file as well. Test Plan: ./dotest.py $DOTEST_OPTS -t -p TestSharedLibStrippedSymbols.py This test now passes when running a remote Mac -> Linux test, and still passes running locally on Mac or locally on Linux. Differential Revision: http://reviews.llvm.org/D9174 llvm-svn: 235737
* Fix a bug where argdumper would not launch inferiors correctly in the ↵Enrico Granata2015-04-171-11/+21
| | | | | | | | presence of arguments of the form word1\ word2 (vs. the quoted form "word1 word2") Fixes rdar://20493444 llvm-svn: 235157
* Wrap socket error handling with SetLastError and IsInterrupted internal ↵Oleksiy Vyalov2015-04-101-32/+38
| | | | | | | | functions which can properly treat Windows and POSIX errors. http://reviews.llvm.org/D8939 llvm-svn: 234559
* [Python] Fix issue configuring sys.path during startup.Zachary Turner2015-04-091-7/+13
| | | | | | | | | | Previously, users on Windows had to manually specify PYTHONPATH to point to the site-packages directory before running LLDB. The reason for this was because sys.path was being initialized with a path containing unescaped backslashes, causing escape sequences to end up in the paths. llvm-svn: 234516
* Missed moving a variable during my previous revision 234455.Greg Clayton2015-04-091-1/+2
| | | | llvm-svn: 234456
* Darwin read()/pread()/fread() and write()/pwrite()/fwrite() calls can only ↵Greg Clayton2015-04-091-5/+142
| | | | | | | | | | write INT_MAX bytes at a time. Modify all read/write calls to allow any system to define MAX_READ_SIZE or MAX_WRITE_SIZE so large reads and writes can be divided up correctly. <rdar://problem/20471411> llvm-svn: 234455
* Fix warnings generated by clang-cl.Zachary Turner2015-04-023-9/+6
| | | | | | | | | | | | | | 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
* Increate backlog of lldb-platform's listener socketVince Harron2015-03-311-2/+7
| | | | | | | | | | | | | | | lldb-platform's listener socket only had a backlog of one connection. That means that if more than one client connected simultaneously, the connection would be refused. The test suite can be run remotely with dozens of threads connecting simultaneously. Raised this limit to 100 to effectively eliminate lost connections. Test Plan: run tests against a remote target Differential Revision: http://reviews.llvm.org/D8696 llvm-svn: 233652
* ComputeSupportExeDirectory for LinuxChaoren Lin2015-03-241-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Fixes http://reviews.llvm.org/D8511 The original method of using dladdr() could return the incorrect relative path if not dynamically linked against liblldb and the working directory has changed. This is not a problem when built with python, since ScriptInterpreterPython::InitializePrivate calls HostInfo::GetLLDBPath(ePathTypeLLDBShlibDir, ...) and caches the correct path before any changes to the working directory. The /proc/self/exe approach fails if run using Python, but works for all other cases (including for android, which doesn't have dladdr()). So if we combine the two, we should reasonably cover all corner cases. Reviewers: vharron, ovyalov, clayborg Reviewed By: ovyalov, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D8570 llvm-svn: 233129
* Report watchpoint hits during single stepping.Chaoren Lin2015-03-191-2/+11
| | | | | | | | | | | | | | | | | | Summary: Reorganized NativeProcessLinux::MonitorSIGTRAP to check for watchpoint hits on TRAP_TRACE. Added test for stepping over watchpoints. https://llvm.org/bugs/show_bug.cgi?id=22814 Reviewers: ovyalov, tberghammer, vharron, clayborg Subscribers: jingham, labath, lldb-commits Differential Revision: http://reviews.llvm.org/D8404 llvm-svn: 232784
* Move LLDB initialization/shutdown to Initialization.Zachary Turner2015-03-191-5/+0
| | | | | | | | | | | | | | | | This creates a new top-level folder called Initialization which is intended to hold code specific to LLDB system initialization. Currently this holds the Initialize() and Terminate() functions, as well as the fatal error handler. This provides a means to break the massive dependency cycle which is caused by the fact that Debugger depends on Initialize and Terminate which then depends on the entire LLDB project. With this structure, it will be possible for applications to invoke lldb_private::Initialize() directly, and have that invoke Debugger::Initialize. llvm-svn: 232768
* Move lldb-log.cpp to core/Logging.cppZachary Turner2015-03-181-2/+0
| | | | | | | | | So that we don't have to update every single #include in the entire codebase to #include this new header (which used to get included by lldb-private-log.h, we automatically #include "Logging.h" from within "Log.h". llvm-svn: 232653
* Report stopped by trace if none of the watchpoint was hitTamas Berghammer2015-03-171-0/+18
| | | | | | | | | | Some linux kernel reports a watchpoint hit after single stepping even when no watchpoint was hit. This CL looks for a watchpoint which was hit and reports a stop by trace if it haven't found any. Differential revision: http://reviews.llvm.org/D8081 llvm-svn: 232482
* [MIPS] - Register Context for MIPS64Mohit K. Bhakkad2015-03-171-0/+1
| | | | | | | | | | | | | | | | Patch by Jaydeep Patil Summery: 1. Add MIPS variants by parsing e_flags of the ELF 2. Create RegisterInfoInterface and RegisterContext for MIPS64 and MIPS64EL Reviewers: clayborg Subscribers: tberghammer, bhushan, mohit.bhakkad, sagar Differential Revision: http://reviews.llvm.org/D8166 llvm-svn: 232467
* Add code to exit the NativeProcessLinux Monitor thread on androidTamas Berghammer2015-03-131-10/+43
| | | | | | | | | | This CL change the logic used to terminate the monitor thread of NativeProcessLinux to use a signal instead of pthread_cancel as pthread_cancel is not supported on android. Differential revision: http://reviews.llvm.org/D8205 llvm-svn: 232155
* Add Utility/ModuleCache class and integrate it with PlatformGDBRemoteServer ↵Oleksiy Vyalov2015-03-101-17/+45
| | | | | | | | - in order to allow modules caching from remote targets. http://reviews.llvm.org/D8037 llvm-svn: 231734
* Remove Host::Backtrace in favor of llvm::sys::PrintStackTrace()Zachary Turner2015-03-061-6/+0
| | | | | | | | | | | | This removes Host::Backtrace from the codebase, and changes all call sites to use llvm::sys::PrintStackTrace(). This makes the functionality available for all platforms, and even for platforms which currently had a supported implementation of Host::Backtrace, this patch should enable richer information in stack traces, such as file and line number information, as well as giving it the ability to unwind through inlined functions. llvm-svn: 231511
* Don't #include ClangASTContext.h from Module.hZachary Turner2015-03-031-0/+2
| | | | | | | | | | | | This is part of a larger effort to reduce header file footprints. Combined, these patches reduce the build time of LLDB locally by over 30%. However, they touch many files and make many changes, so will be submitted in small incremental pieces. Reviewed By: Greg Clayton Differential Revision: http://reviews.llvm.org/D8022 llvm-svn: 231097
* Fix FileSpec::GetPath to return null-terminated stringsIlia K2015-02-272-8/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: Before this fix the FileSpec::GetPath() returned string which might be without '\0' at the end. It could have happened if the size of buffer for path was less than actual path. Test case: ``` FileSpec test("/path/to/file", false); char buf[]="!!!!!!"; test.GetPath(buf, 3); ``` Before fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/pa!!!" ``` After fix: ``` 233 FileSpec test("/path/to/file", false); 234 char buf[]="!!!!!!"; 235 test.GetPath(buf, 3); 236 -> 237 if (core_file) 238 { 239 if (!core_file.Exists()) 240 { (lldb) print buf (char [7]) $0 = "/p" ``` Reviewers: zturner, abidh, clayborg Reviewed By: abidh, clayborg Subscribers: tberghammer, vharron, lldb-commits, clayborg, zturner, abidh Differential Revision: http://reviews.llvm.org/D7553 llvm-svn: 230787
* Use getProcessTriple inside HostInfoBase::ComputeHostArchitectureSupport ↵Oleksiy Vyalov2015-02-261-1/+1
| | | | | | | | instead of getDefaultTargetTriple. http://reviews.llvm.org/D7893 llvm-svn: 230674
* Add qModuleInfo request in order to get module information (uuid, triple,..) ↵Oleksiy Vyalov2015-02-251-4/+35
| | | | | | | | by module path from remote platform. http://reviews.llvm.org/D7709 llvm-svn: 230556
* Revert "Fix warnings found with clang-cl."Zachary Turner2015-02-253-6/+8
| | | | | | | SWIG doesn't like enum : unsigned. Revert this until I can fix this in a way that swig likes. llvm-svn: 230531
* Fix warnings found with clang-cl.Zachary Turner2015-02-253-8/+6
| | | | | | | | | | | Earlier this week I was able to get clang-cl on Windows to be able to self host. This opened the door to being able to get a whole new slew of warnings for the Windows build. This patch fixes all of the warnings, many of which were real bugs. llvm-svn: 230522
* Skip symlinks to the original file when searching for debug infoPavel Labath2015-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | Summary: Symbols::LocateExecutableSymbolFile tries to locate the file in containing the debug info in a splitdebug configuration. It tries to skip over the original file in its search path, but it was easily fooled by symlinks. This changes the function to use llvm::sys::fs::equivalent, which can correctly compare symlinks. As a side effect, I had to fix one test because the address for the "abort" function resolves on my system to "__GI_abort" now. With the debug info, the libc on my system contains two symbols associated with the address of the abort function, and lldb prefers __GI_abort, possibly because the debug info is associated with it. It would be nice at some point to have it prefer the public symbol name. Reviewers: emaste, zturner Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7836 llvm-svn: 230476
* When FileSpec::Resolve is given a bare file like "ls",Jason Molenda2015-02-251-0/+13
| | | | | | | | | | | and llvm::sys::fs::make_absolute prepends the current working directory to that path, leave the original bare file name unchanged if $cwd/ls doesn't exist. http://reviews.llvm.org/D7477 <rdar://problem/18775190> llvm-svn: 230451
* Avoid crashing by not mmap'ing files on network mounted file systems.Greg Clayton2015-02-231-0/+9
| | | | | | | | | | | | | | | | | | | | This is implemented by making a new FileSystem function: bool FileSystem::IsLocal(const FileSpec &spec) Then using this in a new function: DataBufferSP FileSpec::MemoryMapFileContentsIfLocal(off_t file_offset, size_t file_size) const; This function only mmaps data if the file is a local file since that means we can reliably page in data. We were experiencing crashes where people would use debug info files on network mounted file systems and that mount would go away and cause the next access to a page that wasn't paged in to crash LLDB. We now avoid this by just copying the data into a heap buffer and keeping a permanent copy to avoid the crash. Updated all previous users of FileSpec::MemoryMapFileContentsIfLocal() in ObjectFile subclasses over to use the new FileSpec::MemoryMapFileContentsIfLocal() function. <rdar://problem/19470249> llvm-svn: 230283
* Introduce FileSystem::CalculateMD5AsString that supports any platform and ↵Oleksiy Vyalov2015-02-201-0/+72
| | | | | | | | make existing FileSystem::CalculateMD5 to use it. http://reviews.llvm.org/D7771 llvm-svn: 230036
* Prevent LLGS from crashing when exiting - make NativeProcessLinux to wait ↵Oleksiy Vyalov2015-02-191-0/+6
| | | | | | | | until ThreadStateCoordinator is fully stopped before entering ~NativeProcessLinux. http://reviews.llvm.org/D7692 llvm-svn: 229875
* Create new platform: remote-androidTamas Berghammer2015-02-121-15/+7
| | | | | | | | | | * Create new platform plugin for lldb * Create HostInfo class for android * Create ProcessLauncher for android Differential Revision: http://reviews.llvm.org/D7584 llvm-svn: 228943
* Cast EOF to get a proper comparison.Justin Hibbits2015-02-121-1/+1
| | | | | | | | On PowerPC, and maybe some other architectures, 'char' is unsigned. Comparing an unsigned char with a signed int (-1) is always false. To fix this, down-cast EOF to a char. llvm-svn: 228909
* Fix Mingw build.Hafiz Abid Qadeer2015-02-111-1/+4
| | | | | | | | | | | | | Following changes are done. Add missing headers. Replace _snprintf with snprintf. It is already changed to _snprintf for MSVC. Add a file in the build for autoconf. Call DynamicLoaderWindows::Terminate and DynamicLoaderWindows::Initialize only for MSVC build. Reviewed in http://reviews.llvm.org/D7536. llvm-svn: 228822
* Fix the LLDB build under Debian KfreebsdSylvestre Ledru2015-02-101-1/+1
| | | | | | | | | | | | | | Summary: I don't know if there is a better way for the change in source/Host/freebsd/ThisThread.cpp Reviewers: emaste Subscribers: hansw, emaste, lldb-commits Differential Revision: http://reviews.llvm.org/D7441 llvm-svn: 228710
* Fix sorting. Spotted by emaste.Justin Hibbits2015-02-081-1/+1
| | | | llvm-svn: 228549
* PowerPC64 host also supports 32-bit binaries, so note it.Justin Hibbits2015-02-081-1/+1
| | | | llvm-svn: 228548
* Fix a handling of full path in break-insert.Hafiz Abid Qadeer2015-02-081-0/+6
| | | | | | | | | | | | | | | | | | | | For some time, eclipse (CDT) uses full path of the file in break-insert command when putting breakpoint on a source line. On windows, a typical command looks like the following. 56-break-insert -f F:\\work\\ws\\test\\main.c:49 Current implementation in lldb-mi have problem in 2 ways. 1. It was assuming that there will be only one : in the path which is wrong if full path is supplied. 2. CDT sends out path with double backslashes in windows which gives error on resolution. Fixed the : issue in lldb-mi. Changed FileSpec::Normalize to make sure that it handles the path with \\ correctly. Added test cases to check for full path in both lldb-mi and lldb. Also added a test case to check SBFileSpec with double slashes. llvm-svn: 228538
* Fix TestThreadSpecificBreakpoint with LLGSTamas Berghammer2015-02-061-0/+4
| | | | | | | | | | | * Set the state of the process into running/stepping on continue/step operations * Add mutex to use transactions in Thread State Coordinator ** It is required because the events from two Signal Handler or form a Signal handler and a Resume request shouldn't overlap * Send Stop Replay Packet only when the state of the process changed Differential Revision: http://reviews.llvm.org/D7374 llvm-svn: 228387
* Avoid leaking log file descriptors into the inferior process.Pavel Labath2015-02-051-0/+2
| | | | | | | | | | | | | | Summary: This commit adds a new open flag File::eOpenOptionCloseOnExec (i.e., O_CLOEXEC), and adds it to the list of flags when opening log files (#ifndef windows). A regression test is included. Reviewers: vharron, clayborg Subscribers: lldb-commits Differential Revision: http://reviews.llvm.org/D7412 llvm-svn: 228310
* Fixed bugs in the multi-threaded access in HostInfoBase. Prior to this fix, ↵Greg Clayton2015-02-031-108/+159
| | | | | | | | | | static bool variables were used but this is not sufficient. We now use std::call_once in all places where the previous static bool code was used to try to implement thread safety. This was causing code that opened multiple targets to try and get a path to debugserver from the GDB remote communication class, and it would get the LLDB path and some instances would return empty strings and it would cause debugserver to not be found. <rdar://problem/18756927> llvm-svn: 227935
* Implement setting and clearing watchpoints.Chaoren Lin2015-02-033-8/+51
| | | | llvm-svn: 227930
* Moving header files from source/Host/common to proper location.Chaoren Lin2015-02-0312-609/+533
| | | | llvm-svn: 227929
* Share crash information between LLGS and local POSIX debugging withChaoren Lin2015-02-032-26/+1
| | | | | | | CrashReason class. Deliver crash information from LLGS to lldb via description field of thread stop packet. llvm-svn: 227926
* If lldb is being built with ASAN instrumentation, have lldbJason Molenda2015-01-291-0/+10
| | | | | | | | create its own threads with 8MB additional maximum stack size. Extra room is needed for the bookkeeping needed for this instrumentation. llvm-svn: 227421
* Fix copy paste error in file header.Chaoren Lin2015-01-271-1/+1
| | | | llvm-svn: 227222
* fixed up some logging messages (options and wait_pid were swapped)Vince Harron2015-01-231-3/+3
| | | | llvm-svn: 226956
* Workaround for what looks like an OS X-specific libedit issueKate Stone2015-01-231-0/+21
| | | | | | | | | | | Other platforms may benefit from something similar if issues arise. The libedit library doesn't explicitly initialize the curses termcap library, which it gets away with until TERM is set to VT100 where it stumbles over an implementation assumption that may not exist on other platforms. <rdar://problem/17581929> llvm-svn: 226891
OpenPOWER on IntegriCloud