Commit Graph

15739 Commits

Author SHA1 Message Date
Pavel Labath 0972183581 Fix mac build breakage due to StringStream move
llvm-svn: 293948
2017-02-02 22:38:12 +00:00
Zachary Turner bf9a77305f Move classes from Core -> Utility.
This moves the following classes from Core -> Utility.

ConstString
Error
RegularExpression
Stream
StreamString

The goal here is to get lldbUtility into a state where it has
no dependendencies except on itself and LLVM, so it can be the
starting point at which to start untangling LLDB's dependencies.
These are all low level and very widely used classes, and
previously lldbUtility had dependencies up to lldbCore in order
to use these classes.  So moving then down to lldbUtility makes
sense from both the short term and long term perspective in
solving this problem.

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

llvm-svn: 293941
2017-02-02 21:39:50 +00:00
Pavel Labath 86b03cf086 Fix windows build after r293821
We started passing the list of libraries to link to the
add_lldb_unittest macro, but that macro wasn't actually doing anything
with them. Fix that.

llvm-svn: 293913
2017-02-02 18:14:04 +00:00
Pavel Labath fc89bbcc71 Unify PlatformPOSIX::ResolveExecutable
Summary:
various platforms very using nearly identical code for this method. As far as I
can tell there was nothing platform-specific about the differences, but rather
it looked like it was caused by tiny tweaks being made to individual copies
without affecting the overall functionality. I have taken the superset of all
these tweaks and put it into one method in the base class (incidentaly, nobody
was using the base class implementation of the method, as all classes were
overriding it). From the darwin class I took the slightly improved error
reporting (checking whether the file is readable) and the
ResolveExecutableInBundle call (which has no effect elsewhere as the function
is already a no-op on non-darwin platforms). From the linux class I took the
set-the-triple-vendor-to-host-if-unspecified tweak (present in PlatformKalimba
as well).

PlatformWindows has an identical copy as well. We could resolve that by pushing
this code further down into Platform class, that that would require pushing the
m_remote_platform_sp member as well, which seems like a bad design choice.

Reviewers: clayborg, emaste, krytarowski

Subscribers: lldb-commits

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

llvm-svn: 293910
2017-02-02 17:50:03 +00:00
Kamil Rytarowski ea89913839 Fix multi-process-driver.cpp build on NetBSD
Summary:
Include <string.h> for strcmp(3) and memset(3).

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: clayborg

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 293895
2017-02-02 15:05:56 +00:00
Jason Molenda 753e13c0eb Add logging to SBThread::GetInfoItemByPathAsString to
print the path being requested.

Change the GetInfoItemByPathAsString docuemtnation in 
the .i file to use docstring instead of autodoc so
the function signature is included in the python
help.
<rdar://problem/29999567> 

llvm-svn: 293858
2017-02-02 03:02:51 +00:00
Jason Molenda 35c5b86737 Update xcodeproj to track ConvertEnum.cpp et al being removed.
llvm-svn: 293831
2017-02-01 22:41:38 +00:00
Chris Bieneman 1751311a87 [CMake] Update unit tests with accurate dependencies
This is extending the updates from r293696 to the LLDB unit tests.

llvm-svn: 293821
2017-02-01 22:17:00 +00:00
Zachary Turner df44988b87 Break some dependencies in lldbUtility.
Differential Revision: https://reviews.llvm.org/D29359

llvm-svn: 293806
2017-02-01 19:45:14 +00:00
Pavel Labath 5569c0b953 [cmake] Remove VERSION property from executable targets
Summary:
Currently, in the default configuration, the "install" target will
install all llvm executables unversioned, except for three lldb tools
which will be installed versioned (with a non-versioned symlink). This
rectifies that situation.

Reviewers: beanz, sylvestre.ledru, mgorny

Subscribers: ki.stfu, lldb-commits

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

llvm-svn: 293803
2017-02-01 19:12:22 +00:00
Pavel Labath 3eb8b1ade1 Fix android build of the new process launcher
Android does not define the "cross-platform" symbol PT_TRACE_ME. Define
it ourselves, so we can keep the rest of the code generic.

llvm-svn: 293779
2017-02-01 16:43:22 +00:00
Kamil Rytarowski b5bc933c29 Do not pass non-POD type variables through variadic function
Summary:
Cannot pass object of non-POD type 'const CMIUtilString' through variadic function.

This behavior is undefined according to C++11 5.2.2/7:

> Passing a potentially-evaluated argument of class type having a non-trivial copy constructor, a non-trivial move contructor, or a non-trivial destructor, with no corresponding parameter, is conditionally-supported with implementation-defined semantics.

Replace SetErrorDescriptionn(errMsg); with SetErrorDescription(errMsg);

Original patch by Tobias Nygren (NetBSD).

