Commit Graph

9565 Commits

Author SHA1 Message Date
Todd Fiala dbec1ff42a Fix build break on Ubuntu 12.04 with ARM64 changes.
See http://llvm.org/bugs/show_bug.cgi?id=20824 for more details.

Tested:
Ubuntu 12.04 x86_64, gcc-4.9.1-built lldb
Ubuntu 14.04 x86_64, clang-3.5-build lldb

llvm-svn: 217169
2014-09-04 16:08:20 +00:00
Todd Fiala 6ce8fef458 Use the process' ReadCStringFromMemory from DYLDRendezvous::ReadStringFromMemory.
Tested:
Ubuntu 14.04 x86_64, clang-3.5-built lldb.
MacOSX 10.9.4, Xcode6-Beta7-built lldb.

Visual packet inspection on lldb <-> llgs shows significant reduction in overly-verbose
memory read traffic on start-up when scanning shared library info.

Change by Stephane Sezer.

llvm-svn: 217153
2014-09-04 14:16:19 +00:00
Kuba Brecka beed821ffb ASan malloc/free history threads
Reviewed at http://reviews.llvm.org/D4596

llvm-svn: 217116
2014-09-04 01:03:18 +00:00
Han Ming Ong cd2d797a79 rdar://problem/18221417
Include compressed memory as part of gauge memory.

llvm-svn: 217084
2014-09-03 22:33:37 +00:00
Jason Molenda f0340c9ab5 Add a new target.process.memory-cache-line-size to change the size of
lldb's internal memory cache chunks that are read from the remote
system.  For a remote connection that is especially slow, a user may
need to reduce it; reading a 512 byte chunk of memory whenever a
4-byte region is requested may not be the right decision in these
kinds of environments.
<rdar://problem/18175117> 

llvm-svn: 217083
2014-09-03 22:30:54 +00:00
Reid Kleckner 5420953303 Really fix the LLDB build
llvm-svn: 217003
2014-09-03 00:40:36 +00:00
Reid Kleckner 634ff8ec04 Remove the JIT from LLDB's dependencies to fix the build
llvm-svn: 217002
2014-09-03 00:35:03 +00:00
Jason Molenda 5de2e7cafb RegisterContextLLDB::InitializeNonZerothFrame had a bit of code to
detct unwind loops but there was a code path through there (using
architecture default unwind plans) that didn't do the check, and
could end up with an infinite loop unwind.  Move that code into a
separate method and call it from both places where it is needed.

Also remove the use of ABI::FunctionCallsChangeCFA in that check.
I thought about it a lot and none of the architecutres that we're
supporting today can have a looping CFA.

Since the unwinder isn't using ABI::FunctionCallsChangeCFA() and
ABI::StackUsesFrames(), and the unwinder was the only reason
those methods exists, I removed them from the ABI and all its
plugins.

<rdar://problem/17364005> 

llvm-svn: 216992
2014-09-02 23:04:01 +00:00
Todd Fiala 726d6a12ad Fix MacOSX cmake build for new HostInfoMacOSX file.
Change by Stephane Sezer.

llvm-svn: 216948
2014-09-02 21:10:23 +00:00
Todd Fiala c5c4e3a35b Linux ARM64: add ProcessMonitor-related RegisterContext support.
See http://reviews.llvm.org/D5089 for more details.

Change by Paul Osmialowski.

llvm-svn: 216907
2014-09-02 14:50:01 +00:00
Matthew Gardiner e77b2948b4 Add an interface on ArchSpec to provide lldb client code
with a mechanism to query if the current target architecture
has non 8-bit bytes.

llvm-svn: 216867
2014-09-01 09:06:03 +00:00
Sean Callanan 302be679bc Fixed a build problem dueo to changes in the
way ownership of memory buffers is handled in
clang's SourceManager.

llvm-svn: 216810
2014-08-30 02:24:56 +00:00
Todd Fiala 5412524025 Fix a test broken by r216564.
llgs Linux is no longer doing the translation to some gdb fixed signal
numbers.  This change modifies the test method to take in the signo
expected for a segfault.  The debugserver test uses the fixed gdb number,
and everything else uses signal.SIGSEGV for the platform.

Sidenote: I somehow did not see this reported in multicore tests.
I will need to verify that we aren't missing test failures in that
script.  I need to verify why this wasn't more obvious with
test/dosep.py.

llvm-svn: 216770
2014-08-29 20:32:18 +00:00
Todd Fiala 352237dbb6 lldb - fix misleading "valid target indexes are" error message
See http://reviews.llvm.org/D4430 for more details.

Change by Paul Osmialowski.

llvm-svn: 216766
2014-08-29 20:14:21 +00:00
Todd Fiala 4ceced3f59 Consolidate UnixSignals setting/getting in Process.
See http://reviews.llvm.org/D5108 for details.

This change does the following:

* eliminates the Process::GetUnixSignals() virtual method and replaces with a fixed getter.
* replaces the Process UnixSignals storage with a shared pointer.
* adds a Process constructor variant that can be passed the UnixSignalsSP. When the constructor without the UnixSignalsSP is specified, the Host's default UnixSignals is used.
* adds a host-specific version of GetUnixSignals() that is used when we need the host's appropriate UnixSignals variant.
* replaces GetUnixSignals() overrides in PlatformElfCore, ProcessGDBRemote, ProcessFreeBSD and ProcessLinux with code that appropriately sets the Process::UnixSignals for the process.

This change also enables some future patches that will enable llgs to be used for local Linux debugging.

llvm-svn: 216748
2014-08-29 17:35:57 +00:00
Jim Ingham b5796cb40e Allow "breakpoint command add" to add commands to more than one breakpoint at a time.
<rdar://problem/13314462>

llvm-svn: 216747
2014-08-29 17:34:17 +00:00
Todd Fiala 34ba426968 Add arbitrary command line flags to llgs/debugserver startup for local debugging.
This patch accepts environment variables of the form:
LLDB_DEBUGSERVER_EXTRA_ARG_n

where n starts with 1, and may continue nearly indefinitely (up through std::numeric_limits<uint32_t>::max()).

The code loops around, starting with 1, until it doesn't find one of the environment variables.  For each one it does find defined, it appends the environment variable's contents to the end of the debugserver/llgs startup command line issued when the stub is started for local debugging.

I am using this to add arbitrary startup commands to the llgs command line for turning on additional logging.  For example:

export LLDB_DEBUGSERVER_EXTRA_ARG_1="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_2="log enable -f /tmp/llgs_packets.log gdb-remote packets"
export LLDB_DEBUGSERVER_EXTRA_ARG_3="-c"
export LLDB_DEBUGSERVER_EXTRA_ARG_4="log enable -f /tmp/llgs_process.log lldb process"

llvm-svn: 216745
2014-08-29 17:10:31 +00:00
Todd Fiala 33bba9f440 lldb - ELF: add ARM64 relocation jump slot handling in ELFHeader.
See http://reviews.llvm.org/D4579 for more details.

Change by Paul Osmialowski.

llvm-svn: 216739
2014-08-29 16:19:27 +00:00
Todd Fiala b71e89e9af lldb - Register Context Linux ARM64
Yet another step toward ARM64 support. With this commit, lldb-gdbserver started on ARM64 target can be accessed by lldb running on desktop PC and it can process simple commands (like 'continue'). Still ARM64 support lacks NativeRegisterContextLinux_arm64.* code which waits to be implemented.
Based on similar files for Linux x86_64 and Darwin ARM64. Due to common code extraction from Darwin related files, lldb should be tested for any unexpected regression on Darwin ARM64 machines too.

