Commit Graph

16004 Commits

Author SHA1 Message Date
Zachary Turner ed44af6c61 Fix build broken by StringList move.
llvm-svn: 298419
2017-03-21 18:45:42 +00:00
Zachary Turner 573ab909d3 Move StringList from Core -> Utility.
llvm-svn: 298412
2017-03-21 18:25:04 +00:00
Kamil Rytarowski a1e3d08666 Create instance of DynamicLoaderPOSIXDYLD on NetBSD
Summary:
NetBSD is a modern ELF UNIX-like system.

There is requires DynamicLoaderPOSIXDYLD e.g. for ELF AUXV reading from the client.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg, kettenis

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31192

llvm-svn: 298409
2017-03-21 17:39:15 +00:00
Kamil Rytarowski 1a3d19dd25 Add stub for PluginProcessNetBSD
Summary:
This is the base for introduction of further features to support Process Tracing on NetBSD, in local and remote setup.

This code is also a starting point to synchronize the development with other BSDs. Currently NetBSD is ahead and other systems can catch up.

Sponsored by <The NetBSD Foundation>

Reviewers: emaste, joerg, kettenis, labath

Reviewed By: labath

Subscribers: mgorny, #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31138

llvm-svn: 298408
2017-03-21 17:30:47 +00:00
Kamil Rytarowski c93408a6ab Enable AUXV and QPassSignals in gdb-remote for NetBSD
Summary:
NetBSD is an ELF platform and it uses Elf Auxiliary Vector like Linux and other modern BSDs.

While there enable QPassSignals for the NetBSD port as well.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, kettenis, joerg, emaste

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31146

llvm-svn: 298407
2017-03-21 17:27:59 +00:00
Kamil Rytarowski a87101d6a7 Enable ProcessPOSIXLog on NetBSD
Summary:
NetBSD can share the same logging functionality with Linux and FreeBSD.

Sponsored by <The NetBSD Foundation>


Reviewers: labath, emaste, joerg, kettenis

Reviewed By: labath, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31191

llvm-svn: 298406
2017-03-21 17:26:55 +00:00
Kamil Rytarowski 750228a6a7 Add NetBSD case in Entry::Type::ThreadID
Summary:
NetBSD native threads are printed as 64-bit unsigned integers.

The underlying system type of a thread identity is lwpid_t of type int32_t. For consistency with Linux and FreeBSD share the 64-bit unsigned integer type.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, kettenis, joerg, emaste

Reviewed By: labath, emaste

Subscribers: #lldb

Tags: #lldb

Differential Revision: https://reviews.llvm.org/D31132

llvm-svn: 298405
2017-03-21 17:25:47 +00:00
Reid Kleckner f76a8ac5a9 Remove stray paren that got in while attempting to fix the build for AttributeList
llvm-svn: 298402
2017-03-21 17:15:50 +00:00
Reid Kleckner a3e3715c3e Update for LLVM API rename of AttributeSet -> AttributeList
llvm-svn: 298399
2017-03-21 17:09:20 +00:00
Pavel Labath e3ad2e2e73 Replace std::ofstream with llvm::raw_fd_ostream
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
2017-03-21 13:49:50 +00:00
Pavel Labath 1593086232 Remove ProcFileReader
This removes the last usage of ProcFileReader from NativeProcessLinux
and then deletes the class itself.

llvm-svn: 298374
2017-03-21 13:49:45 +00:00
Zachary Turner 07db3f7e3f Resubmit r298334 after fixing OSX build errors.
Hopefully this works, I can't test since I don't have Mac
hardware, however.

llvm-svn: 298340
2017-03-21 05:47:57 +00:00
Jason Molenda 2eb3227f97 Revert r298334 until Zachary has a chance to fix the buildbot failure
on macosx.

llvm-svn: 298338
2017-03-21 04:45:10 +00:00
Jason Molenda 3724ae4e70 Fix two places where an arm instruction emulation method
can dereference misaligned memory.  
<rdar://problem/31106315>, <rdar://problem/31106337>