Sponsored by <The NetBSD Foundation>


Reviewers: clayborg, labath, emaste, joerg, ki.stfu

Reviewed By: labath, ki.stfu

Subscribers: tnn, ki.stfu, #lldb

Tags: #lldb

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

llvm-svn: 293774
2017-02-01 16:02:55 +00:00
Kamil Rytarowski c9a89f6936 Document that LaunchProcessPosixSpawn is used on NetBSD
No functional change.

Sponsored by <The NetBSD Foundation>

llvm-svn: 293770
2017-02-01 14:35:08 +00:00
Kamil Rytarowski 816ae4b0df Transform ProcessLauncherLinux to ProcessLauncherPosixFork
Summary:
Use ProcessLauncherPosixFork in Linux and NetBSD.

Changes to ProcessLauncherLinux:
 - Limit personality.h and ASLR code to Linux.
 - Reuse portable ptrace(2) PT_TRACE_ME operation available on Linux and BSDs.
 - Limit ETXTBSY error path from execve(2) to Linux.
 - In LaunchProcess declaration change virtual to override.

This code should be readily available for FreeBSD.

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, clayborg, labath, emaste

Reviewed By: labath

Subscribers: danalbert, srhines, mgorny, #lldb

Tags: #lldb

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

llvm-svn: 293768
2017-02-01 14:30:40 +00:00
Ismail Donmez 79d58a39d1 Fix missing include after r293660
llvm-svn: 293767
2017-02-01 13:33:50 +00:00
Jason Molenda 9dd2ff4604 When I added the use of the new compression framework (present in
Mac OS X 10.11, El Capitan, released c. Oct 2015) I conditionalized
the use of the framework on "if sdk == macosx 10.11".  But since
macOS 10.12 has shipped this year, the framework was no longer being
built in.  I can either start listing every OS 10.11 and newer, or
remove the version check.

This will break building lldb with xcodebuild / Xcode for people 
running Mac OS X 10.10 or older.  If so, I'll back this change out.
I'm not sure if we have many people working on macs running the
older OSes on their build systems.

<rdar://problem/30159130> 

llvm-svn: 293742
2017-02-01 04:23:15 +00:00
Pavel Labath 23ccc29197 Open ELF core dumps with more than 64K sections
Summary:
Problem:

There are three filelds in the ELF header - e_phnum, e_shnum, and e_shstrndx -
that could be bigger than 64K and therefore do not fit in 16 bits reserved for
them in the header. If this happens, pretty often there is a special section at
index 0 which contains their real values for these fields in the section header
in the fields sh_info, sh_size, and sh_link respectively.

Fix:

- Rename original fields in the header declaration. We want to have them around
just in case.

- Reintroduce these fields as 32-bit members at the end of the header. By default
they are initialized from the header in Parse() method.

- In Parse(), detect the situation when the header might have been extended into
section info #0 and try to read it from the same data source.

- ObjectFileELF::GetModuleSpecifications accesses some of these fields but the
original parse uses too small data source. Re-parse the header if necessary
using bigger data source.

- ProcessElfCore::CreateInstance uses header with potentially sentinel values,
but it does not access these fields, so a comment here is enough.

Reviewers: labath

Reviewed By: labath

Subscribers: davidb, lldb-commits, mgorny

Differential Revision: https://reviews.llvm.org/D29095
Author: Eugene Birukov <eugenebi@hotmail.com>

llvm-svn: 293714
2017-01-31 23:09:46 +00:00
Chris Bieneman 3173c964da [CMake] [4/4] Update a batch of plugins
This is extending the updates from r293696 to more LLDB plugins.

llvm-svn: 293701
2017-01-31 22:31:38 +00:00
Chris Bieneman 81b8f12b42 [CMake] [3/4] Update a batch of plugins
This is extending the updates from r293696 to more LLDB plugins.

llvm-svn: 293700
2017-01-31 22:29:11 +00:00
Chris Bieneman 66a2d639ab [CMake] [2/4] Update a batch of plugins
This is extending the updates from r293696 to more LLDB plugins.

llvm-svn: 293699
2017-01-31 22:23:49 +00:00
Chris Bieneman 6847a3aba1 [CMake] [1/4] Update a batch of plugins
This is extending the updates from r293696 to more LLDB plugins.

llvm-svn: 293698
2017-01-31 22:21:19 +00:00
Chris Bieneman cee3837eb8 [CMake] Add explicit dependencies to plugins
Summary:
This patch does two things. First it updates all the ABI plugins with accurate dependencies, and second it adds a tracking mechanism for add_lldb_library to denote plugin libraries, allowing us to build up a list of all the configured plugins.

This list of generated plugins will be used during generating liblldb so that we can link all the plugins into the library.

If this patch looks good I will update all the other plugins in subsequent patches.

Reviewers: labath, zturner