See the following for more details:
http://reviews.llvm.org/D4580
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012670.html

Change by Paul Osmialowski.

llvm-svn: 216737
2014-08-29 16:01:35 +00:00
Todd Fiala 281961a821 Added setting: platform.plugin.linux.use-llgs-for-local (boolean), defaults to false
This setting is not yet hooked up to anything.  In preparation for
adding/testing llgs for local Linux debugging.

llvm-svn: 216690
2014-08-28 22:17:54 +00:00
Todd Fiala 0b903a0f69 Ensure the Host wait4 thread is able to show pid in thread name.
For hosts that cannot support long thread names, shrink the host
wait4 thread name so that it does not truncate the PID in the thread name.

Change by Shawn Best.

llvm-svn: 216686
2014-08-28 21:21:39 +00:00
Todd Fiala a9882cee50 llgs: add proper exec support for Linux.
This change:
* properly captures execs in NativeProcessLinux.
* clears out all non-main-thread thread metadata in NativeProcessLinux on exec.
* adds a DidExec() method to the NativeProcessProtocol delegate.
* clears out the auxv data cache when we exec (on Linux).

This is a small part of the llgs for local Linux debugging work going on here:
https://github.com/tfiala/lldb/tree/dev-llgs-local

I'm breaking it into small patches.

llvm-svn: 216670
2014-08-28 15:46:54 +00:00
Todd Fiala 02e7181508 lldb - towards AArch64 being recognised as platform architecture
See http://reviews.llvm.org/D4381.

Change by Paul Osmialowski.

llvm-svn: 216668
2014-08-28 14:32:43 +00:00
Jim Ingham 1bb0750b98 Make it clear in the help that "breakpoint command add" will act on the last set
breakpoint if no breakpoint id is specified.

<rdar://problem/17885160>

llvm-svn: 216637
2014-08-28 00:50:17 +00:00
Todd Fiala 76e0fc9884 Add some logging around Process attaching and inferior exec handling.
llvm-svn: 216630
2014-08-27 22:58:26 +00:00
Jim Ingham dc498e516f A quoted - is not the beginning of an option, and should not be completed as such. This was causing:
(lldb) disassemble -n '-<TAB>

to crash.

<rdar://problem/18134531>

llvm-svn: 216626
2014-08-27 22:06:58 +00:00
Jim Ingham 4eb1b271fc Make it clear that the load_addr property on SBAddress relies on lldb.target,
and so can only be used in the script interpreter.

llvm-svn: 216625
2014-08-27 22:05:14 +00:00
Zachary Turner 0b9bab48bb Fix linker error due to missing static variable instantiation.
llvm-svn: 216612
2014-08-27 20:44:26 +00:00
Zachary Turner 4e82ec9caa Create a HostProcess class.
This is a lightweight wrapper around a pid.  It is intended to be
lightweight enough to serve as a replacement anywhere we currently
store a pid.  It provides convenience methods and common process
operations.

This patch does not yet make use of HostProcess anywhere.

llvm-svn: 216607
2014-08-27 20:15:30 +00:00
Zachary Turner 58a559c07e Update LLDB to use LLVM's DynamicLibrary.
LLDB had implemented its own DynamicLibrary class for plugin
support.  LLVM has an equivalent mechanism, so this patch deletes
the duplicated code in LLDB and updates LLDB to reference the
mechanism provided by LLVM.

llvm-svn: 216606
2014-08-27 20:15:09 +00:00
Rafael Espindola 2443e706c1 Update for LLVM API change.
llvm-svn: 216603
2014-08-27 20:09:08 +00:00
Todd Fiala 737f43628a llgs: remove all Initialize() calls except for Debugger::Initialize().
See thread here:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140825/012580.html

