Commit Graph

15773 Commits

Author SHA1 Message Date
Greg Clayton 29eeea00e1 Make sure we only load the OS plug-in once.
<rdar://problem/27580297> 

llvm-svn: 294611
2017-02-09 18:55:41 +00:00
Greg Clayton 21b4b2ea94 Fix build bots.
llvm-svn: 294603
2017-02-09 18:21:04 +00:00
Greg Clayton ac7c2ef580 Fixed an issue where AllocatedBlock::ReserveRange does a linear search through reserved ranges.
After many expressions are evaluated we were spending time looking for open blocks on memory in the one or more AllocatedBlock objects and it would slow down expression evaluation.

I implemented a fixed size blocks implementation that maintains a sorted free list to fix the issue.

<rdar://problem/17962974> 

llvm-svn: 294600
2017-02-09 17:56:55 +00:00
Greg Clayton 7bcf46e29d Fixed documentation bug found by Ramana who sent a patch to the lldb-dev list.
llvm-svn: 294597
2017-02-09 17:16:19 +00:00
Ismail Donmez 75dcfe8449 Revert r294580 , it didn't fix the shared build
llvm-svn: 294583
2017-02-09 12:30:09 +00:00
Ismail Donmez 4200948c5a Fix shared library build
llvm-svn: 294580
2017-02-09 10:59:33 +00:00
Pavel Labath a9e67df2f9 [cmake] add missing dependency lldbCommands->lldbBase
CommandObjectVersion.cpp calls lldb_private::GetVersion (present in lldbBase).

This should fix the unittest link on windows. I am not sure why is this not
present on other platforms -- my guess is that there lldbBase is included in
the link through some other dependency chain.

llvm-svn: 294549
2017-02-09 01:17:34 +00:00
Chris Bieneman a14fbe0cf3 [CMake] Add dependency on Mips target if it is available
The Mips plugins conditionally link the Mips backend, so we need to conditionally add the target as a dependency.

This resolves a bot failure from r294515.

http://lab.llvm.org:8011/builders/lldb-x86_64-ubuntu-14.04-buildserver/builds/4606/steps/build%20android/logs/stdio

llvm-svn: 294521
2017-02-08 21:24:51 +00:00
Chris Bieneman fd2f0cb170 [CMake] Final dependency cleanup patch!
Summary:
This patch removes the over-specified dependencies from LLDBDependencies and instead relies on the dependencies as expressed in each library and tool.

This also removes the library looping in favor of allowing CMake to do its thing. I've tested this patch on Darwin, and found no issues, but since linker semantics vary by system I'll also work on testing it on other platforms too.

Help testing would be greatly appreciated.

Reviewers: labath, zturner

Subscribers: danalbert, srhines, mgorny, jgosnell, lldb-commits

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

llvm-svn: 294515
2017-02-08 21:00:46 +00:00
Nitesh Jain 8493e6a889 [LLDB][MIPS] Fix TestMiExec and TestMiData failures
Subscribers: jaydeep, bhushan, lldb-commits, slthakur
llvm-svn: 294418
2017-02-08 07:42:56 +00:00
Nitesh Jain c12d82ba2d [LLDB][MIPS] Fix TestMiniDumpNew
Reviewers: labath, clayborg

Subscribers: jaydeep, bhushan, lldb-commits, slthakur

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

llvm-svn: 294415
2017-02-08 07:29:24 +00:00
Chris Bieneman bc9d0cd925 [CMake] Add explicit dependencies for ObjectFileELF tests
llvm-svn: 294372
2017-02-07 23:33:58 +00:00
Ed Maste b285deab93 Synchronize PlatformFreeBSD with Linux
Inspired by r294145 for NetBSD, this reduces diffs between the FreeBSD
and Linux/NetBSD Platform implementations. Further diff reduction will
occur once FreeBSD switches to using the remote process plugin.

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

llvm-svn: 294340
2017-02-07 19:29:10 +00:00
Pavel Labath 250858a01e Remove verbose category in the kdp channel
llvm-svn: 294244
2017-02-06 21:46:22 +00:00
Pavel Labath 0e92fbb59c Switch PlatformLinux to LLDB_LOG
llvm-svn: 294243
2017-02-06 21:30:44 +00:00
Pavel Labath e8a7b9841c Remove the verbose category in the gdb-remote channel
replace by LLDB_LOGV

llvm-svn: 294224
2017-02-06 19:31:09 +00:00
Pavel Labath aafe053c53 Remove the verbose category in the posix channel
replace by LLDB_LOGV