Subscribers: nemanjai, mgorny, lldb-commits, jgosnell

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

llvm-svn: 293696
2017-01-31 22:12:59 +00:00
Chris Bieneman c4f9920bd4 [CMake] Partial revert of r293686
This change reverts the lldb-server part of r293686, which is having trouble on Linux bots. I'm not sure if I can make lldb-server work correctly until the full dependency graph is fixed.

llvm-svn: 293690
2017-01-31 21:12:52 +00:00
Chris Bieneman 987401bbfe [CMake] Fix broken NetBSD bots
http://lab.llvm.org:8011/builders/lldb-amd64-ninja-netbsd7/builds/4558/steps/cmake%20local/logs/stdio

llvm-svn: 293687
2017-01-31 20:52:41 +00:00
Chris Bieneman 494f277af5 [CMake] Add accurate dependency specifications
Summary:
This patch adds accurate dependency specifications to the mail LLDB libraries and tools.

In all cases except lldb-server, these dependencies are added in addition to existing dependencies (making this low risk), and I performed some code cleanup along the way.

For lldb-server I've cleaned up the LLVM dependencies down to just the minimum actually required. This is more than lldb-server actually directly references, and I've left a todo in the code to clean that up.

Reviewers: labath, zturner

Subscribers: lldb-commits, danalbert, srhines, ki.stfu, mgorny, jgosnell

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

llvm-svn: 293686
2017-01-31 20:43:05 +00:00
Jim Ingham 8e3e944cd1 Move the stop point to somewhere before the final use of the
variable we are inspecting.

llvm-svn: 293666
2017-01-31 18:26:20 +00:00
Valentina Giusti c0eeee7a78 Add a command to access and manipulate the Intel(R) MPX Boundary Tables.
Summary:
The Boundary Table Entries are stored in the application memory and allow
to store boundary info for all the pointers of the program, also those that
otherwise wouldn't fit in the 4 bound registers provided by the HW.

Here is an example of how it works:
 * mpx-table show <pointer>
        lbound = 0x..., ubound = 0x..., (pointer value = 0x..., metadata = 0x...)
 * mpx-table set <pointer>

Signed-off-by: Valentina Giusti <valentina.giusti@intel.com>

Reviewers: labath, clayborg

Reviewed By: clayborg

Subscribers: lldb-commits, mgorny

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

llvm-svn: 293660
2017-01-31 18:02:54 +00:00
Chris Bieneman 62b83ede84 [CMake] Add LINK_LIBS and LINK_COMPONENTS options
This patch adds CMake options to add_lldb_library and add_lldb_executable for specifying LLVM components and direct library links.

This patch is NFC, but it is a small separable bit of a series of much larger patches that I'll be landing over the next day or two.

llvm-svn: 293647
2017-01-31 16:59:46 +00:00
Chris Bieneman 5c79313563 NFC. Remove unused header include.
llvm-svn: 293646
2017-01-31 16:48:20 +00:00
Kamil Rytarowski e5c6a32163 Add NetBSD support in Host::GetCurrentThreadID
Summary:
To retrieve the native thread ID there must be called _lwp_self().

Sponsored by <The NetBSD Foundation>

Reviewers: joerg, clayborg, emaste, labath

Reviewed By: joerg, clayborg, labath

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 293625
2017-01-31 13:38:42 +00:00
Kamil Rytarowski 3caaaa94c6 Switch HostInfoNetBSD::GetProgramFileSpec to sysctl(7)
Summary:
Remove dependency on the proc (/proc) filesystem, which is optional.

KERN_PROC_PATHNAME is available in NetBSD-current and will land NetBSD 8.0.
Older stable versions of NetBSD will not be supported.

Sponsored by <The NetBSD Foundation>

Reviewers: emaste, joerg, labath, clayborg

Reviewed By: clayborg

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 293392
2017-01-28 20:04:53 +00:00
Kamil Rytarowski a89218d603 Recognize Real-Time Signals on NetBSD
Summary:
Real-Time Signals are available in NetBSD-current and will land NetBSD 8.0.
Older stable versions of NetBSD will not be supported.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg, clayborg, emaste

Reviewed By: labath, clayborg, emaste

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 293391
2017-01-28 20:01:53 +00:00
Jason Molenda 270e822844 One of the changes Jim made in r286288 (cleaning up the stop print
header line, backtrace output) was to remove the current pc value
from frames where we have source level information.  We've been
discussing this for the past week and based on input from a group
of low level users, I believe this is the wrong default behavior
for the command line lldb tool.

lldb's backtrace will include the pc value for all stack frames
regardless of whether they have source level debug information or
not.  