The original change I made there was due to a segfault.  That was
caused by me directly calling PluginManager::Initialize (), with
PluginManager::Initialize() depending on HostInfo::Initialize () to
have been called already (which it wasn't).

The call to PluginManager::Initialize () was erroneous (at least at the 
current time) since that method is already called by Debugger::Initialize()'s 
implementation.

We will want to revisit initializing a smaller core of the debugger
suitable for lldb-gdbserver and lldb-platform.

llvm-svn: 216581
2014-08-27 19:56:58 +00:00
Todd Fiala 22972a7c59 NativeThreadLinux: remove translation of some Linux signals to gdb signals.
I copied this originally based on what debugserver was doing.  This appears to
be incorrect and unncessary for Linux.  The LinuxSignals on the lldb side
don't look for these and therefore they get handled incorrectly.

Leaving the hook in place since I think darwin will continue to need to
translate those signal numbers.

llvm-svn: 216564
2014-08-27 17:11:56 +00:00
Todd Fiala 1d6082ff17 lldb Missing ARM64 breakpoint opcode for ProcessPOSIX added.
See http://reviews.llvm.org/D5078.

Change by Paul Osmialowski.

llvm-svn: 216559
2014-08-27 16:32:02 +00:00
Todd Fiala e4d6922ceb lldb AArch64 should be listed as yet another 64-bit architecture in HostInfoBase.
See http://reviews.llvm.org/D5070.

Change by Paul Osmialowski.

llvm-svn: 216556
2014-08-27 16:21:41 +00:00
Todd Fiala 8b55cce84c lldb Missing break statement added.
See http://reviews.llvm.org/D5069.

Change by Paul Osmialowski.

llvm-svn: 216554
2014-08-27 16:12:35 +00:00
Todd Fiala 4207968d33 Add Linux support for get thread area on ARM64 using ProcessMonitor debugging.
See http://reviews.llvm.org/D5073.

Change by Paul Osmialowski.

llvm-svn: 216553
2014-08-27 16:05:26 +00:00
Matthew Gardiner 5f67579f69 Add support for kalimba architecture variants 3, 4 and 5.
Add entries to core_definitions and elf_arch_entries for
those variants. Select the subtype for the variant by parsing
the e_flags field of the elf header.

llvm-svn: 216541
2014-08-27 12:09:39 +00:00
Enrico Granata 4419d539cf Add __NSCFDictionary to the list of NSDictionary-like types for which we know to generate synthetic children
llvm-svn: 216513
2014-08-27 01:10:27 +00:00
Jason Molenda 33a3017a7d Clean up after the multithreaded test case finishes.
Patch by Sean Callanan.
<rdar://problem/18140875> 

llvm-svn: 216504
2014-08-26 23:31:00 +00:00
Enrico Granata 689cdb1894 There seems to be no sane reason for a test case to enable logging every time it runs.. probably leftover from when I was debugging it
llvm-svn: 216502
2014-08-26 23:27:51 +00:00
Jason Molenda f37b7c79a3 Don't have ProcessMachCore::CanDebug use the Target's arch when
creating the ModuleSpec to load the core file - we won't have a fat
core file and we can end up with cpu subtype mismatches if the core
file header isn't written out completely accurately.  We need to
be a little loose in this particular case.
<rdar://problem/17843388>

llvm-svn: 216498
2014-08-26 22:39:03 +00:00
Enrico Granata 59953f0dbe It was pointed out to me that an offset of 0 makes sense for ObjC, but not always for C++, and this API claims to be general enough that it should not drop C++ usability on the floor for no good reason. Fix it with an explicit offset argument
llvm-svn: 216487
2014-08-26 21:35:30 +00:00
Bruce Mitchener ca7b0aaa36 [dwarf] Add new language enumerations.
This updates the DWARF language identifiers to include recent additions to
the DWARF 5 specification (draft).

llvm-svn: 216486
2014-08-26 21:22:49 +00:00
Enrico Granata 32556cda18 Add an API on ValueObject to generate a 'synthetic child' of base class type. Note that in this commit, the term synthetic child is not meant to refer to data formatters, but to the programmatically-generated children stored inside a ValueObject itself
llvm-svn: 216483
2014-08-26 20:54:04 +00:00
Todd Fiala 6c9053ef20 Added a couple more gdb-remote tests to ensure qProcessInfo on darwin is not defining triple.
And likewise for qProcessInfo on Linux, but ensures cputype/cpusubtype is not defined.  The
Apple case is the more important one, since we take a slightly different path to initialize
ProcessGDBRemote-related remote host/process info if triple is present.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755.

llvm-svn: 216473
2014-08-26 18:40:56 +00:00
Todd Fiala c540dd0daf Fix llgs to send triple for non-Apple platforms and lldb to interpret correctly.
This change addresses this bug:
http://llvm.org/bugs/show_bug.cgi?id=20755

This change:
* Modifies llgs to send triple instead of cputype and cpusubtype when not on Apple platforms in qProcessInfo.
* Modifies lldb's GDBRemoteCommunicationClient to handle the triple returned from qProcessInfo if given.
  When given, it will prefer to use triple over cputype and cpusubtype.
* Adds gdb-remote protocol tests to verify that cputype and cpusubtype are specified on darwin, and that triple is specified on Linux.

llvm-svn: 216470
2014-08-26 18:21:02 +00:00
Todd Fiala f76a891299 Refactored existing gdb-remote qProcessInfo tests into separate python file.
I'm about to add some more qProcessInfo tests so I wanted to first pull them out
of the monolithic TestLldbGdbServer test case class.

Related to http://llvm.org/bugs/show_bug.cgi?id=20755

llvm-svn: 216465
2014-08-26 17:19:10 +00:00
Matthew Gardiner e81df3bbc9 Remove the hostname part from compilation directories, if supplied by
DWARF2/3 compliant producers.

llvm-svn: 216440
2014-08-26 06:57:23 +00:00
Jason Molenda 7b967f1477 Remove trailing whitespace from lines in UnwindAssembly-x86.cpp. No other changes.
llvm-svn: 216420
2014-08-25 23:46:06 +00:00
Jason Molenda 31e7191513 Clean up the coding conventions in UnwindAssembly-x86.cpp a little bit.
I wrote this originally as a part of an unwind library that was using
a different coding convention and some of that old style remained after
its integration into lldb.

llvm-svn: 216419
2014-08-25 23:45:24 +00:00
Todd Fiala a220946990 Copy unwind plan instead of modifying it directly, so "image show-unwind" prints different plans for asynchronous and synchronous.
Change by Tong Shen.

llvm-svn: 216416
2014-08-25 23:09:40 +00:00
Jason Molenda 1786ebf3d4 Have augment_unwind_plan_from_call_site update the UnwindPlan
name/from-compiler settings to indicate that it was augmented
by assembly profiling.

llvm-svn: 216412
2014-08-25 22:16:23 +00:00
Todd Fiala 1767e11594 Add 64-bit eh_frame section CFI support.
In practice, 64bit eh_frame is not used even for x86_64 binaries. The main reason is in eh_frame we almost always use pc-relative addressing, so addresses are within 32bits and gcc just sticks to 32bit eh_frame.

I generated 64bit eh_frame for Android Java runtime and unwind successfully in gdb, and in lldb with this patch.

Patch by Tong Shen.

llvm-svn: 216409
2014-08-25 21:39:30 +00:00
Todd Fiala 0562524b45 On x86 & x86_64, try to use eh_frame for frame 0.
We decided to use assmbly profiler instead of eh_frame for frame 0 because for compiler generated code, eh_frame is usually synchronous(a.k.a. only valid at call site); and we have no way to tell if it's asynchronous or not.
But for x86 & x86_64 compiler generated code:
1. clang & GCC describes all prologue instructions in eh_frame;
2. mid-function stack pointer altering instructions can be easily detected.
So we can grab eh_frame, and use assembly profiler to augment it into asynchronous unwind table.
This change also benefits hand-written assembly; eh_frame for hand-written assembly is often asynchronous,so we have a much better chance to successfully unwind through them.

Change by Tong Shen.

llvm-svn: 216406
2014-08-25 20:29:09 +00:00
Greg Clayton 21405a86d9 Added a test case to ensure lldb::SBHostOS::GetLLDBPath() doesn't return lldb::SBFileSpec objects with the filename filled in for directory paths.
llvm-svn: 216399
2014-08-25 18:30:00 +00:00
Greg Clayton 0d8400c89c Change back all paths returns for lldb::PathType enumerations from HostInfo::GetLLDBPath() to return the directories in the FileSpec.m_directory field to match previous implementations. This change previously broke some path stuff in upstream branches.
llvm-svn: 216398
2014-08-25 18:21:06 +00:00
Deepak Panickal b709222b8a Fix the Windows build by removing the unused lldb_python_module.cmake inclusion from CMakeLists.
llvm-svn: 216392
2014-08-25 18:16:22 +00:00
Jason Molenda 8cd95a3b2c Add a little documentation for the register kinds
and the method to convert between them.

llvm-svn: 216372
2014-08-25 08:03:10 +00:00
Keno Fischer 5777edf05c Resurect preprocessor definitions that got lost moving to HostInfo
When building without XCode on sytems where these constants are
not in the system header (or I presume with older versions of XCode),
these are needed to make this file compile, since unlike most other
uses of MachO specific constants, these use the system headers
rather than the LLVM-defined ones.

llvm-svn: 216332
2014-08-23 21:40:29 +00:00
Enrico Granata 9f1d33637e I forgot to include the header file for std::find, and that's breaking the Linux build. Push a fix out. Patch suggested by Paul Osmialowski and Randy Smith
llvm-svn: 216323
2014-08-23 18:22:09 +00:00
Sean Callanan 0de7ecd346 Initialize LLVM when LLDB is initialized, and
install a crash handler.

<rdar://problem/18083226>

llvm-svn: 216309
2014-08-23 00:47:22 +00:00
Sean Callanan 62e9fb9727 Fixed a problem where IOObject was wrongly
capitalized.

llvm-svn: 216308
2014-08-23 00:46:02 +00:00
Enrico Granata e3eface17a Extend the encoding parser to support the @typeName syntax for Objective-C object types
llvm-svn: 216305
2014-08-23 00:20:33 +00:00
Enrico Granata 3ee335a762 Fix a couple of potential issues in the lexer where we were ignoring the putback data
llvm-svn: 216304
2014-08-23 00:11:38 +00:00
Zachary Turner cfe910b9d4 Fix a CMake error when using CMake 3.0.1
llvm-svn: 216286
2014-08-22 20:44:55 +00:00
Jason Molenda 05a09c67da When adding a dSYM to an existing ObjectFile, we can have a situation
with binaries in the dyld shared cache (esp on iOS) where the file
address for the executable binary (maybe from memory, maybe from
an expanded copy of the dyld shared cache) is different from the
file address in the dSYM.  In that case, ObjectFileMachO replaces
the file addresses from the original binary with the dSYM file
addresses (usually 0-based) -- lldb doesn't have a notion of two
file addresses for a given module so they need to agree.

There was a cache of file addresses over in the Symtab so I added
a method to the Module and the objects within to clear any file address
caches if they exist, and added an implementation in the Symtab
module to do that.
<rdar://problem/16929569> 

llvm-svn: 216258
2014-08-22 02:46:46 +00:00
Zachary Turner c25146b67b Fixes a few more places where we were manually setting the filename.
llvm-svn: 216247
2014-08-21 23:56:55 +00:00
Jason Molenda fb700b58cc Bump the verison number in the xcode project files.
llvm-svn: 216245
2014-08-21 23:27:02 +00:00
Jason Molenda 6fd86771f2 Two small fixes to get Mac native + debugserver working after the
HostInfo et al changes from Zachary.  Changes suggested by Zachary
- fixes the problems I was seeing.

llvm-svn: 216243
2014-08-21 23:22:33 +00:00
Todd Fiala 3e9af0dd1d Add missing HostInfo::Initialize() in llgs.
This fixes an llgs segfault on startup.

llvm-svn: 216238
2014-08-21 22:41:25 +00:00
Zachary Turner a21fee0ee4 Move the rest of the HostInfo functions over.
This should bring HostInfo up to 99% completion.  The remainder
of code in Host will be split into instantiatable classes
representing host processes, threads, dynamic libraries, and
process launching strategies.

llvm-svn: 216230
2014-08-21 21:49:24 +00:00
Zachary Turner e47ffc3b42 Fix compile error on Linux due to previous commit.
llvm-svn: 216227
2014-08-21 21:02:47 +00:00
Zachary Turner b245ecac79 Move GetUsername and GetGroupname to HostInfoPosix
llvm-svn: 216210
2014-08-21 20:02:17 +00:00
Zachary Turner 673b6e4f3a Convert static constructors to be explicitly initialized at startup
llvm-svn: 216197
2014-08-21 17:57:03 +00:00
Zachary Turner 42ff0ad882 Move Host::GetLLDBPath to HostInfo.
This continues the effort to get Host code moved over to HostInfo,
and removes many more instances of preprocessor defines along the
way.

llvm-svn: 216195
2014-08-21 17:29:12 +00:00
Todd Fiala 4262828132 Fix on Linux for ReadThread lingering after inferior exits
See this email thread:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140818/012487.html

This patch handles the case where the inferior process exits but leaves the ReadThread in a continuous loop reading from the communication pipe.  On MacOSX, the ReadThread exits when it receives a 0 return value from the read due to EOF.  On Linux the read returns -1 and sets errno to EIO error, this does not currently cause the thread to shutdown so it continues to read from the comm.   In Communication::ReadThread I added a handler for eConnectionStatusError to disconnect and shutdown the thread.

Change by Alex Pepper.

llvm-svn: 216194
2014-08-21 17:16:26 +00:00
Sean Callanan 7050e0b194 Fixed a typo.
<rdar://problem/18084105>

llvm-svn: 216189
2014-08-21 16:47:01 +00:00
Todd Fiala 2afc596667 Add software breakpoint support for Linux aarch64.
See http://reviews.llvm.org/D4969 for details.

Change by Paul Osmialowski.

llvm-svn: 216188
2014-08-21 16:42:31 +00:00
Todd Fiala 6ac1be4b6d Enable more Linux aarch64 PTRACE support for local and remote debugging.
See http://reviews.llvm.org/D4803 for more details.

Change by Paul Osmialowski.

llvm-svn: 216185
2014-08-21 16:34:03 +00:00
Zachary Turner 75172a9567 Revert "Avoid global contstructors and place static variables
inside classes as static local variables and remove the static
ivars. Subclasses should use the accessor functions."

This change moved global statics to function local statics, but
forgot to make the locals static in the function, breaking all
platforms.  Furthermore, MSVC doesn't support thread-safe function
local statics, so any use of a function local static on non
primitive types is undefined behavior on MSVC.

Reverting due to the fact that it's broken on all platforms, but
would like to have a discussion about the thread-safety issue
before it goes back in.

llvm-svn: 216123
2014-08-20 20:53:05 +00:00
Greg Clayton b0cc53cf97 If an executable file is specified with no architecture and it contains more than one architecture select a compatible platform if all architectures match the same platform.
This helps us "do the right thing" when loading a file without having to specify an architecture. 

<rdar://problem/18021558>

llvm-svn: 216115
2014-08-20 18:13:03 +00:00
Greg Clayton 051fd7cc10 Avoid global contstructors and place static variables inside classes as static local variables and remove the static ivars. Subclasses should use the accessor functions.
llvm-svn: 216080
2014-08-20 17:00:21 +00:00
Greg Clayton b6fd112b76 Fix warnings about overloaded virtual functions.
llvm-svn: 216077
2014-08-20 16:54:11 +00:00
Zachary Turner 13b1826104 Move Host::GetArchitecture to HostInfo::GetArchitecture.
As a side effect, this patch also eliminates all of the
preprocessor conditionals previously used to implement
GetArchitecture().

llvm-svn: 216074
2014-08-20 16:42:51 +00:00
Zachary Turner e5c1e31d2c Changes uint to uint32_t.
This fixes the build broken as a result of r216026.

llvm-svn: 216034
2014-08-19 23:28:11 +00:00
Enrico Granata a3c8f042cd Add an accessor to ValueObject that determines if the object represents a base class, and also returns the depth of base-class-ness. For instance if one has class C : public B {} class B : public A {}, the value for A nested in B nested in C would be a base class of depth 2
llvm-svn: 216032
2014-08-19 22:29:08 +00:00
Enrico Granata 73f97e24c0 Attempt to keep the Linux build happy in face of my changes. Non-Apple folks, can you confirm that this is good enough to keep things building for you?
llvm-svn: 216028
2014-08-19 21:48:27 +00:00
Enrico Granata 5d84a69731 This is a fairly bulky patch, but a lot of it involves rearranging existing code
What it does:

- it introduces a concept of EncodingToType to the ObjCLanguageRuntime
  The ObjC runtime has a "type encoding" feature that describes types as strings
  The EncodingToType is a decoder for that format, making types out of type encoding strings
This feature already existed in some shape as we were using it to create method signatures out of the runtime, but this checkin extends the parser to support the full syntax, and moves things so that more parts of LLDB have access to this decoder

- it splits the ClassDescriptorV2 object to its own file, it was starting to grow too large

- it adds to the ClassDescriptor mechanism a notion of ivar storage; the ObjC runtime vends ivar information as well as method information
While ivar information is not ready for prime type (i.e. we don't want to add it to the runtime generated types for expression evaluator usage), there are potentially useful scenarios in which realizing ivar types could be useful. For now, the ClassDescriptor is going to hold ivar information directly. Existing code already allows describing ivars, this patch hooks those moving parts up so that one can actually ask a ClassDescriptor about ivars for the class it represents

and as a couple minor niceties:
- it makes it possible to retrieve the LLDB ClangASTContext that is associated to a clang::ASTContext
- it extends the ValueObject-to-ClassDescriptor API in the language runtime to deal correctly with base-class hierarchies

llvm-svn: 216026
2014-08-19 21:46:37 +00:00
Ed Maste 9163561d64 Fix FreeBSD build after r215992
llvm-svn: 216021
2014-08-19 21:00:37 +00:00
Enrico Granata ecd02bc136 Refactor the hardcoded formatters facility to use sequences of lambdas - still no feature change as none are present now, but this feels cleaner. Also, hardcoded formatters do not need to be per-type, so disable caching thereof
llvm-svn: 216004
2014-08-19 18:47:58 +00:00
Zachary Turner c4a4110deb Add includes needed for FreeBSD.
llvm-svn: 216000
2014-08-19 18:38:53 +00:00
Todd Fiala 5163792b7b Adjust process launch --disable-aslr to take true/false value.
This change modifies the 'process launch' --disable-aslr option to take a boolean argument.  If the user directly specifies --disable-aslr {true,false}, that setting will control whether the process is launched with ASLR disabled accordingly.  In the event that the setting is not explicitly made on the process launch command line, then the value is retrieved from the target.disable-aslr setting (i.e. settings show target.disable-aslr).

llvm-svn: 215996
2014-08-19 17:40:43 +00:00
Zachary Turner b25e7b42a9 Fix .clang-format file to adhere to LLDB 140 column limit.
llvm-svn: 215993
2014-08-19 17:18:38 +00:00
Zachary Turner 97a14e60b2 Move some Host logic into HostInfo class.
This patch creates a HostInfo class, a static class used to answer
basic queries about the host platform.  As part of this change,
some functionality is moved from Host to HostInfo, and relevant
fixups are performed in the rest of the codebase.

This is part of a larger effort to isolate more code in the Host
layer into platform-specific groups, to make it easier to make
platform specific changes for a particular Host without breaking
other hosts.

Reviewed by: Greg Clayton

Differential Revision: http://reviews.llvm.org/D4963

llvm-svn: 215992
2014-08-19 17:18:29 +00:00
Sylvestre Ledru 802a353065 Buffer not null terminated CID 1094354
llvm-svn: 215976
2014-08-19 12:13:14 +00:00
Rafael Espindola 7c03d95725 Update for llvm api change.
llvm-svn: 215969
2014-08-19 04:27:03 +00:00
Greg Clayton baac2afccf Cleanup how we listen for process events by using the broadcaster class name instead of having to catch each process instance as it comes alive.
llvm-svn: 215937
2014-08-18 21:09:50 +00:00
Greg Clayton 994740fb1a Don't search for module resources at all if the setting is set to "false".
llvm-svn: 215936
2014-08-18 21:08:44 +00:00
Greg Clayton c7ad505948 Added newline at end of file to avoid compiler warning.
llvm-svn: 215903
2014-08-18 16:57:46 +00:00
Zachary Turner 3ffabc2bce Fix an issue with source file groupings in the CMake build.
llvm-svn: 215901
2014-08-18 16:47:33 +00:00
Sylvestre Ledru 1c9e0646b9 add missing break. Fix CID 1229446 & 1203680
llvm-svn: 215894
2014-08-18 14:53:42 +00:00
Sylvestre Ledru 75f11ebfb3 Fix the missleading indentation. Fix CID 1096332
llvm-svn: 215893
2014-08-18 14:50:34 +00:00
Sylvestre Ledru ca902e81ed Fix the missleading indentation. Fix CID 1096300
llvm-svn: 215892
2014-08-18 14:48:24 +00:00
Ed Maste 650db810a8 Update comment for functionality not present in ObjectFile
It looks like this comment was not changed during some refactoring that
happened prior to the initial LLDB public release.

llvm-svn: 215835
2014-08-17 13:59:36 +00:00
Todd Fiala 0bce1b67a3 Fix Linux to respect ASLR settings when launching processes to debug locally and remotely.
See the following links for details:
http://llvm.org/bugs/show_bug.cgi?id=20658
See http://reviews.llvm.org/D4941

llvm-svn: 215822
2014-08-17 00:10:50 +00:00
Enrico Granata 781a7b04f2 Enable the data formatter for std::vector<bool> on libc++ again. In recent clang builds, we are vended a different typename, which the formatter needs to match against.
llvm-svn: 215801
2014-08-16 01:02:36 +00:00
Enrico Granata e4a4f5d5ba When attempting to print function names with arguments in frame formatting, attempt to detect templated functions, and replace the argument list with values outside the template marking. Turns C::f<(this=0x00007fff5fbffb70, x=2, y=1)0>(int, int) into C::f<(C::V)0>(this=0x00007fff5fbffb70, x=2, y=1), which definitely looks more like the real thing. Fixes rdar://14882237
llvm-svn: 215800
2014-08-16 00:56:04 +00:00
Enrico Granata fe7295dcf5 In order for the debug script filename to be valid as a module name, LLDB does some textual replacements. However, if one were unaware of this, they might name their script using the 'untampered' file name and they would get no feedback about it. Add logic to LLDB to make sure we tell people about those changes if it turns out they might need to know. Fixes rdar://14310572
llvm-svn: 215798
2014-08-16 00:32:58 +00:00
Zachary Turner 4ec5d0d0e1 In the CMake build, convert lldbHost to be a single static library.
Previously lldbHost was built as multiple static libraries such as
lldbHostCommon, lldbHostLinux, etc.  With this patch, the CMake
build produces only a single static library, lldbHost, whose file
set is dynamically created based on the platform.

llvm-svn: 215792
2014-08-15 23:50:36 +00:00
Zachary Turner 76eddae8dd Still trying to fix the Make build. Link lldbHostPosix to liblldb
llvm-svn: 215788
2014-08-15 23:27:37 +00:00
Enrico Granata e8bf749653 Add functions to ClangASTContext to get integer types of a given byte size
llvm-svn: 215783
2014-08-15 23:00:02 +00:00
Zachary Turner 3c19a6ac48 Try to fix the Make build
llvm-svn: 215782
2014-08-15 22:50:48 +00:00
Eric Christopher 29ebb01201 Remove another of the llvm given warnings from the list of
warnings we compile with because of SWIG generated code.

llvm-svn: 215778
2014-08-15 22:23:40 +00:00
Zachary Turner c00cf4a068 Move FileSystem functions out of Host and into their own classes.
More specifically, this change can be summarized as follows:
1) Makes an lldbHostPosix library which contains code common to
   all posix platforms.
2) Creates Host/FileSystem.h which defines a common FileSystem
   interface.