llvm-svn: 298337
2017-03-21 04:34:17 +00:00
Zachary Turner d9b368526b Delete some dead code in HostInfo.
llvm-svn: 298335
2017-03-21 04:01:59 +00:00
Zachary Turner bfe8bcbc43 Delete various lldb FileSystem functions.
Use LLVM's equivalent versions instead.

Differential Revision: https://reviews.llvm.org/D31111

llvm-svn: 298334
2017-03-21 04:01:04 +00:00
Jason Molenda ab2dae0a9c Initialize m_allow_cxx, m_allow_objc. These ivars in the base class are not
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
2017-03-21 02:59:15 +00:00
Jim Ingham 9a4bce70fa FindTypes should find "struct TypeName" as well as "TypeName".
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
2017-03-21 02:13:50 +00:00
Zachary Turner 5821a3bf36 [Support] Fill the file_status struct with link count.
Differential Revision: https://reviews.llvm.org/D31110

llvm-svn: 298326
2017-03-20 23:55:20 +00:00
Zachary Turner 076a259938 Delete LLDB's MD5 code. Use LLVM instead.
Differential Revision: https://reviews.llvm.org/D31108

llvm-svn: 298325
2017-03-20 23:54:54 +00:00
Zachary Turner 7e3050ca1a [analyze-project-deps.py] Add the ability to list all cycles.
This analyzes the dependency graph and computes all minimal
cycles.  Equivalent cycles that differ only by rotation are
excluded, as are cycles that are "super-cycles" of other
smaller cycles.  For example, if we discover the cycle
A -> C -> A, and then later A -> B -> C -> D -> A, this latter
cycle is not considered.  Thus, it is possible that after
eliminating some cycles, new ones will appear.  However,
this is the only way to make the algorithm terminate in
a reasonable amount of time.

llvm-svn: 298324
2017-03-20 23:54:26 +00:00
Zachary Turner 82a0c97b32 Add a function to MD5 a file's contents.
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
2017-03-20 23:33:18 +00:00
Jim Ingham 1aa0ed4e0d Get ObjectFileMachO to handle @executable_path
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
2017-03-20 19:21:31 +00:00
Jim Ingham 2dc4a3e91b Fix a problem with line tables & .o files that start with code with no line 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
2017-03-20 19:19:03 +00:00
Pavel Labath 6b42b3b7a3 Fix remote test suite directory creation
r298203 make SBPlatform::MakeDirectory less recursive, which breaks the
test suite creation of test directory hierarchy creation on the remote
target. Since the function was never fully recursive, and the name does
not imply recursiveness, I fix the problem by modifying the test runner
to do the recursion manually.

I also make the runner complain more loudly when it fails to create the
directory -- previously it just printed the error to stdout and caused
most of the tests to hang, which is not very helpful in diagnosing the
problem.

llvm-svn: 298261
2017-03-20 16:07:17 +00:00
Zachary Turner 6c8255e831 Fix syntax error when building with editline support.
llvm-svn: 298206
2017-03-19 06:00:31 +00:00
Zachary Turner 6934e0aaa7 Remove FileSystem::Get/SetFilePermissions
Differential Revision: https://reviews.llvm.org/D31089

llvm-svn: 298205
2017-03-19 05:49:43 +00:00
Zachary Turner d3d95fd66a Remove FileSystem::MakeDirectory.
Have callers use llvm::sys::fs::create_directory() instead.

Differential Revision: https://reviews.llvm.org/D31086

llvm-svn: 298203
2017-03-19 05:48:47 +00:00
Zachary Turner c8c9f97258 Fix unit test compilation failure.
llvm-svn: 298202
2017-03-19 05:48:01 +00:00
Tamas Berghammer e4e17b8ce4 Remove some dead code from DumpValueObjectOptions::PointerDepth
llvm-svn: 298189
2017-03-18 17:33:00 +00:00
Tim Hammerquist f73c6c7e84 allow for specification of compiler/lldb executables basename
llvm-svn: 298123
2017-03-17 21:00:35 +00:00
Tim Hammerquist 848582181e executables should be validated before spawning subprocesses
dotest.py script doesn't validate executables passed on the command line
before spawning dozens of subprocesses, all of which fail silently,
leaving an empty results file.