A related part of r286288 removes the byte offset printing for
functions with source level information (e.g. "main + 22 sourcefile.c:10"
is printed as "main sourcefile.c:10").  I don't see a compelling
case for changing this part of 286288 so I'm leaving that as-is
(in addition to the rest of 286288 which is clearly better than
the previous output style).

<rdar://problem/30083904> 

llvm-svn: 293366
2017-01-28 02:54:10 +00:00
Adrian McCarthy 9d0eb9960c NFC: Improve comments in SymbolFilePDB.cpp
Mostly this just fixes bad wrapping caused by the reformat, with tiny
changes sprinkled here and there.

llvm-svn: 293336
2017-01-27 21:42:28 +00:00
Pavel Labath 095d6b8f99 Address post-commit review remarks
Tamas pointed out that the macro name I used in r293282 was too vague.
Rename it to better reflect what it is used for.

llvm-svn: 293287
2017-01-27 15:19:03 +00:00
Pavel Labath 810055ee23 Fix android-i386 build broken by previous commit
I foolishly thought I could simplify the condition to cover all android
targets. I was wrong - i386 headers don't define __NR_accept.

Revert back to enabling the workaround on arm an mips only.

llvm-svn: 293282
2017-01-27 12:58:23 +00:00
Pavel Labath ef97630fd2 Refactor the android accept hack
This moves the accept hack from the android toolchain file into
LLDBConfig.cmake. This allows successful lldb android compilation
without relying on our custom toolchain file.

llvm-svn: 293281
2017-01-27 12:23:51 +00:00
Boris Ulasevich 67346ca9ef Unroll r292930 due to TestCallThatThrows test fail is not fixed in reasonable time.
llvm-svn: 293269
2017-01-27 07:51:43 +00:00
Sean Callanan 1912d9633f Removed an unneccesary #if now that debugserver-mini links Foundation.
llvm-svn: 293161
2017-01-26 08:51:32 +00:00
Jason Molenda 728c290daf Add Foundation to the debugserver-mini dependencies;
debugserver-mini can use Foundation.

llvm-svn: 293140
2017-01-26 02:27:35 +00:00
Jason Molenda 891c777f90 Instead of weak-linking against LoggingSupport framework (which
requires that this private framework be available - and it is not
available earlier than macOS 10.12 - to build lldb), dlopen the
framework binary on demand in debugserver.  We're already using
dlsym() to look up all the symbols so there is no need to use weak
linking here.

<rdar://problem/30158797> 

llvm-svn: 293135
2017-01-26 02:13:43 +00:00
Greg Clayton 896b4513e1 Fix SBData::SetData() so that it always sets the address byte size correctly and added a test.
llvm-svn: 293102
2017-01-25 21:50:28 +00:00
Sean Callanan 9ea2835704 Link debugserver against Foundation to get access to NSProcessInfo.
debugserver-mini can't use Foundation so disable that code there. 

llvm-svn: 293098
2017-01-25 21:32:00 +00:00
Pavel Labath 46897a46ee include Host/Time.h in Cocoa.cpp
Time.h contains the necessary magic to enable timegm on all android
targets.

llvm-svn: 293047
2017-01-25 11:19:49 +00:00
Pavel Labath 8abd34f015 NPL: Compartmentalize arm64 single step workaround better
The main motivation for me doing this is being able to build an arm
android lldb-server against api level 9 headers, but it seems like a
good cleanup nonetheless.

The entirety of the cpu_set_t dance now resides in SingleStepCheck.cpp,
which is only built on arm64.

llvm-svn: 293046
2017-01-25 11:19:45 +00:00
Pavel Labath 2d0c5b0297 Replace chdir() usage with the llvm equivalent.
This removes a hack in PosixApi.h, which tends to produce strange
compile errors when it's included in the wrong order.

llvm-svn: 293045
2017-01-25 11:10:52 +00:00
Sean Callanan 60370e375a Reverted 292880 to fix a linker error.
<rdar://problem/30180883>

llvm-svn: 293022
2017-01-25 05:39:14 +00:00
Sean Callanan 95a6e6f6a6 Conditionalized OsLogger.cpp on a modern SDK.
llvm-svn: 293020
2017-01-25 05:18:32 +00:00
Jason Molenda a1609ff658 Jim unintentionally had the gdb-format specifiers falling through
after r276132 so that 'x/4b' would print out a series of 4 8-byte
quantities.  Fix that, add a test case.

<rdar://problem/29930833> 

llvm-svn: 293002
2017-01-25 01:41:48 +00:00
Hafiz Abid Qadeer b10fb96541 Provide option to set pc of the file loaded in memory.
Summary: This commit adds an option to set PC to the entry point of the file loaded using "target module load" command. In D28804, Greg asked me to separate this part under a different option.

Reviewers: clayborg

Reviewed By: clayborg

Subscribers: lldb-commits

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

llvm-svn: 292989
2017-01-24 23:07:27 +00:00