3) Implements FileSystem.h in Host/windows and Host/posix.
4) Creates Host/FileCache.h, implemented in Host/common, which
   defines a class useful for storing handles to open files needed
   by the debugger.

Differential Revision: http://reviews.llvm.org/D4889

llvm-svn: 215775
2014-08-15 22:04:21 +00:00
Jason Molenda f0e4c5e32b Fix dependency ordering for the xpc file installs.
llvm-svn: 215771
2014-08-15 21:38:13 +00:00
Greg Clayton 39945dcc0b Missed a few places where we need to report unreadable executables.
<rdar://problem/17727734>

llvm-svn: 215743
2014-08-15 18:03:30 +00:00
Greg Clayton 5acc12550f Don't crash when specifying a core file that isn't readable.
Fixes include:
1 - added new FileSpec method: bool FileSpec::Readable()
2 - detect when an executable is not readable and give an appropriate error for:
    (lldb) file /tmp/unreadablefile
3 - detect when a core file is not readable and give an appropriate error
4 - detect when a specified core file doesn't exist and give an appropriate error
    
<rdar://problem/17727734>

llvm-svn: 215741
2014-08-15 18:00:45 +00:00
Jim Ingham 368ac22358 Fix a thinko in the process list formatting.
Made Process::Attach list the matching processes if there is more than one match.