We should validate the lldb and compiler executables on
configuration, aborting when given invalid paths, to prevent numerous,
cryptic, and spurious failures.

<rdar://problem/31117272>

llvm-svn: 298111
2017-03-17 18:10:58 +00:00
Zachary Turner f98dec1c53 CMake requires normalized paths when appending.
Patch by Hugh Bellamy
Differential Revision: https://reviews.llvm.org/D30927

llvm-svn: 298100
2017-03-17 16:33:37 +00:00
Zachary Turner e28558f0b0 Fix some signed/unsigned comparison warnings.
Patch by Hugh Bellamy
Differential Revision: https://reviews.llvm.org/D30926

llvm-svn: 298099
2017-03-17 16:32:43 +00:00
Pavel Labath 5b116232ef Fix FreeBSD build broken by r298066
llvm-svn: 298069
2017-03-17 11:33:57 +00:00
Pavel Labath b7f0f45ffe Move GetAuxvData from Host to relevant process plugins
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
2017-03-17 11:08:40 +00:00
Pavel Labath 1495663bc4 One more attempt to fix FreeBSD
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
2017-03-17 10:30:42 +00:00
Pavel Labath 872305e95c Speculative build fix for FreeBSD
broken by r298058.

llvm-svn: 298061
2017-03-17 10:09:56 +00:00
Pavel Labath 225b79524d Remove HostThreadLinux/Free/NetBSD
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
2017-03-17 09:51:23 +00:00
Reid Kleckner 20670ba52c Update for LLVM API removal of Function::getArgumentList()
llvm-svn: 298011
2017-03-16 23:13:49 +00:00
Zachary Turner 5c5091fcb7 [Support] Support both Windows and Posix paths on both platforms.
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
2017-03-16 22:28:04 +00:00
Chris Bieneman 1936585789 [debugserver] NFC. One more small cleanup to DNBArchImplX86_64::SetFPUState
This is another similar cleanup to other changes I've been making to simplify the AVX code in debugserver.

llvm-svn: 297880
2017-03-15 19:52:57 +00:00
Pavel Labath 7e437f8f39 Remove some ProcFileReader occurences
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
2017-03-15 15:08:49 +00:00
Pavel Labath 2aaab29574 Fix TestMoveNearest for remote targets
Launching a process with shared libraries on remote targets requires a
special dance, which I forgot to do in r297830.

llvm-svn: 297834
2017-03-15 13:32:17 +00:00
Pavel Labath 32a8b7c3a7 Fix TestMoveNearest breakage on darwin
It seems that on darwin we are not able to resolve breakpoints in the
test shared library until the process has started. That seems
unfortunate, but it is not the purpose of this test, so work around that
by starting the process before doing the rest of our checks.

llvm-svn: 297830
2017-03-15 12:32:18 +00:00
Pavel Labath c179662807 Fix windows&darwin builds broken by r297812
llvm-svn: 297819
2017-03-15 10:02:20 +00:00
Pavel Labath 8793554185 Delete empty file ProcessLauncherLinux.h
llvm-svn: 297818
2017-03-15 10:02:16 +00:00
Pavel Labath bf37a037d0 BreakpointResolverFileLine: Restrict move-to-nearest-code from moving across 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
2017-03-15 09:53:10 +00:00
Pavel Labath 775588c0c3 Remove lldb streams from the Log class completely
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
2017-03-15 09:06:58 +00:00
Pavel Labath 6de25ec61a dotest.py: remove the ability to specify different architectures/compilers in a single invocation
Summary:
This has been broken at least since the new test result framework was
added, which was over a year ago. It looks like nobody has missed it
since.

Removing this makes the gmodules handling code saner, as it already did
not know how to handle the multiple-compilers case.

My motivation for this is libc++ data formatters support on android -- I
am trying make a central way of determining whether libc++ tests can be
run, and without this, I would have to resort to similar hacks as the
gmodules code.

Reviewers: jingham, zturner

Subscribers: danalbert, tfiala, lldb-commits

Differential Revision: https://reviews.llvm.org/D30779

llvm-svn: 297811
2017-03-15 08:51:59 +00:00