llvm-svn: 294223
2017-02-06 19:31:05 +00:00
Pavel Labath 2f8d5739b5 Fix darwin build (error.PutToLog fallout)
llvm-svn: 294222
2017-02-06 19:31:02 +00:00
Pavel Labath 60199c1a4d Fix darwin build (llvm::once_flag fallout)
llvm-svn: 294221
2017-02-06 19:30:59 +00:00
Pavel Labath 62c3545e25 Remove the verbose category in the dwarf channel
llvm-svn: 294219
2017-02-06 19:19:30 +00:00
Pavel Labath 0c7687b106 Really fix build on non-windows platforms :)
llvm-svn: 294215
2017-02-06 18:56:34 +00:00
Zachary Turner 0fceb359ad Try to fix build on non-Windows platforms.
llvm-svn: 294213
2017-02-06 18:49:16 +00:00
Pavel Labath 4ee1c95216 Fix missing include in NativeProcessLinux
llvm-svn: 294211
2017-02-06 18:36:58 +00:00
Zachary Turner 33aba3c290 Get rid of Error::PutToLog().
Instead just rely on LLDB_LOG().

This is part of an effort to sort out dependency hell in LLDB.
Error is in Utility, but Log is in Core.  Core can depend on
Utility, but not vice versa.  So this patch moves the knowledge
about how to log Errors from the Error class to the Log file.

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

llvm-svn: 294210
2017-02-06 18:31:44 +00:00
Greg Clayton b24f7f3d6d Fix Xcode project.
llvm-svn: 294206
2017-02-06 18:10:39 +00:00
Kamil Rytarowski c5f28e2a05 Switch std::call_once to llvm::call_once
Summary:
The std::call_once implementation in libstdc++ has problems on few systems: NetBSD, OpenBSD and Linux PPC. LLVM ships with a homegrown implementation llvm::call_once to help on these platforms.

This change is required in the NetBSD LLDB port. std::call_once with libstdc++ results with crashing the debugger.

Sponsored by <The NetBSD Foundation>

Reviewers: labath, joerg, emaste, mehdi_amini, clayborg

Reviewed By: labath, clayborg

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 294202
2017-02-06 17:55:02 +00:00
Kamil Rytarowski 3202ce6fe0 Synchronize PlatformNetBSD with Linux
Summary:
Update the code to the new world code.

These changes are needed for remote process plugin.

Sponsored by <The NetBSD Foundation>

Reviewers: emaste, clayborg, joerg, labath

Reviewed By: clayborg, labath

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 294145
2017-02-05 21:32:38 +00:00
Pavel Labath d65ac229f5 Clean up PlatformLinux code
don't create a platform.linux setting category, as it contains no
actual settings, and I don't forsee adding any soon. Also remove some
unused includes while I'm in there.

llvm-svn: 294114
2017-02-05 01:04:10 +00:00
Pavel Labath 3b7e1981b2 Remove LIBLLDB_LOG_VERBOSE category
Summary:
Per discussion in D28616, having two ways two request logging (log
enable lldb XXX verbose && log enable -v lldb XXX) is confusing. This
removes the first option and standardizes all code to use the second
one.

I've added a LLDB_LOGV macro as a shorthand for if(log &&
log->GetVerbose()) and switched most of the affected log statements to
use that (I've only left a couple of cases that were doing complex
computations in an if(log) block).

Reviewers: jingham, zturner

Subscribers: lldb-commits

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

llvm-svn: 294113
2017-02-05 00:44:54 +00:00
Kamil Rytarowski 4791532830 Install six.py conditionally
Summary:
The current version of LLDB installs six.py into global python library directory. This approach produces conflicts downstream with distribution's py-six copy.

Introduce new configure option LLDB_USE_SYSTEM_SIX (disabled by default). Once specified as TRUE, six.py won't be installed to Python's directory.

Add new option in finishSwigWrapperClasses.py, namely --useSystemSix.

Sponsored by <The NetBSD Foundation>

Reviewers: mgorny, emaste, clayborg, joerg, labath

Reviewed By: labath

Subscribers: #lldb

Tags: #lldb

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

llvm-svn: 294071
2017-02-04 00:20:24 +00:00
Pavel Labath 90505a0a2a Add a missing break statement
llvm-svn: 294036
2017-02-03 20:26:57 +00:00
Pavel Labath 05d382c5f7 Fix incorrect logging in ThreadPlan::ShouldReportStop
it used printf with formatv style specifications. Also, switch to
LLDB_LOG.

llvm-svn: 294024
2017-02-03 18:50:45 +00:00
Pavel Labath ea1b6b17dc Use LLDB_LOG in NativeRegisterContextLinux*** files
llvm-svn: 294023
2017-02-03 18:50:41 +00:00
Pavel Labath ec9bc8ccd4 Push down more common code into PlatformPOSIX
Summary:
- GetFileWithUUID: All platforms except PlatformDarwin had this.
However, I see no reason why this code would not apply there as well.

- GetProcessInfo, FindProcesses: The implementation was the same in all classes.

- GetFullNameForDylib: This code should apply to all non-darwin
platforms. I've kept the PlatformDarwin override as the situation is
different there.

Reviewers: clayborg, krytarowski, emaste

Subscribers: lldb-commits

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

llvm-svn: 294019
2017-02-03 17:42:04 +00:00
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