<rdar://problem/18023352>

llvm-svn: 215730
2014-08-15 17:05:27 +00:00
Eric Christopher 7cbd2b9910 Fix typo in error message.
llvm-svn: 215681
2014-08-14 23:04:28 +00:00
Zachary Turner 015ebbc8c7 Update .gitignore for MacOSX
Differential Revision: http://reviews.llvm.org/D4912

llvm-svn: 215674
2014-08-14 20:19:57 +00:00
Greg Clayton 2d4b5129ed fix the _regexp-break command to allow quotes around the name:
(lldb) b "Foo::Bar::Baz"

<rdar://problem/11782098>

llvm-svn: 215668
2014-08-14 17:58:33 +00:00
Hafiz Abid Qadeer eba7eb7b3f Fix 'pid' and 'executable' fields in the list-thread-group.
The documentation says that these fields should be generated when 
we have proper process or target file. Current implementation did not
check for this. Eclipse seem to use list-thread-group command even
before setting the executable in which case current implementation
can return garbage data.

llvm-svn: 215658
2014-08-14 16:45:50 +00:00
Hafiz Abid Qadeer 6cd101a325 Implementation of exec-run using lldb API.
Previously it was using run command which did not set the process
pointer in the sessionInfo. This commit also sends the proper
out-of-band data.

