summaryrefslogtreecommitdiffstats
path: root/lldb/source
Commit message (Collapse)AuthorAgeFilesLines
* Update for LLVM API rename of AttributeSet -> AttributeListReid Kleckner2017-03-211-5/+2
| | | | llvm-svn: 298399
* Replace std::ofstream with llvm::raw_fd_ostreamPavel Labath2017-03-212-7/+13
| | | | | | | | | | | | | | Summary: ofstream does not handle paths with non-ascii characters correctly on windows, so I am switching these to llvm streams to fix that. Reviewers: zturner, eugene Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D31079 llvm-svn: 298375
* Remove ProcFileReaderPavel Labath2017-03-214-167/+25
| | | | | | | This removes the last usage of ProcFileReader from NativeProcessLinux and then deletes the class itself. llvm-svn: 298374
* Resubmit r298334 after fixing OSX build errors.Zachary Turner2017-03-2111-209/+39
| | | | | | | Hopefully this works, I can't test since I don't have Mac hardware, however. llvm-svn: 298340
* Revert r298334 until Zachary has a chance to fix the buildbot failureJason Molenda2017-03-2111-39/+209
| | | | | | on macosx. llvm-svn: 298338
* Fix two places where an arm instruction emulation methodJason Molenda2017-03-211-3/+6
| | | | | | | can dereference misaligned memory. <rdar://problem/31106315>, <rdar://problem/31106337> llvm-svn: 298337
* Delete some dead code in HostInfo.Zachary Turner2017-03-215-41/+0
| | | | llvm-svn: 298335
* Delete various lldb FileSystem functions.Zachary Turner2017-03-2111-209/+39
| | | | | | | | Use LLVM's equivalent versions instead. Differential Revision: https://reviews.llvm.org/D31111 llvm-svn: 298334
* Initialize m_allow_cxx, m_allow_objc. These ivars in the base class are not Jason Molenda2017-03-211-0/+2
| | | | | | | | | initialized in the ctor and they're only initialized to 'true' in ClangUserExpression.cpp when specific languages are detected so we can use uninitialized values. This bug has been present since the ivars were added in r144042. <rdar://problem/31105864> llvm-svn: 298333
* FindTypes should find "struct TypeName" as well as "TypeName".Jim Ingham2017-03-211-1/+1
| | | | | | | | | | This fixes a bug introduced by r291559. The Module's FindType was passing the original name not the basename in the case where it didn't find any separators. I also added a testcase for this. <rdar://problem/31159173> llvm-svn: 298331
* [Support] Fill the file_status struct with link count.Zachary Turner2017-03-201-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D31110 llvm-svn: 298326
* Delete LLDB's MD5 code. Use LLVM instead.Zachary Turner2017-03-204-87/+20
| | | | | | Differential Revision: https://reviews.llvm.org/D31108 llvm-svn: 298325
* Add a function to MD5 a file's contents.Zachary Turner2017-03-202-5/+3
| | | | | | | | | | | | | | | In doing so, clean up the MD5 interface a little. Most existing users only care about the lower 8 bytes of an MD5, but for some users that care about the upper and lower, there wasn't a good interface. Furthermore, consumers of the MD5 checksum were required to handle endianness details on their own, so it seems reasonable to abstract this into a nicer interface that just gives you the right value. Differential Revision: https://reviews.llvm.org/D31105 llvm-svn: 298322
* Get ObjectFileMachO to handle @executable_pathJim Ingham2017-03-201-2/+25
| | | | | | | | | Only do this when we are debugging an executable, since we don't have a good way to trace from an ObjectFile back to its containing executable. Detecting pre-run libs before running is "best effort" in lldb, but this one is pretty easy. llvm-svn: 298290
* Fix a problem with line tables & .o files that start with code with no line ↵Jim Ingham2017-03-201-0/+8
| | | | | | | | | | | table entries. If you have code before the first line table entry when debugging with .o files on macOS, the LineTable entry search code was assigning all that code to the first line table entry. Don't do that. <rdar://problem/31095765> llvm-svn: 298289
* Fix syntax error when building with editline support.Zachary Turner2017-03-191-1/+1
| | | | llvm-svn: 298206
* Remove FileSystem::Get/SetFilePermissionsZachary Turner2017-03-194-58/+13
| | | | | | Differential Revision: https://reviews.llvm.org/D31089 llvm-svn: 298205
* Remove FileSystem::MakeDirectory.Zachary Turner2017-03-198-65/+8
| | | | | | | | Have callers use llvm::sys::fs::create_directory() instead. Differential Revision: https://reviews.llvm.org/D31086 llvm-svn: 298203
* Remove some dead code from DumpValueObjectOptions::PointerDepthTamas Berghammer2017-03-181-24/+2
| | | | llvm-svn: 298189
* Fix some signed/unsigned comparison warnings.Zachary Turner2017-03-171-4/+4
| | | | | | | Patch by Hugh Bellamy Differential Revision: https://reviews.llvm.org/D30926 llvm-svn: 298099
* Fix FreeBSD build broken by r298066Pavel Labath2017-03-171-2/+4
| | | | llvm-svn: 298069
* Move GetAuxvData from Host to relevant process pluginsPavel Labath2017-03-1711-90/+52
| | | | | | | | | | | | | | | | | | | | | | | | | Summary: GetAuxvData was causing dependencies from host to target and linux process modules. It also does not fit netbsd use case, as there we can only read the auxiliary vector with ptrace, which is better done in the process plugin, with the other ptrace calls. I resolve these issues by moving the freebsd and linux versions into the relevant process plugins. In case of linux, this required adding an interface in NativeProcessProtocol. The empty definitions on other platforms can simply be removed. To get the code compiling I had to add ProcessGdbRemote -> ProcessLinux dependency, which was not caught before because we depended on it transitively. Reviewers: zturner, emaste Subscribers: srhines, mgorny, lldb-commits Differential Revision: https://reviews.llvm.org/D31031 llvm-svn: 298066
* One more attempt to fix FreeBSDPavel Labath2017-03-171-0/+4
| | | | | | | | It seems sysctl.h is not self-contained, as I get missing symbols in the header itself now. I am going to include all files that the file I moved this from included, and hope that is enough. llvm-svn: 298063
* Speculative build fix for FreeBSDPavel Labath2017-03-171-1/+3
| | | | | | broken by r298058. llvm-svn: 298061
* Remove HostThreadLinux/Free/NetBSDPavel Labath2017-03-176-162/+42
| | | | | | | | | | | | | | | | | | | | | | Summary: These classes existed only because of the GetName() static function, which can be moved to a more natural place anyway. I move the linux version to NativeProcessLinux (and get rid of ProcFileReader), the freebsd version to ProcessFreeBSD (and fix a bug where it was using the current process ID, instead of the inferior pid), and remove the NetBSD version (which was probably incorrect anyway, as it assumes the current process instead of the inferior. I also add an llgs test to that verifies thread names are read correctly. Reviewers: zturner, krytarowski, emaste Subscribers: lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30981 llvm-svn: 298058
* Update for LLVM API removal of Function::getArgumentList()Reid Kleckner2017-03-162-7/+6
| | | | llvm-svn: 298011
* [Support] Support both Windows and Posix paths on both platforms.Zachary Turner2017-03-162-5/+5
| | | | | | | | | | | | | | | | | | Previously which path syntax we supported dependend on what platform we were compiling LLVM on. While this is normally desirable, there are situations where we need to be able to handle a path that we know was generated on a remote host. Remote debugging, for example, or parsing debug info. 99% of the code in LLVM for handling paths was platform agnostic and literally just a few branches were gated behind pre-processor checks, so this changes those sites to use runtime checks instead, and adds a flag to every path API that allows one to override the host native syntax. Differential Revision: https://reviews.llvm.org/D30858 llvm-svn: 298004
* Remove some ProcFileReader occurencesPavel Labath2017-03-153-227/+205
| | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: ProcFileReader is the cause of the dependency from Host to ProcessLinux module. Since it's interface is also obsolete (ReadIntoDataBuffer is trivially replaceable by llvm::MemoryBuffer functions and ProcessLineByLine is trivially implementable with StringRefs), instead of moving it around I'm planning to obliterate it. This is the first step, where I remove a couple of occurences in linux/Host.cpp, and modernize some code around that. I have introduced linux/Support.h, which holds two utility functions now, whose resposibility is to construct the appropriate proc file names -- the only useful feature of ProcFileReader. I add a couple of tests for these functions, and for Host::GetProcessInfo. It's worth noting that these are the first host-specific unit tests in lldb. Reviewers: zturner, eugene Subscribers: srhines, lldb-commits, mgorny Differential Revision: https://reviews.llvm.org/D30942 llvm-svn: 297843
* Fix windows&darwin builds broken by r297812Pavel Labath2017-03-152-2/+0
| | | | llvm-svn: 297819
* BreakpointResolverFileLine: Restrict move-to-nearest-code from moving across ↵Pavel Labath2017-03-151-16/+77
| | | | | | | | | | | | | | | | | | | | | | | | | function boundaries Summary: This fixes the case where a user tries to set a breakpoint on a source line outside of any function (e.g. because that code is #ifdefed out, or the compiler did not emit code for the function, etc.) and we would silently move the breakpoint to the next function. Now we check whether the line range of the resolved symbol context function matches the original line number. We reject any breakpoint locations that appear to move the breakpoint into a new function. This filtering only happens if we have full debug info available (e.g. in case of -gline-tables-only compilation, we still set the breakpoint on the nearest source line). Reviewers: jingham Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30817 llvm-svn: 297817
* Remove lldb streams from the Log class completelyPavel Labath2017-03-159-46/+47
| | | | | | | | | | | | | | | | | | | | | Summary: previously we switched to llvm streams for log output, this completes the switch for the error streams. I also clean up the includes and remove the unused argument from DisableAllLogChannels(). This required adding a bit of boiler plate to convert the output in the command interpreter, but that should go away when we switch command results to use llvm streams as well. Reviewers: zturner, eugene Subscribers: lldb-commits, emaste Differential Revision: https://reviews.llvm.org/D30894 llvm-svn: 297812
* Fix up some enumerate() callsites in LLDB.Zachary Turner2017-03-135-15/+15
| | | | llvm-svn: 297640
* Fix another occurrence of needing to use member accessors.Zachary Turner2017-03-131-2/+2
| | | | llvm-svn: 297637
* Delete dead code. NFCJonathan Roelofs2017-03-131-11/+0
| | | | | | | | Also has the side-effect of fixing the build on systems with glibc < 2.12 https://reviews.llvm.org/D30844 llvm-svn: 297626
* Fix windows build broken by r297612Pavel Labath2017-03-131-1/+1
| | | | | | I have got my boolean logic incorrect. Sorry about the spam. llvm-svn: 297615
* Fix android buildPavel Labath2017-03-132-2/+2
| | | | | | | | | | | | | | getpwent is not available on android until API level 21, and even then it is only available when doing a non-static link. Since android's concept of users is very different from linux, it's doubtful the home directory resolution would be useful, so I approximate this state by just not using getpwent on android. We've had another getpwent occurance in FileSpec for a while -- it wasn't causing problems because it was stripped out by the linker, but I disable that also, for consistency's sake. llvm-svn: 297612
* Fix Linux build for the FileSpec changesPavel Labath2017-03-132-6/+4
| | | | | | | Propagate changes that were made during review, and fix a couple of warnings while I'm in there. llvm-svn: 297609
* Use LLVM for file / directory enumeration.Zachary Turner2017-03-133-245/+42
| | | | | | | | | | FileSpec::EnumerateDirectory has a bunch of platform-specific gunk in it for posix and non-posix platforms. We can get rid of all this by using LLVM's easy-to-use directory iterators. Differential Revision: https://reviews.llvm.org/D30807 llvm-svn: 297598
* Resubmit "Make file / directory completion work properly on Windows."Zachary Turner2017-03-133-166/+199
| | | | | | This fixes the compilation failures with the original patch. llvm-svn: 297597
* Revert "Make file / directory completion work properly on Windows."Zachary Turner2017-03-123-199/+166
| | | | | | | | | This reverts commit a6a29374662716710f80c8ece96629751697841e. It has a few compilation failures that I don't have time to fix at the moment. llvm-svn: 297589
* Make file / directory completion work properly on Windows.Zachary Turner2017-03-123-166/+199
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were a couple of problems with this function on Windows. Different separators and differences in how tilde expressions are resolved for starters, but in addition there was no clear indication of what the function's inputs or outputs were supposed to be, and there were no tests to demonstrate its use. To more easily paper over the differences between Windows paths, non-Windows paths, and tilde expressions, I've ported this function to use LLVM-based directory iteration (in fact, I would like to eliminate all of LLDB's directory iteration code entirely since LLVM's is cleaner / more efficient (i.e. it invokes fewer stat calls)). and llvm's portable path manipulation library. Since file and directory completion assumes you are referring to files and directories on your local machine, it's safe to assume the path syntax properties of the host in doing so, so LLVM's APIs are perfect for this. I've also added a fairly robust set of unit tests. Since you can't really predict what users will be on your machine, or what their home directories will be, I added an interface called TildeExpressionResolver, and in the unit test I've mocked up a fake implementation that acts like a unix password database. This allows us to configure some fake users and home directories in the test, so we can exercise all of those hard-to-test codepaths that normally otherwise depend on the host. Differential Revision: https://reviews.llvm.org/D30789 llvm-svn: 297585
* Simplify & correct the patch I wrote in r297441, after thinkingJason Molenda2017-03-101-12/+12
| | | | | | | | about this more I realized I could make the change isolated to whether we decide an empty accelerator table is valid or not. <rdar://problem/30867462> llvm-svn: 297496
* Add a distinction in an apple accelerator table between IsValid andJason Molenda2017-03-101-12/+12
| | | | | | | | | HasContent. If we have a valid accelerator table which has no content, we want to depend on that (empty) table as the authoritative source instead of reading through all the debug info for lookups. <rdar://problem/30867462> llvm-svn: 297441
* cmake: Increase LINK_INTERFACE_MULTIPLICITY of lldbCorePavel Labath2017-03-091-1/+1
| | | | | | | | | | | | This is necessary to get debug builds of unit tests working on linux. I think we are at a point where removing dependencies does not prevent us from depending on the whole world yet. What it does do though, is make the dependency chains longer as the dependency graph gets sparser, which means we need to repeat the libraries more times to get the thing to link. llvm-svn: 297369
* Fix remaining threading issues in Log.hPavel Labath2017-03-091-75/+47
| | | | | | | | | | | | | | | | | | | | | | | | Summary: This fixes two threading issues in the logging code. The access to the mask and options flags had data races when we were trying to enable/disable logging while another thread was writing to the log. Since we can log from almost any context, and we want it to be fast, so I avoided locking primitives and used atomic variables instead. I have also removed the (unused) setters for the mask and flags to make sure that the only way to set them is through the enable/disable channel functions. I also add tests, which when run under tsan, verify that the use cases like "doing an LLDB_LOGV while another thread disables logging" are data-race-free. Reviewers: zturner, clayborg Subscribers: lldb-commits Differential Revision: https://reviews.llvm.org/D30702 llvm-svn: 297368
* Remove LLDB's recursive directory deletion function.Zachary Turner2017-03-094-88/+2
| | | | | | LLVM now has such a function, so we use that instead. llvm-svn: 297360
* Resubmit FileSystem changes.Zachary Turner2017-03-0838-267/+262
| | | | | | | | | | This was originall reverted due to some test failures in ModuleCache and TestCompDirSymlink. These issues have all been resolved and the code now passes all tests. Differential Revision: https://reviews.llvm.org/D30698 llvm-svn: 297300
* Make LLDB skip server-client roundtrip for signals that don't require any ↵Eugene Zemtsov2017-03-076-1/+133
| | | | | | | | | | | | | | actions If QPassSignals packaet is supported by lldb-server, lldb-client will utilize it and ask the server to ignore signals that don't require stops or notifications. Such signals will be immediately re-injected into inferior to continue normal execution. Differential Revision: https://reviews.llvm.org/D30520 llvm-svn: 297231
* Revert "Use LLVM for all stat-related functionality."Pavel Labath2017-03-0737-257/+259
| | | | | | | | | | | | | | | this reverts r297116 because it breaks the unittests and TestCompDirSymlink. The ModuleCache unit test is trivially fixable, but the CompDirSymlink failure is a symptom of a deeper problem: llvm's stat functionality is not a drop-in replacement for lldb's. The former is based on stat(2) (which does symlink resolution), while the latter is based on lstat(2) (which does not). This also reverts subsequent build fixes (r297128, r297120, 297117) and r297119 (Remove FileSpec dependency on FileSystem) which builds on top of this. llvm-svn: 297139
* Fixed a missing brace.Sean Callanan2017-03-071-1/+1
| | | | llvm-svn: 297128
OpenPOWER on IntegriCloud