llvm-svn: 215656
2014-08-14 16:40:27 +00:00
Deepak Panickal f92dc58f0d Fix command "gdb-set" to handle long option --threadgroup and accept --longOption type words as just words for string types.
For example, MI command "17-gdb-set --thread-group i1 args --interpreter" is now acceptable, "--interpreter" was previous not valid.

llvm-svn: 215655
2014-08-14 16:40:15 +00:00
Zachary Turner 43f30a4082 Modification to clang-format style.
Fixes constructor initializer list and function return type style.

llvm-svn: 215654
2014-08-14 16:29:15 +00:00
Zachary Turner 696b52878f Refactor FileAction out of ProcessLaunchInfo.
FileAction was previously a nested class in ProcessLaunchInfo.
This led to some unfortunate style consequences, such as requiring
the AddPosixSpawnFileAction() funciton to be defined in the Target
layer, instead of the more appropriate Host layer.  This patch
makes FileAction its own independent class in the Target layer,
and then moves AddPosixSpawnFileAction() into Host as a result.

Differential Revision: http://reviews.llvm.org/D4877

llvm-svn: 215649
2014-08-14 16:01:25 +00:00
Greg Clayton 32e5d8f3c0 Don't enable STDIN for cases where we are supplying lines to be run in the embedded python interpreter.
<rdar://problem/17949057>

llvm-svn: 215608
2014-08-14 00:44:40 +00:00
Han Ming Ong 70d8170711 <rdar://problem/18001677>
Use the right mechanism to put the XPC services now that Xcode supports the workflow.

llvm-svn: 215596
2014-08-13 22:44:37 +00:00
Zachary Turner f818625103 Update clang-format file.
llvm-svn: 215572
2014-08-13 20:08:28 +00:00
Ed Maste 6bc862dcf5 Use consistent capitalization for ENABLE_THREADS in tests
llvm-svn: 215565
2014-08-13 18:27:12 +00:00
Zachary Turner c7826524ac Get test executables compiling on Windows.
Many of the test executables use pthreads directly.  This isn't
portable on Windows, so this patch converts these test to use
C++11 threads and mutexes.  Since Windows' implementation of
std::thread classes throw and catch from header files, this patch
also disables exceptions when compiling with clang on Windows.

Reviewed by: Todd Fiala, Ed Maste

Differential Revision: http://reviews.llvm.org/D4816

llvm-svn: 215562
2014-08-13 17:44:53 +00:00
Jason Molenda 06adbc4e0d gcc_esp_i386 and gcc_ebp_i386 had their values backwards for
i386 eh_frame register numbering, encoding a darwin-specific
bug in the register numbering.  Update the definitions to be
the correct values, Darwin can use the register numbers from
debugserver.  Patch from Tong Shen.

llvm-svn: 215488
2014-08-13 00:52:49 +00:00
Jason Molenda cfe8fc3e28 Add comment explaining the dwarf v. eh_frame register numbering used
on i386 darwin.

llvm-svn: 215484
2014-08-13 00:21:31 +00:00
Greg Clayton bc76668142 Fixed launching in shell on haswell enabled Macs to work more than once when you do:
% lldb -x /bin/ls
(lldb) r
(lldb) r

Prior to this fix the first time it would run /usr/bin/arch with "-arch x86_64" the first time and succeed, and fail the second when the target had updated its architecture to x86_64h. We can't specify x86_64h to /usr/bin/arch, it doesn't handle it.

Also fixed it so /usr/bin/arch is only used for Apple triples.

<rdar://problem/17951312>

llvm-svn: 215475
2014-08-12 21:38:59 +00:00
Todd Fiala 58a2f6692b llgs: corrected Linux signal reception notification for SIGABRT, SIGSEGV and their ilk.
Added llgs/debugserver gdb-remote tests around SIGABRT and SIGSEGV signal reception
notification.  Found a few bugs in exception signal handling in Linux llgs.  Fixed those.

llvm-svn: 215458
2014-08-12 17:02:07 +00:00
Todd Fiala a3b89e272c Fix iohandler prompt race condition.
This issue caused the lldb prompt to not show up in certain cases, very
noticeable on Linux systems.

See details on this review:
http://reviews.llvm.org/D4863

And on this lldb-commits thread:
http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140811/012306.html

Change by Shawn Best.

(Much useful help and testing by the rest of the community, thanks all!)

llvm-svn: 215446
2014-08-12 14:33:19 +00:00
Todd Fiala 7116562d0a Fix incorrect Linux i386 register info initialization on x86_64.
Fix by Tong Shen.

llvm-svn: 215424
2014-08-12 05:26:52 +00:00
Jim Ingham 76447851ad Fetching the parent frame may fail, handle that case. Patch from Tong Shen.
llvm-svn: 215411
2014-08-11 23:57:43 +00:00
Zachary Turner 504ec2115d Remove a few uses of LLDB_DISABLE_POSIX.
This all appears to have been dead, unnecessary code.

llvm-svn: 215405
2014-08-11 22:59:50 +00:00
Enrico Granata 4ec130dcab Patch to enable LLDB to extract value bytes from DWARF block forms and udata/sdata forms. By Greg Clayton
llvm-svn: 215379
2014-08-11 19:16:35 +00:00
Sylvestre Ledru f6102892ef Fix some typos:
* transfered => transferred
* unkown => unknown
* sucessfully => successfully

llvm-svn: 215367
2014-08-11 18:06:28 +00:00
Sylvestre Ledru fca534444b Also build lldb-gdbserver under KFreeBSD
llvm-svn: 215345
2014-08-11 06:29:06 +00:00
Saleem Abdulrasool 478bc69c20 Windows: update for LLVM API change
MinGW32 and Cygwin have been removed from the OSType enumeration.  They are
represented as environments, and the OS is Windows in both of those cases.
Simply remove the value from the switch.

llvm-svn: 215304
2014-08-09 23:12:28 +00:00
Saleem Abdulrasool 1abc1a5e14 Host: remove unused function
Remove unused static function identified by GCC 4.8.2.

llvm-svn: 215300
2014-08-09 22:25:06 +00:00
Zachary Turner e88be264de Implement some common file operations on Windows.
llvm-svn: 215273
2014-08-09 01:29:07 +00:00
Zachary Turner 1cfb98abb2 Fix a bug where SetFilePermissions was calling MakeDirectory.
This appears to have been a copy / paste error.

llvm-svn: 215265
2014-08-09 00:25:50 +00:00
Zachary Turner b6d9924439 Fix bug causing FileSpec::GetPath() to crash with a null dest.
llvm-svn: 215262
2014-08-08 23:54:35 +00:00
Zachary Turner e96838e304 Fix some python shutdown / ordering issues.
Differential Revision: http://reviews.llvm.org/D4826

Reviewed by: Enrico Granata

llvm-svn: 215256
2014-08-08 23:20:25 +00:00
Jim Ingham 7ab079b6d0 Add an option to suppress the persistent result variable when running EvaluateExpression
from Python.  If you don't need to refer to the result in another expression, there's no
need to bloat the persistent variable table with them since you already have the result
SBValue to work with.

<rdar://problem/17963645>

llvm-svn: 215244
2014-08-08 21:45:36 +00:00
Jim Ingham e7701fee0b Fix a thinko in the memory allocator that was causing us to strand an allocation range
in all but one of the AllocatedBlocks that matched the requested permissions.

Over time this would make the performance of expressions slow down considerably.

Also added a little bit of logging that was helpful in resolving the issue.

<rdar://problem/17954438>

llvm-svn: 215239
2014-08-08 20:01:41 +00:00
Deepak Panickal 7f6edd52c9 Restore some reverted fixes for spelling, newlines and __linux__ macro.
llvm-svn: 215234
2014-08-08 17:39:47 +00:00
Deepak Panickal d249928b84 Add new MI commands, features and fixes to the lldb-mi driver.
- Can now load an executable directly as an argument.
- Fixes towards supporting local debugging.
- Fixes for stack-list-arguments, data-evaluate-expression, environment-cd, stack-list-locals, interpreter-exec.
- Fix breakpoint event handling.
- Support dynamic loading of libraries using the search paths provided by Eclipse.

llvm-svn: 215223
2014-08-08 16:47:42 +00:00
Jason Molenda e66876fced Add newline at end of IOObject.h to silence clang warning.
llvm-svn: 215182
2014-08-08 02:25:17 +00:00
Jim Ingham 0c2b9d2a1c Don't duplicate the logic of the ThreadPlanShouldStopHere::DefaultShouldStopHereCallback
in the ThreadPlanStepInRange's implementation, just call it...

llvm-svn: 215178
2014-08-08 01:27:01 +00:00
Zachary Turner cdc029d04b Disable the command pipe in ConnectionFileDescriptor for Windows.
The select() API on Windows is not compatible with objects other
than sockets, so passing a descriptor for the command pipe to this
function is guaranteed to fail.  ConnectionFileDescriptor is still
broken on Windows after this patch, but slightly less broken than
before.

llvm-svn: 215172
2014-08-07 23:35:20 +00:00
Zachary Turner d867520d0b Revert "Fix the build broken as a result of deleting jit from LLVM."
jit was re-added back to LLVM, so now we require to link against it
again.  Should it get removed again, then revert this revert.

llvm-svn: 215170
2014-08-07 23:26:01 +00:00
Jim Ingham 5b1fe95dd7 Restore the handling of the --arch argument passed to the Driver that was inadvertently
removed in r214319.

<rdar://problem/17948431>

llvm-svn: 215165
2014-08-07 23:01:31 +00:00
Jim Ingham e1d263eefc r215124 missed a few Mac OS X only uses of FileSpec::Resolve, fixing to match
the new signature.

llvm-svn: 215159
2014-08-07 22:37:43 +00:00
Jim Ingham 7fa8b17e4f Fix the description of FileSpec::Resolve to match the new signature.
llvm-svn: 215158
2014-08-07 22:34:50 +00:00
David Majnemer ec2fac8a13 StringLexer: Fix CMake build
llvm-svn: 215144
2014-08-07 20:48:39 +00:00
Ed Maste 42461e9f13 Use standard realloc so FreeBSD Host.cpp can use glibc
To fix building on Debian GNU/kFreeBSD, which uses the FreeBSD kernel
with a GNU userland.

llvm-svn: 215134
2014-08-07 19:28:02 +00:00
Enrico Granata a02d625513 Add a StringLexer utility class that can be used when you have string data that needs to be parsed - I don't think such a general purpose facility is part of LLVM, and I am going to need this, so just add it to lldb_utility
llvm-svn: 215133
2014-08-07 19:22:14 +00:00
Zachary Turner 3f55974024 Optimizations for FileSpec.
llvm-svn: 215124
2014-08-07 17:33:36 +00:00
Zachary Turner df62f20c75 Fix FileSpec to be able to understand Windows paths.
This patch adds the notion of a "path syntax" to FileSpec.  There
are two syntaxes (Posix and Windows) and one "meta syntax",
Host Native, which uses the current platform to figure out the
appropriate syntax for host paths.

This allows paths from one platform to be represented and
manipulated on another platform even if they have different path
syntaxes.

llvm-svn: 215123
2014-08-07 17:33:07 +00:00
Zachary Turner c349434010 Fix the build broken as a result of deleting jit from LLVM.
llvm-svn: 215119
2014-08-07 16:50:45 +00:00
Hafiz Abid Qadeer 101e490b1e Fixed the build broken by the r215046.
llvm-svn: 215107
2014-08-07 12:54:20 +00:00
Keno Fischer 3d7162b1cc Fix ProcessKDP after Host/Socket addition
Reviewers: zturner

Subscribers: lldb-commits

Differential Revision: http://reviews.llvm.org/D4815

llvm-svn: 214996
2014-08-06 21:18:13 +00:00
Zachary Turner 98688922b7 Creates a socket host object.
This patch moves the logic of many common socket operations into
its own class lldb_private::Socket.  It then modifies the
ConnectionFileDescriptor class, and a few users of that class,
to use this new Socket class instead of hardcoding socket logic
directly.

Finally, this patch creates a common interface called IOObject for
any objects that support reading and writing, so that endpoints
such as sockets and files can be treated the same.

Differential Revision: http://reviews.llvm.org/D4641

Reviewed by: Todd Fiala, Greg Clayton

llvm-svn: 214984
2014-08-06 18:16:26 +00:00
Ed Maste a11da0c8cd Add decorators for tests failing to build on the lab.llvm.org FreeBSD buildbot
llvm.org/pr20548

llvm-svn: 214960
2014-08-06 11:43:54 +00:00
Jim Ingham 862d1bbdf6 When stepping, handle the case where the step leaves us with
the same parent frame, but different current frame - e.g. when
you step past a tail call exit from a function.  Apply the same
"avoid-no-debug" rules to this case as for a "step-in".

<rdar://problem/16189225>

llvm-svn: 214946
2014-08-06 01:49:59 +00:00
Jim Ingham 6d8873f94b Probably should initialize that new ivar while I'm at it...
llvm-svn: 214941
2014-08-06 00:24:38 +00:00
Jim Ingham 3b652621a9 Add a variant of the CommandOverrideCallback that takes a
CommandReturnObject.  Otherwise, all the overridden command
can do is say it overrode the command, not say what it did...

Also removed the duplicate definition of CommandOverrideCallback
from the private interfaces.

Now to figure out how to get this through the SB API's...

<rdar://problem/17911629>

llvm-svn: 214938
2014-08-06 00:10:12 +00:00
Ed Maste 6e496338e6 Force trace on system() failure on FreeBSD while tracking down buildbot issues
llvm-svn: 214922
2014-08-05 20:33:17 +00:00
Ed Maste 2efa42c937 On FreeBSD skip test that produces bogus output
The test produces lines that start with "<word>: " which confuses the
buildbot log parser.  Disable the test until either the test is fixed
or the buildbot can deal with the undesired output.

llvm.org/pr20545

llvm-svn: 214900
2014-08-05 17:50:04 +00:00
Jim Ingham 5beccb22bc If you found a step through plan stop looking up the stack for a step out plan.
llvm-svn: 214837
2014-08-05 01:59:20 +00:00
Jim Ingham cca8995ab2 Add some useful logging to the step log.
llvm-svn: 214836
2014-08-05 01:58:14 +00:00
Zachary Turner f490bec4a1 Teach ProcessWindows plugin to support stdio i/o redirection.
llvm-svn: 214816
2014-08-04 23:31:21 +00:00
Jason Molenda 300dfcd28d Add code to AssemblyParse_x86::get_non_call_site_unwind_plan
to recognize an epilogue that ends with a jmp to 
objc_retainAutoreleaseReturnValue instead of a ret instruction.
<rdar://problem/17889928> 

llvm-svn: 214783
2014-08-04 21:26:55 +00:00
Jason Molenda 921c01b5e5 Change ProcessGDBRemote::DidLaunchOrAttach to
call Target::SetArchitecture instead of modifying a
reference to the target's architecture so that the
target logging can show that the arch has been changed.

llvm-svn: 214667
2014-08-03 21:42:52 +00:00
Zachary Turner fb903ab7d4 Make the swig generation script use the correct python executable.
It was hardcoding the value "python", which will end up at best
getting a different python executable (if the user has overridden
the value of PYTHON_EXECUTABLE), and at worst encountering an
error (if there is no copy of python on the system path).

This patch changes the script to use sys.executable so that it
runs the sub-script with the same executable that it was run with.

llvm-svn: 214618
2014-08-02 07:11:22 +00:00
Jim Ingham bb006ce291 After you attach, give the process plugin a chance to report back (through
DidAttach) the architecture of the binary you attached to.

<rdar://problem/17891396>

llvm-svn: 214603
2014-08-02 00:33:35 +00:00
Greg Clayton 7fde1b3b83 Now that setting an architecture from a mach-o CPU type and subtype doesn't set the OS type, make sure to set it.
llvm-svn: 214600
2014-08-02 00:15:37 +00:00
Sean Callanan 608fb390a8 Fixed a problem in the Clang AST importer where
we overrode debug information as the authoritative
source for type information, substituting types
from the Objective-C runtime.  The runtime should
never be the primary source.

<rdar://problem/16065049>

llvm-svn: 214583
2014-08-01 22:42:38 +00:00
Greg Clayton 4184c79975 Don't hand compute mydir, do it using "TestBase.compute_mydir(__file__)".
llvm-svn: 214575
2014-08-01 22:10:13 +00:00
Greg Clayton 4966876597 Convert over to using pipes for the initial LLDB commands in the Driver.
This will avoid having to use a temp file and adding temp file related calls to the public API.

llvm-svn: 214536
2014-08-01 18:32:07 +00:00
Ed Maste 362f5de276 Add decorator for FreeBSD test failure - malloc() breakpoint issue
llvm.org/pr20476

llvm-svn: 214527
2014-08-01 17:04:31 +00:00
Ed Maste 098a40180c Fix test execution: the cmake keyword is CACHE, not CACHED
llvm-svn: 214522
2014-08-01 16:57:46 +00:00
Sylvestre Ledru 186ca7dd59 Update the code with clang changes r214450 (FunctionProtoType::ExtProtoInfo update)
llvm-svn: 214501
2014-08-01 12:19:15 +00:00
Matthew Gardiner f39ebbe613 Change the encoding of the Triple string exchanged across GDB-RSP
and update documentation to suit, as suggested by Jason Molenda and
discussed in:

http://lists.cs.uiuc.edu/pipermail/lldb-commits/Week-of-Mon-20140721/011978.html

Differential Revision: http://reviews.llvm.org/D4704

llvm-svn: 214480
2014-08-01 05:12:23 +00:00
Zachary Turner 7c1bc2b8ae Make CMake choose the target architecture according to the build.
Previously, CMake was invoking the test runner and not specifying
what architecture to use when building test executables.  The
Makefiles for the test executables then had logic to choose x64
by default.  This doesn't work on Windows because the test compiler
would then try to link against the 64-bit MSVCRT and not find them
since only the 32-bit MSVCRT was in the path.

This patch addresses this by figuring out, at CMake time, whether
or not you are building LLDB with a 64 or 32-bit toolchain.  Then,
it explicitly passes this value to the test runner, causing the
test runner to build tests whose architecture matches that of LLDB
itself.  This can still be overridden by setting the CMake variable
LLDB_TEST_EXECUTABLE_ARCH=(x64|x86)

llvm-svn: 214443
2014-07-31 21:07:41 +00:00
Zachary Turner 7d186c0152 Remove shell-globbing from all test makefiles.
llvm-svn: 214441
2014-07-31 21:03:11 +00:00
Greg Clayton 380f3d8334 Fixed an issue where the LLDB command prompt isn't interactive if you use -o -O -S -s or specify a file on the command line.
This means TAB completion wasn't working and editline wasn't being used.

<rdar://problem/17872824> 

llvm-svn: 214428
2014-07-31 19:46:19 +00:00
Greg Clayton ac58361047 Rewrote the initial DW_OP_piece support to be able to support opcodes like:
DW_OP_fbreg(N) DW_OP_piece(4) DW_OP_fbreg(M) DW_OP_piece(8)
DW_OP_fbreg(N) DW_OP_piece(4) DW_OP_piece(8)

The first grabs 4 bytes from FP+N followed by 8 bytes from FP+M, the second grabs 4 bytes from FP+N followed by zero filling 8 bytes which are unavailable. Of course regiters are stuff supported:

DW_OP_reg3 DW_OP_piece(4) DW_OP_reg8 DW_OP_piece(8)

The fix does the following:
1 - don't push the full piece value onto the stack, keep it on the side
2 - fill zeros for DW_OP_piece(N) opcodes that have nothing on the stack (instead of previously consuming the full piece that was pushed onto the stack)
3 - simplify the logic

<rdar://problem/16930524>

llvm-svn: 214415
2014-07-31 18:19:28 +00:00
Ed Maste c82dd2b058 Add decorator for TestStopHookMultipleThreads failing on FreeBSD
llvm.org/pr15037

llvm-svn: 214402
2014-07-31 14:02:32 +00:00
Jason Molenda eff58f0d93 Add a new directory path to
PlatformDarwinKernel::GetGenericSDKDirectoriesToSearch
 - /Library/Developer/KDKs where users may store 
the kernel debug kits on their systems.

Change PlatformDarwinKernel::GetKextDirectoriesInSDK
to look in the root directory of places like
/Library/Developer/KDKs/KDK_10.10_14A298i.kdk
as well as the System/Library/Extensions subdir
in that directory (if it exists) and the
Library/Extensions subdir in that directory (if it
exists).
<rdar://problem/16568635> 

llvm-svn: 214391
2014-07-31 06:36:24 +00:00
Jason Molenda a02869de00 When doing an exhaustive search for the kernel in memory, also look
at 16k offsets.
<rdar://problem/17861781> 

llvm-svn: 214387
2014-07-31 06:07:04 +00:00
Zachary Turner 31dd2c125f Disable test on Windows. script print deadlocks on Windows.
llvm-svn: 214351
2014-07-30 22:08:17 +00:00
Enrico Granata 2aa09d4319 When resetting the number of children on a ValueObject, also clear the existing children. This avoids issues where dynamic types change, but children stay the same
llvm-svn: 214341
2014-07-30 21:23:55 +00:00
Enrico Granata eccdbde667 Revert a part of r214335 that I didn't mean to commit
llvm-svn: 214340
2014-07-30 21:10:03 +00:00